How to install GROMACS in Windows without Cygwin

 

This document briefly introduces how to intsall the GROMACS in Windows without Cygwin or Linux environemnt in Windows: "Native" environment.

(I am not sure that Cygwin or Linux environment in Windows can use the Windows' CUDA environment or GPU driver. If CUDA environment is working properly in the Cygwin or Linux environment in Windows, you can just follow up the "Quick and Dirty Installation" described in GROMACS hompage)

 

Prerequisite


To install the GROMACS in Windows system, you need this programs:

1. Visual Studio 2008 or higher version

You can use the "express version" for installation of GROMACS. However, GROMACS 2016 or higher version, one need Visual studio 2017 or above version. Check the details about prerequisites in the GROMACS hompage: http://www.gromacs.org

Important note: if you want to use GPU computation with CUDA environment, you should install appropriate Visual Studio Community or higher version. (One should install the Visual C++ environment. Check the detials about the CUDA environment in NVidia homepage)

 

2. Cmake

You can get easily via https://cmake.org

 

3. FFTW library or Intel MKL Library

You can get from http://www.fftw.org

Please follow steps described in FFTW homepage.

Note: If you have Intel MKL Library, you can skip this step.

 

Optional:

1. CUDA for NVidia GPU

You can get through https://developer.nvidia.com/cuda-downloads

2. Any QM program, if you want to compute QM/MM simulation

From now on, GROMACS supports Gaussian, Mopac, Gamess, and Orca

3. MPI Environment

If you want to compute the simulation with MPI, you should install this program, such as MS MPI or Intel MPI.

 

Procedure


1. Download the GROMACS source code and unzip somewhere.

2. Run CMake GUI

3. Set the source code directory in "Where is the source code"

If you unzip the GROMACS in C:\Users\Username\Documents\Gromacs, set this directory.

4. Set a different location to put the built GROMACS in "Where to build the binaries"

For example, you can make a directory named "build", and you can set this location.

5. Click Configure. It will take serveral minutes.

To ask the select the generator, find the generator you have installed. If you want to configure 64bit GROMACS, you should select the 64-bit compiler. (Most of cases, it automatically selects default compiler)

6. Configure will stop because it cannot find FFTW. Don't be panic: just click the "Advanced" check box

 

** If you want to use fftw library, follow this procedure.

6-1. Find out FFTWF_INCLUDE_DIR and FFTWF_LIBRARY option.

6-2. Select FFTW_INCLUDE_DIR as the directory that contains the fftw library file

6-3. Select FFTWF_LIBRARY as "libfftw3f-3.lib".

 

** If you want to use mkl library, follow this procedure.

6-1. Find the GMX_FFT_LIBRARY, and select mkl

6-2. Click the configure. Then it will stop

6-3. You can find out the MKL_INCLUDE_DIR and MKL_LIBRARIES. Set the MKL_INCLUDE_DIR as the mkl include directory. In my case, it is C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2016.3.207/windows/mkl/include/

6-4. Set the MKL_LIBRARIES. In my case, for the 32bit system, C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2016.3.207/windows/mkl/lib/ia32_win/mkl_rt.lib, for the 64bit system, C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2016.3.207/windows/mkl/lib/intel64_win/mkl_rt.lib

 

****** This is optional part

7-1. If you want to configure the QM/MM feature, find the GMX_QMMM_PROGRAM and select the QM program you want.

 

7-2. If you want to use GPU computation, find the GMX_GPU and check the box.

Note: In some cases, the CMake program cannot detect the installed NVidia GPU. For this case, please follow this step:

(Maybe this issue is needed to be fix by GROMACS developer)

7-2-1. Find the 'nvidia-smi' program in your computer.

Usually, it will be C:\Program Files\NVIDIA Corporation\NVSMI

7-2-2. Using the control pannel, add the above location in PATH variable.

7-2-3. Open the file gromacs-(version)\cmake\gmxDetectGpu.cmake

7-2-4. In line 92, change exec_progam(${_nvidia_smi_path} AGRS -L as exec_program(nvidia-smi ARGS -L

7-2-5. Run the configure again.

 

7-3. If you want to enable the MPI, find the GMX_MPI and check the box. (You need to install MS MPI or other software)

*****************************

 

8. Click Configure button.

9. After finishing configure, click Generate button.

10. Open the visual studio, and find the ALLBUILD project in the main build directory.

11. Build the project. It will take several minutes. (Note: The default build option in the visual studio is debug. If you want to make release build (for another computer) Build-configuration manager-Active solution configuration as Release)

12. After build the project, you may need to move the some files in the proper location. I set the default location as C:\Gromacs\

13. Make the directory bin, and copy the gmx.exe to the C:\Gromacs\bin

14. Make the directory share, and make the directory gromacs in share directory, i.e. C:\Gromacs\share\gromacs\

15. Copy the all contents in the share directory in the unzipped directory. i.e., template, top, etc.

16. Make the *.bat file, which contains this contents

@echo off
set PATH=C:\Gromacs\bin;%PATH%
set GMXDATA=C:\Gromacs\share\gromacs
CALL cmd

 

17. Enjoy!