Situation
nvcc --version
: 10.1, V10.1.168
gcc --version
: Debian 6.3.0-18+deb9u1 6.3.0 20170516
Chrono version: 4.0.0
Action 1
Building and running problem DamBreak3D is fine
Action 2
Instead
make problem=CompleteSaExample chrono=1
leads to
...
[CC] ProblemCore.o
[[CC] pugixml.o
[CC] vector_print.o/usr/lib/gcc/x86_64-linux-gnu/6/include/avx512fintrin.h(9218): error: argument of type "const void *" is incompatible with parameter of type "const float *"
[...repeat x44 with types varying...]
[CC] Synchronizer.o/usr/lib/gcc/x86_64-linux-gnu/6/include/avx512vlintrin.h(10979): error: argument of type "const void *" is incompatible with parameter of type "const long long *"
/usr/lib/gcc/x86_64-linux-gnu/6/include/avx512vlintrin.h(10989): error: argument of type "void *" is incompatible with parameter of type "float *"
[...repeat x48 with types varying...]
[CC] VTUReader.o
[CC] main.o
[CC] Options.o
[CC] base64.o
[CC] GPUSPH.o
[CC] Integrator.o92 errors detected in the compilation of "/tmp/tmpxft_00000621_00000000-6_CompleteSaExample.cpp1.ii".
Makefile:1000: recipe for target 'build/problems/CompleteSaExample.o' failed
make: *** [build/problems/CompleteSaExample.o] Error 1
make: *** Waiting for unfinished jobs....
The header files avx512fintrin, avx512pfintrin and avx512vlintrin relate to the instruction set architecture AVX-512. The CPU processor is model Intel® Xeon® Silver 4112 CPU @ 2.60GHz: full specifications here.
Question
Any idea why turning Chrono on causes this conflict (assuming this is the reason) and how to work around it? Thanks in advance for digging into this. More info available upon request.
Shallow research (added)
suggests that the problem resides with three instruction subsets of AVX-512: F for foundation PF for prefetch instructions, and VL for vector length extensions. Parsing the header file names shows avx+512+f+intrin, avx+512+pf+intrin, and avx+512+vl+intrin.
The manual of gcc 6.3.0 promises support for the whole instruction set by adding the compilation flag -march=skylake-avx512
— see manual instructions (page 354). For fine-grained control one might even want to enable/disable the switches for single instruction subsets following the manual instructions (page 363) again.
There is much discussion in Q&A sites on this error occurring when compiling other programs with earlier versions of gcc (5x). Identifying a single promising avenue is not easy, as is often the case with discussion boards.
I am also realizing that a similar issue had already been reported in this forum at Compilation of next with Chrono using gcc 6.3.0 Like there, setting the compilation optimization to 0 solves the issue, and any other level 1 though 3 causes it again; most probably because AVX means an advanced vector extension that fits optimization purposes.
Hands-on research (added)
- I have recompiled Chrono alone giving
-march=skylake-avx512
as value ofCMAKE_CXX_FLAGS
andCMAKE_C_FLAGS
. Running GPUSPH leads to a similar fail outcome - On top 1, I have also recompiled GPUSPH giving
-march=skylake-avx512
as value ofCXXFLAGS
. Similar fail outcome. - Doing the opposite of 1 and 2, I have recompiled both Chrono and GPUSPH disabling the offending instruction sets giving
-mno-avx512f -mno-avx512pf -mno-avx512vl
to the appropriate compilation variables. Similar fail outcome.