GROMACS 4.6 has another procedure to be installed compared to the previous 4.5.X versions. Now it does not rely on the configure and libtool tools. All the configure procedure is done by CMake and there is no need of the libtool step, specially for the non-official tools installation.
2. Notes before installing
The installation requisites of GROMACS 4.6 has not changed much. The only additional requirement is the CMake tool. However it is pretty simple to be installed, specially on operational systems like Ubuntu. The CMake installation will not be covered here, for it can be found elsewhere.
The GROMACS installation is much simpler and some additional steps like the installation of the FFTW library now can be automatically done by GROMACS itself. So the user doesn't have to install the FFTW library by itself, GROMACS installation procedure can download and install it alone.
3. Installing GROMACS 4.6
The installation can be divided into four simple steps:
- Download and extract the gromacs-4.6.1.tar.gz from GROMACS website;
- Inside the extracted folder create a new folder (e.g. build);
- Inside this new folder configure the program using CMake;
- At the end compile and install the program using make.
Steps 1 and 2 are straight forward.
tar xfz gromacs-4.6.1.tar.gz
Step 3 has a lot of options discussed on the next section. But basically is done as follows:
where OPTIONS are discussed on the next section.
Step 4 is straight forward.
3.1. CMake options
The configuration process depends on many different CMake variables. I cannot describe all the possible options that GROMACS uses without being extensive. So, I will focus on the ones I use most and I believe are the most important for the end user.
For CMake options are defined using the -D flag, all the options I will show must be used preceded by the -D string.
3.1.1. Final Installation folder
GROMACS installation folder can be changed using the flag CMAKE_INSTALL_PREFIX. For example, to install GROMACS on the /opt folder one can use:
3.1.2. Compiler options
The C and C++ compiler can be changed using the flags CMAKE_C_COMPILER and CMAKE_CXX_COMPILER, respectively.
For intel compiler one can use:
For pgi compilers:
For gnu compilers:
3.1.3. Parallelism options
To install using the MPI version of GROMACS the flag GMX_MPI must be turned on. If not the standard shared version is installed instead. So to install using MPI just set the GMX_MPI to on, like -DGMX_MPI=ON
3.1.4. Floating point operation precision
As always GROMACS can be installed using the single and double precisions. I always suggest the use of the double precision calculation if you are using a fine grained force field, but coarse grained representation can be used using single precision. Basically in the single precision the calculation can be done faster, but the numerical precision is lower than the slower but higher precision double precision.
By default GROMACS is installed in single precision. To install in double precision mode, the flag GMX_DOUBLE must be turned on, as follows: -DGMX_DOUBLE=ON
3.1.5. Fast Fourier Transform Library
To use the FFTW library set the flag GMX_FFT_LIBRARY to fftw3 (-DGMX_FFT_LIBRARY=fftw3) and set the FFTW_LIBRARY flag to point to the libfftw3.a file and the FFTW_INCLUDE_DIR to point to the fftw3 include folder.
If you are installing the single precision version of GROMACS set the flag -DFFTWF_LIBRARY to point to the libfftw3f.a and -DFFTWF_INCLUDE_DIR to point to the fftw3 include folder..
If the FFTW 3 library was installed inside the /opt/fftw folder the variables are set to be:
Optionally one can install using the FFTPack library ported within GROMACS or the MKL.
3.1.6. Changing the program suffix
If you choose to install the MPI version of GROMACS, by default the compiled GROMACS programs names will have the _mpi suffix. If you choose to install the double precision version the program names will have the _d suffix. If you choose both the program suffix names will be _mpi_d.
GROMACS allows us to change the programs suffix with the flags GMX_DEFAULT_SUFFIX, GMX_BINARY_SUFFIX and GMX_LIBS_SUFFIX. In order to change the default programs suffix just turn off the flag GMX_DEFAULT_SUFFIX to off (-DGMX_DEFAULT_SUFFIX=OFF) and change the other ones to the program suffix you want (e.g. -DGMX_BINARY_SUFFIX="" -DGMX_LIBS_SUFFIX="" turns off program suffixes and -DGMX_BINARY_SUFFIX="_4.6" -DGMX_LIBS_SUFFIX="_4.6" to set the suffix to _4.6).
3.1.7. Static link option
GROMACS 4.6 also support the static libraries and static link. It makes the programs bigger, so if do not want a static compilation use the shared on. To turn the static link on turn off the variable SHARED_LIBS_DEFAULT (-DSHARED_LIBS_DEFAULT=OFF) or the BUILD_SHARED_LIBS (-DBUILD_SHARED_LIBS=no)
3.1.8. GPU support
To install GROMACS with support to GPU just install the NVIDIA tool kit. Do not forget to install the NVIDIA driver as well as the compiler. And install GROMACS using the options above. Note that GPU is only compiled in the single precision version of GROMACS.
For further reading about the differences in Cut-off schemes of GPU version read this
4. Running GROMACS
If you want to read about how to run GROMACS read this