'avx2 support error' when installing GROMACS 2022.3 inside a conda environment

GROMACS version: 2022.3

GROMACS modification: No

OS version: Ubuntu 16.04.7 LTS

CPU: Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz

GPU: NVIDIA GeForce RTX 2080 Ti

C/C++ Compiler: conda-forge gcc 10.4.0-16

Cuda: 11.1

I’m trying to install GROMACS 2022.3 within a conda environment in a self-contained manner, since I have no root privilege and may like to activate this environment from two hosts with different version of compilers and libraries.

The environment was built with the requirements below:


conda create --prefix /export/disk/<path_to>/gromacs2203/ python=3.8 cxx-compiler=1.5 cudatoolkit-dev=11.1 cmake openmpi -c conda-forge

Then I tried to cmake as instructed, with some necessary options specified to make sure all the dependencies it used were inside the conda environment:


cmake .. -DGMX_BUILD_OWN_FFTW=ON \

-DREGRESSIONTEST_DOWNLOAD=ON \

-DGMX_MPI=on \

-DGMX_GPU=CUDA \

-DCUDA_TOOLKIT_ROOT_DIR=/export/disk/<path_to>/gromacs2203/pkgs/cuda-toolkit \

-DCMAKE_INSTALL_PREFIX=/export/disk/<path_to>/gromacs2203/software/ \

-DGMX_SIMD=AVX2_256

Then I proceeded to make, which failed with this error message:

Making all in avx-128-fma
Making all in avx2
libtool: compile: /export/disk/<path_to>/gromacs2203/bin/x86_64-conda-linux-gnu-cc -DHAVE_CONFIG_H -I. -I/export/disk/<path_to>/gromacs2203/software/gromacs/build/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild/dft/simd/avx2 -I…/…/… -I /export/disk/<path_to>/gromacs2203/software/gromacs/build/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /export/disk/<path_to>/gromacs2203/include -march=core-avx2 -mfma -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /export/disk/<path_to>/gromacs2203/include -MT n1fv_2.lo -MD -MP -MF .deps/n1fv_2.Tpo -c /export/disk/<path_to>/gromacs2203/software/gromacs/build/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild/dft/simd/avx2/n1fv_2.c -fPIC -DPIC -o n1fv_2.o

In file included from /export/disk/<path_to>/gromacs2203/software/gromacs/build/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild/dft/simd/n1f.h:21,

from /export/disk/<path_to>/gromacs2203/software/gromacs/build/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild/dft/simd/avx2/…/common/n1fv_2.c:71,

from /export/disk/<path_to>/gromacs2203/software/gromacs/build/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild/dft/simd/avx2/n1fv_2.c:3:

/export/disk/<path_to>/gromacs2203/software/gromacs/build/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild/simd-support/simd-avx2.h:43:2: error: #error “compiling simd-avx2.h without avx2 support”

43 | #error “compiling simd-avx2.h without avx2 support”

| ^~~~~

Makefile:755: recipe for target ‘n1fv_2.lo’ failed

make[8]: *** [n1fv_2.lo] Error 1

Makefile:512: recipe for target ‘all’ failed

make[7]: *** [all] Error 2

Makefile:395: recipe for target ‘all-recursive’ failed

make[6]: *** [all-recursive] Error 1

Makefile:502: recipe for target ‘all-recursive’ failed

make[5]: *** [all-recursive] Error 1

Makefile:708: recipe for target ‘all-recursive’ failed

make[4]: *** [all-recursive] Error 1

Makefile:552: recipe for target ‘all’ failed

make[3]: *** [all] Error 2

src/external/build-fftw/CMakeFiles/fftwBuild.dir/build.make:85: recipe for target ‘src/external/build-fftw/fftwBuild-prefix/src/fftwBuild-stamp/fftwBuild-build’ failed

make[2]: *** [src/external/build-fftw/fftwBuild-prefix/src/fftwBuild-stamp/fftwBuild-build] Error 2

CMakeFiles/Makefile2:3538: recipe for target ‘src/external/build-fftw/CMakeFiles/fftwBuild.dir/all’ failed

make[1]: *** [src/external/build-fftw/CMakeFiles/fftwBuild.dir/all] Error 2

Makefile:165: recipe for target ‘all’ failed

make: *** [all] Error 2

This issue was mentioned before ( Installation of gromacs 2020.4 with avx2 support and Installing_Gromacs_on_Intel_i9-avx2_support_error_from_fftw32), where both of the users solved (or at least partially solved) the problem after deactivating conda. But since my main wish is to install GROMACS totally inside my conda environment, this solution seems to be inapplicable.

So my question is:

  • What is the exact reason for this error, and how is it related to using a conda environment?

  • Is there any possible solutions so that I could solve this problem still with my conda environment?

Personally, I suppose this is a general problem to any non-root users with outdated system compilers, so once we could work out a solution here, it may apply to any other hosts with a conda.

I would be grateful for any suggestions for this problem.

Thanks.