Gromacs cmake error w/ GPU enabled

GROMACS version:
GROMACS modification: Yes/No

-Building gromacs on windows using vs cmd prompt cmake.
-Using the following gromacs source because I was running into a known error on windows that this had fixed:

-cmake options are:
cmake -G"NMake Makefiles" -S. -B./build -DGMX_FFT_LIBRARIES=fftw3 -DGMX_GPU=CUDA -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=off -DFFTWF_INCLUDE_DIR=“C:/fftw-3.3.5-dll64” -DFFTWF_LIBRARY=“C:/fftw-3.3.5-dll64/libfftw3f-3.lib” -DCUDA_TOOLKIT_ROOT_DIR=“C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA”

-Tried with and without -DGMX_CUDA_TARGET_SM=90 neither working

-Running a 6GB NVIDIA RTX 3050 Laptop GPU with CUDA v12.4

I am receiving the following error

[ 32%] Building NVCC (Device) object src/gromacs/CMakeFiles/libgromacs.dir/domdec/libgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj
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-cuda/build/src/gromacs/CMakeFiles/libgromacs.dir/domdec/./libgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj

NMAKE : fatal error U1077: ‘echo >nul && “C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe” -D verbose:BOOL= -D build_configuration:STRING=Release -D generated_file:STRING=C:/gromacs-2024-cuda/build/src/gromacs/CMakeFiles/libgromacs.dir/domdec/./libgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj -D generated_cubin_file:STRING=C:/gromacs-2024-cuda/build/src/gromacs/CMakeFiles/libgromacs.dir/domdec/./libgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj.cubin.txt -P C:/gromacs-2024-cuda/build/src/gromacs/CMakeFiles/libgromacs.dir/domdec/libgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj.Release.cmake’ : return code ‘0x1’
Stop.
NMAKE : fatal error U1077: ‘“C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\nmake.exe” -s -f src\gromacs\CMakeFiles\libgromacs.dir\build.make /nologo -SL src\gromacs\CMakeFiles\libgromacs.dir\depend’ : return code ‘0x2’
Stop.
NMAKE : fatal error U1077: ‘“C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\nmake.exe” -s -f CMakeFiles\Makefile2 /nologo -S all’ : return code ‘0x2’
Stop.

Thanks in advance for any help!

i think the issue is with the c++ , you may need to direct it or use different.

Hi!

Have you tried the solution form this post?

You can also try building/running GROMACS via WSL. We try to support MSVC, but none of the core developers use Windows, so it is

For RTX 3050, you should use 86, not 90.

Tried the solution posted there, also changed the targets to 86 as directed, got this error:

gpuhaloexchange_impl_gpu.cpp
C:/gromacs-2024-cuda/src/gromacs/utility/include\gromacs/utility/fixedcapacityvector.h(85): error: expected a comma (the one-argument version of static_assert is not enabled in this mode)
static_assert(std::is_default_constructible_v);
^

C:/gromacs-2024-cuda/src/gromacs/utility/include\gromacs/utility/fatalerror.h(77): error: name followed by “::” must be a class or namespace name
void gmx_init_debug(int dbglevel, const std::filesystem::path& dbgfile);
^

C:/gromacs-2024-cuda/src/gromacs/utility/include\gromacs/utility/fatalerror.h(88): error: name followed by “::” must be a class or namespace name
const std::filesystem::path& file,
^

C:/gromacs-2024-cuda/src/gromacs/utility/include\gromacs/utility/fatalerror.h(155): error: name followed by “::” must be a class or namespace name
const std::filesystem::path& file,
^

C:/gromacs-2024-cuda/src/gromacs/utility/include\gromacs/utility/fatalerror.h(186): error: name followed by “::” must be a class or namespace name
gmx_fatal(int fatal_errno, const std::filesystem::path& file, int line, const char* fmt, …)
^

C:/gromacs-2024-cuda/src/gromacs/utility/include\gromacs/utility/fatalerror.h(196): error: name followed by “::” must be a class or namespace name
const std::filesystem::path& file,
^

C:/gromacs-2024-cuda/src/gromacs/utility/include\gromacs/utility/fatalerror.h(237): error: name followed by “::” must be a class or namespace name
const std::filesystem::path& file,
^

C:/gromacs-2024-cuda/api/legacy/include\gromacs/utility/listoflists.h(130): error: expected a comma (the one-argument version of static_assert is not enabled in this mode)
static_assert(std::is_default_constructible_v);
^

C:/gromacs-2024-cuda/src/gromacs/timing/include\gromacs/timing/wallcycle.h(239): error: expression must have a constant value
static_assert(checkStringsLengths<22>(wallCycleCounterNames));
^
C:/gromacs-2024-cuda/src/gromacs/timing/include\gromacs/timing/wallcycle.h(173): note #2703-D: cannot call non-constexpr function “std::_Narrow_char_traits<_Elem, _Int_type>::length [with _Elem=char, _Int_type=int]” (declared at line 385 of C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\include\xstring)
if (std::char_traits::length(str) > maxLength)
^

C:/gromacs-2024-cuda/src/gromacs/timing/include\gromacs/timing/wallcycle.h(239): error: expected a comma (the one-argument version of static_assert is not enabled in this mode)
static_assert(checkStringsLengths<22>(wallCycleCounterNames));
^

C:/gromacs-2024-cuda/src/gromacs/timing/include\gromacs/timing/wallcycle.h(292): error: expression must have a constant value
static_assert(checkStringsLengths<22>(wallCycleSubCounterNames));
^
C:/gromacs-2024-cuda/src/gromacs/timing/include\gromacs/timing/wallcycle.h(173): note #2703-D: cannot call non-constexpr function “std::_Narrow_char_traits<_Elem, _Int_type>::length [with _Elem=char, _Int_type=int]” (declared at line 385 of C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\include\xstring)
if (std::char_traits::length(str) > maxLength)
^

C:/gromacs-2024-cuda/src/gromacs/timing/include\gromacs/timing/wallcycle.h(292): error: expected a comma (the one-argument version of static_assert is not enabled in this mode)
static_assert(checkStringsLengths<22>(wallCycleSubCounterNames));
^

12 errors detected in the compilation of “C:/gromacs-2024-cuda/src/gromacs/domdec/gpuhaloexchange_impl_gpu.cpp”.
gpuhaloexchange_impl_gpu.cpp
CMake Error at libgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj.Release.cmake:280 (message):
Error generating file
C:/gromacs-2024-cuda/build/src/gromacs/CMakeFiles/libgromacs.dir/domdec/./libgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj

NMAKE : fatal error U1077: ‘echo >nul && “C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe” -D verbose:BOOL= -D build_configuration:STRING=Release -D generated_file:STRING=C:/gromacs-2024-cuda/build/src/gromacs/CMakeFiles/libgromacs.dir/domdec/./libgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj -D generated_cubin_file:STRING=C:/gromacs-2024-cuda/build/src/gromacs/CMakeFiles/libgromacs.dir/domdec/./libgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj.cubin.txt -P C:/gromacs-2024-cuda/build/src/gromacs/CMakeFiles/libgromacs.dir/domdec/libgromacs_generated_gpuhaloexchange_impl_gpu.cpp.obj.Release.cmake’ : return code ‘0x1’
Stop.
NMAKE : fatal error U1077: ‘“C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\nmake.exe” -s -f src\gromacs\CMakeFiles\libgromacs.dir\build.make /nologo -SL src\gromacs\CMakeFiles\libgromacs.dir\depend’ : return code ‘0x2’
Stop.
NMAKE : fatal error U1077: ‘“C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\nmake.exe” -s -f CMakeFiles\Makefile2 /nologo -S all’ : return code ‘0x2’
Stop.