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

Hi Luis,

I am experiencing the exact same thing. I’m running Ubuntu 22.04 on WSL2 in a system similar to yours, a geforce 3080ti and a Ryzen 9 5900x. Also ran the cmake command specifying the C and C++ compilers like Paul suggested, however, I got the exact same error during the build process. Were you able to install it in Ubuntu 22 at all?

I’ll try downgrading to 20.04 and see how it goes.

Pato

Hi, I was not able to compile with CUDA so downgrading to 20.04 was my way to go. You can try the solution provided by @akaupang but it did not do the trick. Hope you can solve it!

Hi everyone,

After trying a couple more times, I ended up downgrading to 20.04 and installing gcc-11 and g++-11 since the release comes with versions number 9 by default.

Also, in case someone else runs into this problem, be sure to install the 11.7 version of CUDA from the Nvidia website since the command

sudo apt-get install nvidia-cuda-toolkit

installs a previous version by default, which is not compatible with this version of gromacs.

Hope this helps!
Pato

Hi Pato and lfsalasg,

You’re quite right - the compilation that went through appears to have done so without GPU support! I deleted my post above not to cause any confusion!

Thanks for bringing up the cuda-toolkit-version, Pato!

I preferred to avoid a downgrade from Ubuntu 22.04, so following the discussion here, which appears to be related to our error messages (error: parameter packs not expanded with ‘...’), I upgraded to CUDA toolkit 11.7, following the instructions for the Ubuntu base installer here (deb based installation).

Beware, this also upgraded my Nvidia driver, so that I now have 515.65.01 and nvcc --version gives:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Jun__8_16:49:14_PDT_2022
Cuda compilation tools, release 11.7, V11.7.99
Build cuda_11.7.r11.7/compiler.31442593_0

Now,

cmake .. -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DGMX_GPU=CUDA -DREGRESSIONTEST_DOWNLOAD=ON
make -j 14
make -j 14 check

ran through fine with all ran tests passed (and this time with GPU support it would appear):

100% tests passed, 0 tests failed out of 88

Label Time Summary:
GTest              = 241.70 sec*proc (81 tests)
IntegrationTest    = 100.04 sec*proc (25 tests)
MpiTest            = 151.12 sec*proc (19 tests)
QuickGpuTest       =  27.66 sec*proc (17 tests)
SlowTest           = 132.20 sec*proc (13 tests)
UnitTest           =   9.46 sec*proc (43 tests)

Total Test time (real) = 427.09 sec
[100%] Built target run-ctest-nophys
[100%] Built target check

Run-time mapping and usage of the GPU seems to work too on my small system:

1 GPU selected for this run.
Mapping of GPU IDs to the 1 GPU task in the 1 rank on this node:
  PP:0
PP tasks will do (non-perturbed) short-ranged interactions on the GPU
PP task will update and constrain coordinates on the CPU
Using 1 MPI thread
Using 16 OpenMP threads 

Åsmund

I realized that my edit above may not have generated an update message, so I’m bumping this thread, in case the above findings are useful to anyone watching the thread.

Have a nice weekend!