Building with GMX_BUILD_OWN_FFTW
I have problems with this in master:
% cmake -DGMX_BUILD_OWN_FFTW=ON .. -- The GROMACS-managed build of FFTW 3 will configure with the following optimizations: --enable-sse2;--enable-avx;--enable-avx2;--enable-avx512 However, my compiler gcc8.2 does not know about avx2 or the flags are incorrect: Making all in avx-128-fma Making all in avx2 libtool: compile: /home/apps/gcc/8.2.0/bin/gcc -DHAVE_CONFIG_H -I. -I/home/spoel/GG/testmaster/gromacs/build/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild/dft/simd/avx2 -I../../.. -I /home/spoel/GG/testmaster/gromacs/build/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild -march=core-avx2 -mfma -O3 -fomit-frame-pointer -mtune=native -malign-double -fstrict-aliasing -fno-schedule-insns -MT n2fv_2.lo -MD -MP -MF .deps/n2fv_2.Tpo -c /home/spoel/GG/testmaster/gromacs/build/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild/dft/simd/avx2/n2fv_2.c -fPIC -DPIC -o n2fv_2.o /tmp/ccMAAski.s: Assembler messages: /tmp/ccMAAski.s:26: Error: no such instruction: `shlx %rbx,24(%rbp),%r10'
#2 Updated by Mark Abraham 6 months ago
- Affected version - extra info set to 2020 master
- Affected version changed from git master to 2018.2
What distro was this? A user reported the same symptoms on a CentOS derivative last year: https://mailman-1.sys.kth.se/pipermail/gromacs.org_gmx-users/2018-June/120974.html. Clearly there are installations of gcc that emit assembly for which a compatible assembler must exist - we disable AVX compilation of FFTW on Mac for exactly this reason. The symptoms are consistent with the assembler on the machine not understanding (enough of) newer instructions. (The shlx assembly instruction was only introduced in the Haswell era, for example.)
Suggest either upgrade binutils package (containing the assembler), use the fftw3 dev package provided by the distro, or install fftw3 yourself. On CentOS derivatives, using one of the dev-toolsetn packages is a good idea.
In theory, our build-own-fftw feature should check that AVX compilation works before enabling flags. But it's not easy to know what the fftw build system will want. We have had a hack that turns it off on Mac, but I don't know a good way to turn it off in other cases.