Mountain Lions like OpenMPI

February 13, 2013

Following the previous post on installing Fortran compilers in OSX 10.8 (Mountain Lions like Fortran), the next step is to efficiently exploit all of those lovely i7 cores for computational chemistry.

1. OpenMPI
- Forget any version that comes with XCode as you need to compile OpenMPI against your new Fortran installation.
- Download the binary from http://www.open-mpi.org/ (current version 1.6.3).
- Unzip and enter directory.
- Run "./configure --prefix=/usr/local/openmpi-1.6.3 CC=gcc FC=ifort F77=ifort".
- Run "make".
- Run "sudo make install".
- Add to your .bashrc or .bash_profile:
export PATH=./:/usr/local/openmpi-1.6.3/bin:~/bin:/opt/intel/bin:$PATH
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/openmpi-1.6.3/lib

Result:
$ which mpif90
/usr/local/openmpi-1.6.3/bin/mpif90

2. FHI-AIMS
- A popular quantum chemistry package (from here; current version 081912).
- Update the Makefile to include:

FC = ifort
FFLAGS = -O3 -ip
F90FLAGS = $(FFLAGS)
ARCHITECTURE = Generic
LAPACKBLAS = -L/opt/intel/mkl/lib \
-I/opt/intel/mkl/include -lmkl_intel_lp64 \
-lmkl_sequential -lmkl_core
USE_MPI = yes
MPIFC = mpif90

- Run "make mpi".
- Enjoy parallel calculations, e.g. mpirun -np 4 fhi-aims

3. VASP
- A popular materials modelling package (from here; current version 5.3.3).
- In the main src folder, "cp makefile.linux_ifc_P4 Makefile".
- Update the Makefile to include:

FC=mpif90
FCL=$(FC)
FFLAGS = -FR -assume byterecl
OFLAG=-O3 -ip -ftz
MKL=/opt/intel/mkl
BLAS=-L/$(MKL)/lib -I/$(MKL)/include -lmkl_intel_lp64 \
-lmkl_sequential -lmkl_core -lmkl_lapack95_lp64

- Run "make".
- Enjoy parallel calculations, e.g. mpirun -np 4 vasp