GROMACS version: 2025.0
GROMACS modification: No
I’m trying to build GROMACS with CUDA support on Windows, using MSVC toolchain.
I have revert CMake version to 3.30.5.
I’ve setup CUDA 12.4.1, and I have Visual Studio 2022.
(in fact I’am using GitHub Actions Windows Runner, see this for more detail about installed packages)
The cmake command is
cmake .. "-DCMAKE_INSTALL_PREFIX=C:/GROMACS2025" "-DCMAKE_PREFIX_PATH=C:/FFTW;C:/OpenBLAS" "-DGMX_SIMD=AVX2_256" "-DGMX_GPU=CUDA" "-DGMX_HWLOC=ON" -G "Visual Studio 17 2022" -A "x64"
cmake --build . --target INSTALL --config Release -- "-maxCpuCount" "-p:CL_MPCount=3"
And it gave the following error message:
D:\a\GROMACS-Windows\GROMACS-Windows\gromacs-2025.0\src\gromacs\mdlib\lincs_gpu.cpp(322): error C3028: 'gmx::LincsGpu::maxCoupledConstraints_': only a variable or static data member can be used in a data-sharing clause [D:\a\GROMACS-Windows\GROMACS-Windows-\gromacs-2025.0\build\src\gromacs\libgromacs.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 12.4.targets(799,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin\nvcc.exe" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64" -x cu -I (too many, ignored) -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include" --keep-dir libgromacs\x64\Release -use_fast_math -maxrregcount=0 --machine 64 --compile -cudart static -std=c++17 --generate-code=arch=compute_50,code=[compute_50,sm_50] --generate-code=arch=compute_52,code=[compute_52,sm_52] --generate-code=arch=compute_60,code=[compute_60,sm_60] --generate-code=arch=compute_61,code=[compute_61,sm_61] --generate-code=arch=compute_70,code=[compute_70,sm_70] --generate-code=arch=compute_75,code=[compute_75,sm_75] --generate-code=arch=compute_80,code=[compute_80,sm_80] --generate-code=arch=compute_86,code=[compute_86,sm_86] --generate-code=arch=compute_89,code=[compute_89,sm_89] --generate-code=arch=compute_90,code=[compute_90,sm_90] --generate-code=arch=compute_53,code=[compute_53,sm_53] --generate-code=arch=compute_90,code=[compute_90,sm_90] -Wno-deprecated-gpu-targets -Xptxas=-warn-double-usage -Xptxas=-Werror -diag-suppress=177 -Xcompiler="/EHsc -Ob2 -openmp /EHsc" -D_WINDOWS -DNDEBUG -DWIN32 -DHAVE_CONFIG_H -DTMPI_EXPORTS -DTMPI_USE_VISIBILITY -DGMX_DOUBLE=0 -DNOMINMAX -DUSE_STD_INTTYPES_H -DMUPARSER_STATIC -D"CMAKE_INTDIR=\"Release\"" -D_MBCS -DWIN32 -D_WINDOWS -DNDEBUG -DHAVE_CONFIG_H -DTMPI_EXPORTS -DTMPI_USE_VISIBILITY -DGMX_DOUBLE=0 -DNOMINMAX -DUSE_STD_INTTYPES_H -DMUPARSER_STATIC -D"CMAKE_INTDIR=\"Release\"" -Xcompiler "/EHsc /W1 /nologo /O2 /FS /MD " -Xcompiler "/FdD:\a\GROMACS-Windows\GROMACS-Windows\gromacs-2025.0\build\lib\Release\gromacs.pdb" -o libgromacs.dir\Release\lincs_gpu.obj "D:\a\GROMACS-Windows\GROMACS-Windows\gromacs-2025.0\src\gromacs\mdlib\lincs_gpu.cpp"" exited with code 2. [D:\a\GROMACS-Windows\GROMACS-Windows\gromacs-2025.0\build\src\gromacs\libgromacs.vcxproj]
This error C3028, according to Microsoft’s document, is an error when compiled with MSVC.
No this issue when compiling GROMACS 2024.3~2024.5.
I think these lines of code need fix.