feeLLGood – Compiler options
more on ScalFMM installation
If available on the build computer, ScalFMM will use the AVX SIMD instruction set extensions to speed up vector computations. If AVX is not available, it will fall back to the older SSE 4.2. You can check which extensions it uses by issuing the command:
grep -E 'SCALFMM_USE_(AVX|SSE)' /usr/local/include/Utils/ScalFmmConfig.h
which should display
/* #undef SCALFMM_USE_SSE */
#define SCALFMM_USE_AVX
if AVX is enabled, and otherwise
#define SCALFMM_USE_SSE
/* #undef SCALFMM_USE_AVX */
If you are building FeeLLGood for running on a target computer which is different from the one doing the build, you may want to explicitly request a specific SIMD extension. In this case, replace the command cmake ..
of the ScalFMM build by either
cmake .. -DSCALFMM_USE_SSE=ON
or
cmake .. -DSCALFMM_USE_AVX=ON
In this case, you will also have to edit the CMAKE_CXX_FLAGS variable in FeeLLGood's CMakeLists.txt, and replace -march=native
by either -msse4.2 -mfpmath=sse
or -mavx
. On some computers, despite the presence of AVX instruction set, you may have to manually recompile for SSE instruction set. You can check if AVX is available manually typing
lscpu | grep avx
If you want to recompile and reinstall ScalFMM, you have to enter the Build directory and empty it, and then redo the installation from cmake
step with the options you wish.
detailed description of the FeeLLGood compiler options
The different dependencies of feellgood needs various minimal C++ versions:
- C++ 17 for FeeLLGood source
- C++ 14 for ScalFMM
- C++ 98 (or higher) ANN
Each makefile and/or CmakeLists.txt given with the corresponding sources fix this.
We recommend to use gcc, but any up-to-date compiler respecting modern standards should be fine, such as clang.
Some options are given to the compiler:
- -Wall
- -Wextra
These other options should not be modified:
- -fopenmp for multiThreading with Open MP
- -std=c++17
- -march=native
- -O2 or -O3 for optimizations
Link dependencies:
- tbb : all C++17 parallel execution policies with gcc are using it
It is possible to use -mavx
option if your computer supports this assembler instruction set extension instead of -march=native
, or -msse4.2
and -mfpmath=sse
, but you should consider recompiling ScalFMM.