Cmake fails with 2020.4 under conda

GROMACS version: 2020.4
GROMACS modification: No

I’m trying to build gromacs 2020.4 on ancient Centos (7.9) install at an HPC center. Since the system cmake and compilers are too old, I figured I’d use conda’s compilers. However, the build is failing at the cmake stage, with the following error:

cmake ~/gromacs-2020.4

(a bunch of output, only warnings are some CMake deprecation warnings)

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
    linked by target "libgromacs" in directory /home/uroch/gromacs-2020.4/src/gromacs

-- Generating done

It is finding the CUDA libraries (/usr/loca/cuda-11.1, pointed to by CUDA_HOME), and I tried adding the location of the CUDA fft library (/usr/local/cuda-11.1/targets/x86_64-linux/lib/) to LD_LIBRARY_PATH.

If I try the bold/stupid idea of simply ignoring the error message and trying to build anyway, it fails with a million errors in the stl libraries of all things. I can’t upload the whole make output here because I’m a new user, but here’s a snippet:

[ 27%] Building NVCC (Device) object src/gromacs/CMakeFiles/libgromacs.dir/domdec/
/home/uroch/anaconda3/envs/gromacs/x86_64-conda-linux-gnu/include/c++/9.3.0/bits/stl_pair.h(442): error: argument list for class template “std::pair” is missing

/home/uroch/anaconda3/envs/gromacs/x86_64-conda-linux-gnu/include/c++/9.3.0/bits/stl_pair.h(442): error: expected a “)”

/home/uroch/anaconda3/envs/gromacs/x86_64-conda-linux-gnu/include/c++/9.3.0/bits/stl_pair.h(442): error: template parameter “_T1” may not be redeclared in this scope

/home/uroch/anaconda3/envs/gromacs/x86_64-conda-linux-gnu/include/c++/9.3.0/bits/stl_pair.h(442): error: expected a “;”

/home/uroch/anaconda3/envs/gromacs/x86_64-conda-linux-gnu/include/c++/9.3.0/bits/basic_string.h(5989): error: argument list for class template “std::__cxx11::basic_string” is missing

/home/uroch/anaconda3/envs/gromacs/x86_64-conda-linux-gnu/include/c++/9.3.0/bits/basic_string.h(5989): error: expected a “)”

/home/uroch/anaconda3/envs/gromacs/x86_64-conda-linux-gnu/include/c++/9.3.0/bits/basic_string.h(5989): error: template parameter “_InputIterator” may not be redeclared in this scope

/home/uroch/anaconda3/envs/gromacs/x86_64-conda-linux-gnu/include/c++/9.3.0/bits/basic_string.h(5990): error: expected a “;”

Anyway, I can’t escape the dreaded feeling I’m doing something stupid, or that someone else must have already solved this problem, but I’m stuck, so I’m asking for help. Any ideas?

Hi Alan, is Singularity or Docker installed on that cluster? That’s not a hard requirement, but may be still the easiest way to deal with the C++14 requirement on “ancient” operating systems (still actively supported, though).

If you are going through Anaconda, you are probably not going to run Gromacs with MPI over multiple nodes anyway, right? :-)


Hi Giacomo,

I’m sure I could install docker – it’s a system I’m borrowing for benchmarking purposes, so they gave me root access. However, is there an existing image I should use? If not, can you suggest specs I should use to assemble it?

Still, I’m very surprised that conda fails so hard – my experience with gromacs, while fairly limited, always said that it wasn’t particularly finicky to build, and using conda gives very recent versions of the compilers (I actually tried switching from g++ to clang, but that failed too).

To answer your other question, I’m just benchmarking GPU performance. This is a big box with 12 GPUs in it, and I wanted to make sure I could run 12 separate jobs without choking the machine. OpenMM and Amber both succeeded with our systems – performance was essentially unchanged – but since for gromacs we’re usually doing coarse-grained, which has a somewhat different task mix, I wanted to make sure before I make the purchase.



Hi Alan, in that case if you have root you may want to install a more recent GCC using YUM: I was able to build Gromacs 2020 with that (didn’t try CUDA, but I don’t see why that would be a problem).

That approach is simpler than using a container, but you can also use a container with any recent Linux OS that you would like. You really only need to work around the fact that Gromacs doesn’t support GCC 4.8 (the compiler in CentOS 7) any more, but nothing more complicated than that.

I’ll give it a shot and let you know what happens. Thanks!

This suggestion appears to have worked. I had to manually set the CC and CXX variables to get cmake to find those compilers, I had to let gromacs build fftw for itself, and it only worked with CUDA 10.2 (not 11), but in the end it did build.

Thanks so much for the pointer – it’s not something I would have found on my own!