Difference between revisions of "How to compile Gromacs"

From Computational Biophysics and Materials Science Group
Jump to: navigation, search
Line 1: Line 1:
==Gromacs 5.0.4 MPI (double)==
+
==Gromacs 5.0.4 MPI, single, GPU==
 
Download source code to /share/apps/download
 
Download source code to /share/apps/download
  
See the Installation_Instructions
+
Read the Installation_Instructions
 +
 
 +
<code>
 +
tar -zxvf ../gromacs-5.0.4.tar.gz <br/>
 +
cd gromacs-5.0.4 <br/>
 +
mkdir build-gmx <br/>
 +
cd build-gmx <br/>
 +
export MPICCDIR=/share/apps/openmpi/bin/ <br/>
 +
<br/>
 +
cmake ..  \ <br/>
 +
-DGMX_DOUBLE=OFF \ <br/>
 +
-DCMAKE_INSTALL_PREFIX=/share/apps/gmx-single-MPI-CUDA \ <br/>
 +
-DGMX_GPU=ON \ <br/>
 +
-DCUDA_TOOLKIT_ROOT_DIR=/share/apps/cuda/ \ <br/>
 +
-DGMX_MPI=ON \ <br/>
 +
-DCMAKE_CXX_COMPILER=${MPICCDIR}mpicxx \ <br/>
 +
-DCMAKE_C_COMPILER=${MPICCDIR}mpicc \ <br/>
 +
-DGMX_BUILD_OWN_FFTW=ON <br/>
 +
make -j 8 <br/>
 +
make install <br/>
 +
</code> <br/>
 +
 
 +
Points to note:
 +
* As we only have fftw3 library compiled with double precision so we have to add -DGMX_BUILD_OWN_FFTW=ON
 +
 
 +
==Gromacs 5.0.4 MPI, double==
 +
Download source code to /share/apps/download
 +
 
 +
Read the Installation_Instructions
  
 
<code>
 
<code>
Line 25: Line 53:
 
</code> <br/>
 
</code> <br/>
  
==Gromacs 5.0.4 CUDA (single)==
+
==Gromacs 5.0.4 CUDA, single==
 
Download source code to /share/apps/download
 
Download source code to /share/apps/download
  
See the Installation_Instructions
+
Read the Installation_Instructions
  
 
<code>
 
<code>
Line 47: Line 75:
 
</code> <br/>
 
</code> <br/>
  
==Gromacs 5.0.4 multicore (double)==
+
Points to note:
 +
* As we only have fftw3 library compiled with double precision so we have to add -DGMX_BUILD_OWN_FFTW=ON
 +
* As MPI was not enabled, this build runs only on single machine. It is about to be replaced by MPI-enabled GPU-enabled build.
 +
 
 +
==Gromacs 5.0.4 thread-MPI, double==
 
Download source code to /share/apps/download
 
Download source code to /share/apps/download
  
See the Installation_Instructions
+
Read the Installation_Instructions
  
 
<code>
 
<code>
Line 66: Line 98:
 
make install <br/>
 
make install <br/>
 
</code> <br/>
 
</code> <br/>
 +
 +
Points to note:
 +
* This is the safest build and only runs on a single machine but multiple cores.
  
 
==Gromacs MPI Compilation==
 
==Gromacs MPI Compilation==
 
Download gromacs-4.5.5.tar.gz into /usr/local/src/gromacs
 
Download gromacs-4.5.5.tar.gz into /usr/local/src/gromacs
  
See the Installation_Instructions
+
Read the Installation_Instructions
  
 
1. Load Environment Modules:
 
1. Load Environment Modules:

Revision as of 14:15, 14 January 2015

Gromacs 5.0.4 MPI, single, GPU

Download source code to /share/apps/download

Read the Installation_Instructions

tar -zxvf ../gromacs-5.0.4.tar.gz
cd gromacs-5.0.4
mkdir build-gmx
cd build-gmx
export MPICCDIR=/share/apps/openmpi/bin/

cmake .. \
-DGMX_DOUBLE=OFF \
-DCMAKE_INSTALL_PREFIX=/share/apps/gmx-single-MPI-CUDA \
-DGMX_GPU=ON \
-DCUDA_TOOLKIT_ROOT_DIR=/share/apps/cuda/ \
-DGMX_MPI=ON \
-DCMAKE_CXX_COMPILER=${MPICCDIR}mpicxx \
-DCMAKE_C_COMPILER=${MPICCDIR}mpicc \
-DGMX_BUILD_OWN_FFTW=ON
make -j 8
make install

Points to note:
* As we only have fftw3 library compiled with double precision so we have to add -DGMX_BUILD_OWN_FFTW=ON

Gromacs 5.0.4 MPI, double

Download source code to /share/apps/download

Read the Installation_Instructions

tar -zxvf ../gromacs-5.0.4.tar.gz
cd gromacs-5.0.4
mkdir build-gmx
cd build-gmx
export MPICCDIR=/share/apps/openmpi/bin

CMAKE_PREFIX_PATH=/share/apps/fftw3 \
cmake .. \
-DGMX_DOUBLE=ON \
-DCMAKE_INSTALL_PREFIX=/share/apps/gmx-double-MPI
-DGMX_X11=OFF \
-DCMAKE_CXX_COMPILER=${MPICCDIR}/mpicxx \
-DCMAKE_C_COMPILER=${MPICCDIR}/mpicc \
-DGMX_MPI=ON \
-DGMX_PREFER_STATIC_LIBS=ON

make -j 8
make install

Gromacs 5.0.4 CUDA, single

Download source code to /share/apps/download

Read the Installation_Instructions

tar -zxvf ../gromacs-5.0.4.tar.gz
cd gromacs-5.0.4
mkdir build-gmx-cuda
cd build-gmx-cuda

cmake .. \
-DGMX_DOUBLE=OFF \
-DCMAKE_INSTALL_PREFIX=/share/apps/gmx-single-CUDA \
-DGMX_GPU=ON \
-DCUDA_TOOLKIT_ROOT_DIR=/share/apps/cuda \
-DGMX_BUILD_OWN_FFTW=ON

make -j 8
make install

Points to note:
* As we only have fftw3 library compiled with double precision so we have to add -DGMX_BUILD_OWN_FFTW=ON
* As MPI was not enabled, this build runs only on single machine. It is about to be replaced by MPI-enabled GPU-enabled build. 

Gromacs 5.0.4 thread-MPI, double

Download source code to /share/apps/download

Read the Installation_Instructions

tar -zxvf ../gromacs-5.0.4.tar.gz
cd gromacs-5.0.4
mkdir build-gmx
cd build-gmx

CMAKE_PREFIX_PATH=/share/apps/fftw3 \
cmake .. \
-DGMX_DOUBLE=ON \
-DCMAKE_INSTALL_PREFIX=/share/apps/gmx-double-multicore

make -j 8
make install

Points to note:
* This is the safest build and only runs on a single machine but multiple cores.

Gromacs MPI Compilation

Download gromacs-4.5.5.tar.gz into /usr/local/src/gromacs

Read the Installation_Instructions

1. Load Environment Modules:

module add intel/compiler/64/11.1/075
module add mvapich/intel/64/1.1
module add fftw3/intel/64/3.2.2

2. Set environment variables

export CCDIR=/cm/shared/apps/intel/Compiler/11.1/075/bin/intel64
export FFTW_LOCATION=/cm/shared/apps/fftw/intel/64/3.2.2
export MPICCDIR=/cm/shared/apps/mvapich/intel/64/1.1/bin
export CXX=mpicxx
export CC=mpicc

3. Setup the build environment

cd /usr/local/src/gromacs/
tar -zxvf ../gromacs-4.5.5.tar.gz
mv gromacs-4.5.5 gromacs-4.5.5-serial
mkdir build-serial
cd build-serial

4. Make the servial version

cmake ../gromacs-4.5.5-mpi \
-DFFTW3F_INCLUDE_DIR=$FFTW_LOCATION/include \
-DFFTW3F_LIBRARIES=$FFTW_LOCATION/lib/libfftw3f.a \
-DCMAKE_INSTALL_PREFIX=/cm/shared/apps/gromacs \
-DGMX_X11=OFF \
-DCMAKE_CXX_COMPILER=${MPICCDIR}/mpicxx \
-DCMAKE_C_COMPILER=${MPICCDIR}/mpicc \
-DGMX_MPI=ON \
-DGMX_PREFER_STATIC_LIBS=ON

make
make install-mdrun (WORKS & Installed)