GROMACS version: 2024.4
GROMACS modification: No
Greetings, I have been trying to compile GROMACs on windows 10 again, now with CUDA support instead. With the following configuration:
cmake …
-DGMX_GPU=CUDA
-DCUDA_TOOLKIT_ROOT_DIR=“C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6”
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=ON
-G"NMake Makefiles"
-DFFTWF_INCLUDE_DIR=C:/fftw-3.3.10/FFTW/include
-DFFTWF_LIBRARY=C:/fftw-3.3.10/FFTW/lib/fftw3f.lib
-DGMX_FFT_LIBRARY=fftw3
-DGMX_CUDA_TARGET_COMPUTE=61
-DCUDA_HOST_COMPILER=“C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe” -DGMX_BUILD_OWN_FFTW=OFF
-DCMAKE_C_COMPILER=cl
-DCMAKE_CXX_COMPILER=cl
This results in nmake failure
nvcc fatal : Unknown option ‘-std:c++17’
CMake Error at libgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj.Release.cmake:220 (message):
Error generating
C:/gromacs-2024.4/buildGTX/src/gromacs/CMakeFiles/libgromacs.dir/domdec/./libgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj
I can identify the cause of error to be the flags -std:c++17, which nvcc compiler used in CUDA cannot recognize in libgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj and many more files generated during cmake. The proper flag should instead be --std=c++17. And if I try to manually correct it in ibgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj, the error stops, but only for that file. However, since there are many files along the lines with this misplaced, flags, It becomes infeasible to find and correct all the misplaced flags.
I have also identified to generator of the flag to be MSVC-CXX.cmake in Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC-CXX.cmake, which places -std:c++17 flag during CMake configuration.
Would anyone have solution for this or suggestion for more suitable compiler?