Evo at least requires a C++03 (ideally C++11) compliant compiler.
Without C++11, Evo uses some compiler specific features, most notably with threads and atomic operations.
- Optimization
Evo uses optimizations that take advantage of SSE 4.2 and SSE 2 CPU instructions (via compiler intrinsics). These are mainly used for string scanning/parsing and bit manipulation.
- Most compilers enable at least SSE 2 instructions by default, which is supported by all x64 CPUs
- Evo follows the compiler options by default (using macros set by compiler) – defaults are generally preferred, but you may fine-tune for more specific hardware
- Note that Evo uses SSE 4.2 by default when AVX or AVX2 is enabled with the compiler
- When fine tuning for best performance, testing and benchmarking is recommended as results may vary
Notes for best performance:
- GCC & Clang
- Compile with
-msse4.2
to enable optimizations for SSE 4.2 instructions (if requiring a CPU with SSE 4.2 support is acceptable)
- You can also optimize further for current or specific hardware with
-march=
and -tune=
- See: https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
- Tools like valgrind may have issues with SSE 4.2 instructions, with errors like: Unknown instruction/opcode
- MSVC:
Code Generation
is configured under C/C++
configuration for project, or with /arch
option
- MSVC doesn't have an option to enable SSE 4.2 – if needed enable this by defining
EVO_USE_SSE42
(before including Evo headers) (if requiring a CPU with SSE 4.2 support is acceptable)
- You can also enable Evo SSE 4.2 use by enabling AVX code generation (if requiring a CPU with AVX support is acceptable)
- See: https://docs.microsoft.com/en-us/cpp/build/reference/arch-minimum-cpu-architecture?view=vs-2017
- Testing
Tested on the following systems and compilers:
Ubuntu
- 18.04: gcc 7.4.0, clang 6.0.0, valgrind 3.13.0 – Intel Core i7
- 16.04: gcc 5.4.0, clang 3.8.0, valgrind 3.11.0 – Intel Core i7
- 14.04: gcc 4.8.4, clang 3.4.0, valgrind 3.10.1 – VM
- Also: gcc 4.6.4, gcc 4.7.3
CentOS – VM
- 7.6: gcc 4.8.5, clang 3.4.2, valgrind 3.13.0
- 6.10: gcc 4.4.7, clang 3.4.2
FreeBSD – VM
- 12.0: clang 6.0.1, valgrind 3.10.1
MacOS – Intel Core i5
- 10.13.6: Apple LLVM 10.0.0 (clang 1000-10.44.4)
Windows 10 – Intel Core i7
- MSVC 2017 Community 15.9.11, libevent 2.1.8, libevent 2.0.22
- MSVC 2015 Community Update 3
Windows 7 SP1 32-bit – VM
- MSVC 2013 Community Update 5, libevent 2.1.8, libevent 2.0.22
- cygwin 3.0.6: gcc 7.4.0
- Notes
- All tested systems are 64-bit, unless otherwise noted
- Microsoft Visual C++:
- Cygwin:
- For C++11 (or newer), enable with the
gnu++
option variant to avoid compile errors, ex: g++ -std=gnu++11
- Older compilers (like gcc 4.4 or clang 3.4) should use
-fno-strict-aliasing
to avoid warnings and stability issues
- RedHat GCC 4.4 on CentOS 6 has a vtable optimization bug, see here
- See also: Build Dependencies