Make Generates Error

GROMACS version: 2022.2
GROMACS modification: Yes/No
Here post your question
Hey all,
I am trying to build gromacs 2022.2 with gpu support. gpu: geforce 3090 ti. cpu: amd ryzen 9 5900x.

The build process runs fine up until I try to run Make, and then I get this in the output:

[ 27%] Building NVCC (Device) object src/gromacs/CMakeFiles/libgromacs.dir/domdec/libgromacs_generated_gpuhaloexchange_impl.cu.o
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘…’:
435 | function(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘…’:
530 | operator=(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’
CMake Error at libgromacs_generated_gpuhaloexchange_impl.cu.o.Release.cmake:280 (message):
Error generating file
/home/ct/Downloads/gromacs-2022.2/build/src/gromacs/CMakeFiles/libgromacs.dir/domdec/./libgromacs_generated_gpuhaloexchange_impl.cu.o

make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/build.make:133: src/gromacs/CMakeFiles/libgromacs.dir/domdec/libgromacs_generated_gpuhaloexchange_impl.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4697: src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

Cmake step was: cmake … -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_GPU=CUDA

Can anyone offer any insight? Thanks in advance.

Hello,

you are using a compiler that doesn’t support C++17 to build GROMACS.
Please use something more modern.

Cheers

Paul

Hi, I’m having the same issue. I checked the compilers version but it is the newest for both compilers. gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0 and g++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0. I’ve compiled gromacs before but I’m in a new distro (Ubuntu 2022.4) so I’m wondering if it could be a problem. Thanks in advance.

(Here I copy the whole error)

/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
  435 |         function(_Functor&&__f)
      |                                                                                                                                                 ^ 
/usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
  530 |         operator=(_Functor&&__f)
      |                                                                                                                                                  ^ 
/usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
CMake Error at libgromacs_generated_gpuhaloexchange_impl.cu.o.Release.cmake:280 (message):
  Error generating file
  /home/luis/Downloads/gromacs-2021.6/build/src/gromacs/CMakeFiles/libgromacs.dir/domdec/./libgromacs_generated_gpuhaloexchange_impl.cu.o


make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/build.make:126: src/gromacs/CMakeFiles/libgromacs.dir/domdec/libgromacs_generated_gpuhaloexchange_impl.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4433: src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

Hello,

can you please post the contents of your CMakeCache.txt file, so we can
know how you set up the compilation?
At the same time, please post your cmake command line.

We are building GROMACS with g+±11 in our CI and haven’t seen issues
like this before.

Cheers

Paul

Thanks for the reply. I can’t load the file since I’m a new user but I’m pasting the corresponding section. One more thing, I was able to build gromacs but with the GPU flag OFF

My command was: cmake -DGMX_GPU=CUDA -DGMX_BUILD_OWN_FFTW=ON ../

Partial content of the Cache file:

//CXX compiler
CMAKE_CXX_COMPILER:STRING=/usr/bin/g++

//A wrapper around 'ar' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-11

//A wrapper around 'ranlib' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-11

//No help, variable specified on the command line.
CMAKE_CXX_EXTENSIONS:UNINITIALIZED=OFF

//Flags used by the CXX compiler during all build types.
CMAKE_CXX_FLAGS:STRING=

//C++ flags for address sanitizer
CMAKE_CXX_FLAGS_ASAN:STRING=-O1 -g -fsanitize=address -fno-omit-frame-pointer

//Flags used by the CXX compiler during DEBUG builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=-g

//Flags used by the CXX compiler during MINSIZEREL builds.
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG

//C++ flags for profile builds.
CMAKE_CXX_FLAGS_PROFILE:STRING= -O3 -DNDEBUG -pg

//C++ flags for regressiontests reference runs.
CMAKE_CXX_FLAGS_REFERENCE:STRING=-O0 -g

//Flags used by the CXX compiler during RELEASE builds.
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG

//C++ flags for release with assert builds.
CMAKE_CXX_FLAGS_RELWITHASSERT:STRING=' -O3 '

//Flags used by the CXX compiler during RELWITHDEBINFO builds.
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG

//C++ flags for thread sanitizer
CMAKE_CXX_FLAGS_TSAN:STRING=-O1 -g -fsanitize=thread -pie -fPIE

//C++ flags for undefined behavior sanitizer
CMAKE_CXX_FLAGS_UBSAN:STRING=-O1 -g -fsanitize=undefined -fno-omit-frame-pointer

//No help, variable specified on the command line.
CMAKE_CXX_STANDARD:UNINITIALIZED=17

//No help, variable specified on the command line.
CMAKE_CXX_STANDARD_REQUIRED:UNINITIALIZED=ON

//C compiler
CMAKE_C_COMPILER:STRING=/usr/bin/gcc

//A wrapper around 'ar' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-11

//A wrapper around 'ranlib' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-11

//Flags used by the C compiler during all build types.
CMAKE_C_FLAGS:STRING=

//C flags for address sanitizer
CMAKE_C_FLAGS_ASAN:STRING=-O1 -g -fsanitize=address -fno-omit-frame-pointer

//Flags used by the C compiler during DEBUG builds.
CMAKE_C_FLAGS_DEBUG:STRING=-g

//Flags used by the C compiler during MINSIZEREL builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG

//C flags for profile builds.
CMAKE_C_FLAGS_PROFILE:STRING= -O3 -DNDEBUG -pg

//C flags for regressiontests reference runs.
CMAKE_C_FLAGS_REFERENCE:STRING=-O0 -g

//Flags used by the C compiler during RELEASE builds.
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG

//C flags for release with assert builds.
CMAKE_C_FLAGS_RELWITHASSERT:STRING=' -O3 '

//Flags used by the C compiler during RELWITHDEBINFO builds.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG

//C flags for thread sanitizer
CMAKE_C_FLAGS_TSAN:STRING=-O1 -g -fsanitize=thread -pie -fPIE

//C flags for undefined behavior sanitizer
CMAKE_C_FLAGS_UBSAN:STRING=-O1 -g -fsanitize=undefined -fno-omit-frame-pointer

Many thanks

Can you change your cmake command line to explicitly set the compilers,
like this?

cmake -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g+±11
-DGMX_GPU=CUDA -DGMX_BUILD_OWN_FFTW=ON …|

There have been some issues recently with the CUDA build and implicit
compiler settings.

Cheers

Paul

Hi Paul, so I managed to solve the problem but not the way I wished. After trying yours and many other approaches, I decided to uninstall Ubuntu 22 and install version 20 and it worked smoothly. Not sure why the gcc compiler is not working properly on Ubuntu 2022 and I’ll be glad to hear if someone else experiences the same issue with this distro. For now my problem is solved. Thanks for your support.

Luis