Compiling Gromacs has never been easier using the cmake. There are a few assumptions.
- Use MKL and Intel Compilers
- Use OpenMPI as the MPI-of-choice. The necessary PATH and LD_LIBRARY_PATH have been placed in .bashrc
- We will use SINGLE precision for speed used MDRUN and MPI Flags
Here is my configuration file using Intel Compilers
# tar xfz gromacs-5.0.4.tar.gz
# cd gromacs-5.0.4
# mkdir build
# cd build
# /usr/local/cmake-3.1.3/bin/cmake
-DGMX_BUILD_OWN_FFTW=ON \
-DREGRESSIONTEST_DOWNLOAD=OFF \
-DCMAKE_INSTALL_PREFIX=/usr/local/gromacs-5.0.4 \
-DGMX_MPI=on \
-DGMX_FFT_LIBRARY=mkl \
-DMKL_LIBRARIES="/usr/local/intel/mkl/lib/intel64" \
-DMKL_INCLUDE_DIR="/usr/local/intel/mkl/include" \
-DGMX_DOUBLE=on \
-DGMX_BUILD_MDRUN_ONLY=off \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_CXX_COMPILER=mpicxx
# make
# make check
# sudo make install
# source /usr/local/gromacs/bin/GMXRC
Installation Flags
– -DCMAKE_C_COMPILER=xxx equal to the name of the C99 compiler you
wish to use (or the environment variable CC)
– -DCMAKE_CXX_COMPILER=xxx equal to the name of the C++98 compiler you
wish to use (or the environment variable CXX)
– -DGMX_MPI=on to build using an MPI wrapper compiler
– -DGMX_GPU=on to build using nvcc to run with an NVIDIA GPU
– -DGMX_SIMD=xxx to specify the level of SIMD support of the node on
which mdrun will run
– -DGMX_BUILD_MDRUN_ONLY=on to build only the mdrun binary, e.g. for
compute cluster back-end nodes
– -DGMX_DOUBLE=on to run GROMACS in double precision (slower, and not
normally useful)
– -DCMAKE_PREFIX_PATH=xxx to add a non-standard location for CMake to
search for libraries
– -DCMAKE_INSTALL_PREFIX=xxx to install GROMACS to a non-standard
location (default /usr/local/gromacs)
– -DBUILD_SHARED_LIBS=off to turn off the building of shared libraries
– -DGMX_FFT_LIBRARY=xxx to select whether to use fftw, mkl or fftpack
libraries for FFT support
– -DCMAKE_BUILD_TYPE=Debug to build GROMACS in debug mode
Wrong procedure. In order to make it work one must specify set of mkl libraries and mkl include directory.
LikeLike