Compiling LAMMPS-7Dec2015 with OpenMPI and GNU

From what I know for LAMMPS-7Dec2015, you should be able to e FFTW3. The current version at this point in writing is FFTW-3.3.4 (

Step 1: Compiling FFTW-3.3.4

# tar -zxvf fftw-3.3.4.tar.gz
# cd fftw-3.3.4
# ./configure --prefix=/usr/local/fftw-3.3.4 CC=mpicc F77=mpif90
# make -j 16
# make install

Step 1a. Compile OpenMPI and GNU (Not covered here)

Step 2: Untar LAMMPS

# tar -zxvf lammps-stable.tar.gz

Step 3: Prepare libraries for lammps

3a. lib/reax

# make -f Makefile.gfortran

3b. lib/meam

# make -f Makefile.gfortran

3c. lib/poems

# make -f Makefile.g++

Step 4: Compile required the packages. Go to src directory

# cd src

4a. Check which packages are included

# make package-status
Installed YES: package ASPHERE
Installed YES: package BODY
Installed YES: package CLASS2
Installed YES: package COLLOID
Installed YES: package COMPRESS
Installed YES: package CORESHELL
Installed YES: package DIPOLE
Installed YES: package FLD
Installed  NO: package GPU
Installed YES: package GRANULAR
Installed  NO: package KIM
Installed YES: package KOKKOS
  src/pair_lj_sdk_kokkos.cpp does not exist
  src/pair_lj_sdk_kokkos.h does not exist
Installed YES: package KSPACE
Installed YES: package MANYBODY
Installed YES: package MC
Installed YES: package MEAM
Installed YES: package MISC
Installed YES: package MOLECULE
Installed YES: package MPIIO
Installed YES: package OPT
Installed YES: package PERI
Installed YES: package POEMS
Installed YES: package PYTHON
Installed YES: package QEQ
Installed YES: package REAX
Installed YES: package REPLICA
Installed YES: package RIGID
Installed YES: package SHOCK
Installed YES: package SNAP
Installed YES: package SRD
Installed  NO: package VORONOI
Installed YES: package XTC

4b. Choose all the standard

# make yes-standard

4c. Exclude packages that are not required

# make no-voronoi
# make no-kim
# make no-gpu

Step 5: Edit src/MAKE/Makefile.mpi

Around Line 43, 44
Leave MPI_PATH and MPI_LIB empty.


Around Line 53,54,55

FFT_INC =  -I/usr/local/fftw-3.3.3-single/include -DFFT_FFTW
FFT_PATH = -L/usr/local/fftw-3.3.3-single/lib
FFT_LIB = -lfftw

Step 6: Compile LAMMPS

Check make options. Go to src

# make
# make ompi_g++

Step 7: Create a /usr/local/lammps-7Dec15 and copy libraries. Go to lammps root directory

# cp -Rv bench /usr/local/lammps-7Dec15
# cp -Rv doc /usr/local/lammps-7Dec15
# cp -Rv examples /usr/local/lammps-7Dec15
# cp -Rv potentials /usr/local/lammps-7Dec15
# cp README /usr/local/lammps-7Dec15
# cp -Rv tools /usr/local/lammps-7Dec15
# cp -Rv lib /usr/local/lammps-7Dec15/lib
# cp lmp_ompi_g++ /usr/local/lammps-7Dec15/bin

7a. Create a softlinks

# lns -s /usr/local/lammps-7Dec15/bin/lmp_ompi_g++ lammps


  1. Quick install guide for LAMMPS on Linux cluster

3 thoughts on “Compiling LAMMPS-7Dec2015 with OpenMPI and GNU

  1. Pingback: Compiling LIGGGHTS with OpenMPI – Linux Cluster

  2. [ranjit@masternode src]$ make ompi_g++
    /bin/sh: python-config: command not found
    make[1]: Entering directory `/home/ranjit/lammps-7Dec15/src/Obj_ompi_g++’
    mpicxx -g -O3 -DLAMMPS_GZIP -I../../lib/reax -DLMP_PYTHON -I../../lib/poems -DLM P_MPIIO -I../../lib/meam -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -M ../ atom_vec_hybrid.cpp > atom_vec_hybrid.d
    /bin/sh: python-config: command not found
    mpicxx -g -O3 -DLAMMPS_GZIP -I../../lib/reax -DLMP_PYTHON -I../../lib/poems -DLM P_MPIIO -I../../lib/meam -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -M ../ lammps.cpp > lammps.d
    /bin/sh: python-config: command not found
    mpicxx -g -O3 -DLAMMPS_GZIP -I../../lib/reax -DLMP_PYTHON -I../../lib/poems -DLM P_MPIIO -I../../lib/meam -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -M ../ update.cpp > update.d
    /bin/sh: python-config: command not found
    mpicxx -g -O3 -DLAMMPS_GZIP -I../../lib/reax -DLMP_PYTHON -I../../lib/poems -DLM P_MPIIO -I../../lib/meam -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -M ../ modify.cpp > modify.d
    /bin/sh: python-config: command not found
    mpicxx -g -O3 -DLAMMPS_GZIP -I../../lib/reax -DLMP_PYTHON -I../../lib/poems -DLM P_MPIIO -I../../lib/meam -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -M ../ force.cpp > force.d
    /bin/sh: python-config: command not found
    mpicxx -g -O3 -DLAMMPS_GZIP -I../../lib/reax -DLMP_PYTHON -I../../lib/poems -DLM P_MPIIO -I../../lib/meam -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -M ../ atom.cpp > atom.d
    make[1]: Leaving directory `/home/ranjit/lammps-7Dec15/src/Obj_ompi_g++’
    make[1]: Entering directory `/home/ranjit/lammps-7Dec15/src/Obj_ompi_g++’
    make[1]: *** No rule to make target `../kokkos.h’, needed by `pair_lj_long_dipol e_long.o’. Stop.
    make[1]: Leaving directory `/home/ranjit/lammps-7Dec15/src/Obj_ompi_g++’
    make: *** [ompi_g++] Error 2

    can you please help me why i am getting these error.i configured open mpi and fftw
    and followed the above same procedure for lammps installation


  3. you change the .mpi file and then run lmp_ompi_g++. This has to be a type right? my build goes through but I can find the executable anywhere. Any idea on that? Thanks


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.