Link error Gromacs on windows with CUDA

GROMACS version:2023.1
GROMACS modification: No
I tried to compile Gromacs 2023.1 on Win10 with Visual Studio 2022 Professional.
When I set cmake … -G “Visual Studio 17 2022” -A x64 -DCMAKE_INSTALL_PREFIX=C:\GMX\Gromacs -DGMX_BUILD_OWN_FFTW=OFF -DFFTWF_INCLUDE_DIR=“C:\GMX\fftw-install\include” -DFFTWF_LIBRARY=“C:\GMX\fftw-install\lib\fftw3f.lib” -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_GPU=CUDA -DGMX_FFT_LIBARARY=fftw3 showed multiple errors during compilation.
However, Link error occured. Concretely, build/lib/Release/gromacs.lib didnt exist.
Hope that someone could give me some solutions to solve this problem. Thank you!

Hello,
It’s a bit hard to debug without the full error message.
I really advise you against running Gromacs on windows though, it can be compiled for windows, but it was written for supercomputers - all of which run linux. You would have a much smoother experience installing it on Ubuntu or some other debian-based system.

1 Like

Hello
I appreciate you for your reply.
I got that the Linux is better to run gromacs, however, I want to use with Windows with some reasons.

By the way, the error was,
nvcc fatal : Unknown option ‘-std:c++17’
CMake Error at libgromacs_generated_nbnxm_cuda.cu.obj.Release.cmake:224 (message):
Error generating
C:/GMX/gromacs-2023.1/build/src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/cuda/Release/libgromacs_generated_nbnxm_cuda.cu.obj

I searched this error was caused from mismatch between CUDA and driver.
Thus, I installed NVIDIA driver 531.79 and nvcc version V12.1.105 against RTX 3090

However, the problem wasn’t fixed.

Please show me some idea.

Thank you.

Just change file gromacs-2023.1/cmake/gmxManageNvccConfig.cmake line 241 to:

list(APPEND GMX_CUDA_NVCC_FLAGS "${CMAKE_CUDA17_STANDARD_COMPILE_OPTION}")