Compiling LAMMPS-15Jun20 with GNU 6 and OpenMPI 3

Prerequisites

openmpi-3.1.4
gnu-6.5
m4-1.4.18
gmp-6.1.0
mpfr-3.1.4
mpc-1.0.3
isl-0.18
gsl-2.1
lammps-15Jun20

Download the latest tar.gz from https://lammps.sandia.gov/

 

Step 1: Untar LAMMPS

% tar -zxvf lammps-stable.tar.gz

Step 2: Make Standard Packages

% make yes-standard
% make no-gpu
% make no-mscg

Step 3: Compile message libraries

% cd lammps-15Jun20/lib/message/cslib/src
% make lib_parallel zmq=no

Copy and rename the produced cslib/src/libcsmpi.a or libscnompi.a file to cslib/src/libmessage.a

% cp cslib/src/libcsmpi.a to cslib/src/libmessage.a

Copy either lammps-15Jun20/lib/message/Makefile.lammps.zmq or Makefile.lammps.nozmq to lib/message/Makefile.lammps

% cp Makefile.lammps.nozmq to Makefile.lammps

Step 4: Compile poems

% cd lammps-15Jun20/lib/poems
% make -f Makefile.g++

Step 5: Compile latte
Download LATTE code and unpack the tarball either in this /lib/latte directory

% git clone https://github.com/lanl/LATTE

Inside lammps-15Jun20/lib/latte/LATTE
Modify the makefile.CHOICES according to your system architecture and compilers

% cd lammps-15Jun20/lib/latte/LATTE
% cp makefile.CHOICES makefile.CHOICES.gfort
% make
% cd lammps-15Jun20/lib/latte
% ln -s ./LATTE/src includelink
% ln -s ./LATTE liblink
% ln -s ./LATTE/src/latte_c_bind.o filelink.o
% cp Makefile.lammps.gfortran Makefile.lammps

Step 6. Compile Voronoi

Download voro++-0.4.6.tar.gz from http://math.lbl.gov/voro++/download/
Untar the voro++-0.4.6.tar.gz inside lammps-15Jun20/lib/voronoi/

% tar -zxvf voro++-0.4.6.tar.gz
% cd lammps-15Jun20/lib/voronoi/voro++-0.4.6
% make

Step 7: Compile kim

Download kim from https://openkim.org/doc/usage/obtaining-models . The current version is  kim-api-2.1.3.txz

Download at /lammps-15Jun20/lib/kim

% cd /lammps-15Jun20/lib/kim
% tar Jxvf kim-api-2.1.3.txz
% cd kim-api-2.1.3
% mkdir build
% cd build
% cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/../../installed-kim-api-X.Y.Z
% make -j2
% cd /lammps-15Jun20/lib/kim//installed-kim-api-2.1.3/
% source ${PWD}/kim-api-X2.1.3/bin/kim-api-activate
% kim-api-collections-management install system EAM_ErcolessiAdams_1994_Al__MO_324507536345_002

Step 8: Finally Compile LAMMPS

% cd lammps-15Jun20/src
% make g++_openmpi -j 16

You should have binary called lmp_g++_openmpi
Do a softlink

ln -s lmp_g++_openmpi lammps

Compile LATTE package for LAMMPS using Intel Compilers

Step 1: Download LATTE Source Code from Project

Download or clone the LATTE source code from https://github.com/lanl/LATTE. If you download a zipfile or tarball, unpack the tarball either in this /lib/latte directory or somewhere else on your system.

Step 2: Modify makefile.CHOICES

Modify the makefile.CHOICES according to your system architecture and compilers. Check that the MAKELIB flag is ON in makefile.CHOICES and finally, build the code via the make command

#
# Compilation and link flags for LATTE
#

# Precision - double or single
PRECISION = DOUBLE
#PRECISION = SINGLE

# Make the latte library
# AR and RUNLIB executable default path to compile
# latte as a library (change accordingly)
MAKELIB = ON
AR = /usr/bin/ar cq
RANLIB = /usr/bin/ranlib

# Use PROGRESS and BML libraries
PROGRESS = OFF
PROGRESS_PATH= $(HOME)/qmd-progress/install/lib
BML_PATH= $(HOME)/bml/install/lib

# Use METIS library for graph partitioning
METIS = OFF
METIS_PATH= $(HOME)/metis/metis-5.1.0/install

# GPU available - OFF or ON
GPUOPT = OFF

# Using DBCSR library from cp2k? OFF or ON
DBCSR_OPT = OFF

# Parallelizing over k-points?
MPIOPT = OFF

#
# CPU Fortran options
#

#For GNU compiler:
#FC = mpif90
FC = gfortran
FCL = $(FC)
FFLAGS = -O3 -fopenmp -cpp
#FFLAGS =  -fast -Mpreprocess -mp
LINKFLAG = -fopenmp

#For intel compiler:
FC = ifort
FCL = $(FC)
FFLAGS =  -O3 -fpp -qopenmp
LINKFLAG = -qopenmp
LIB = -mkl=parallel

#GNU BLAS/LAPACK libraries:
#LIB = -L/usr/local/lapack-3.8.0 -llapack -L/usr/local/blas-3.8.0/lib -lblas

#Intel MKL BLAS/LAPACK libraries:
LIB = -Wl,--no-as-needed -L${MKLROOT}/lib/intel64 \
 -lmkl_lapack95_lp64 -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core \
 -lmkl_gnu_thread -lmkl_core -ldl -lpthread -lm

#Alternative flags for MKL:
#LIB += -mkl=parallel

#Other BLAS/LAPACK vendors:
#LIB = -framework Accelerate
#LIB = -L/usr/projects/hpcsoft/toss2/common/acml/5.3.1/gfortran64/lib -lacml

# Uncomment for coverage
#CVR = OFF
ifeq ($(CVR), ON)
        FFLAGS += -fprofile-arcs -ftest-coverage
        LINKFLAG += -fprofile-arcs -ftest-coverage
endif

ifeq ($(PROGRESS), ON)
        LIB += -L$(PROGRESS_PATH) -lprogress -L$(BML_PATH) -lbml_fortran -lbml
        FFLAGS += -I$(BML_PATH)/../include -I$(PROGRESS_PATH)/../include
endif

ifeq ($(GRAPH), ON)
        LIB += -L$(METIS_PATH)/lib -lmetis
        FFLAGS += -I$(METIS_PATH)/include
endif

#DBCSR_LIB = -L/home/cawkwell/cp2k/lib/cawkwell/popt -lcp2k_dbcsr_lib
#DBCSR_MOD = -I/home/cawkwell/cp2k/obj/cawkwell/popt

#
# GPU options
#

GPU_CUDA_LIB = -L/usr/local/cuda-9.1/lib64 -lcublas -lcudart
GPU_ARCH = sm_20
# make

You should see liblatte.a file.

 

LAMMPS Tools and Packmol with Intel Fortran

PACKMOL information can be obtained from http://www.ime.unicamp.br/~martinez/packmol/userguide.shtml#conv

Installing can be found at http://www.ime.unicamp.br/~martinez/packmol/userguide.shtml#comp

1. Compile Packmol with Intel Fortran

# tar -zxvf packmol.tar.gz
# cd packmol
# ./configure ifort
# make

2. LAMMPS Tools

# git clone https://github.com/jdevemy/lammps-tools.git
# cd lammps-tools
# python setup.py build
# sudo python setup.py install

3. Make sure the Python has the following libraries in create_conf (sys, os, logging, argparse, math random)

4. Make sure the Python (if you install lammps-tool)

# export PYTHONPATH=/home/user1/Downloads/lammps-tools-master/lib
# ./create_conf

Compiling LAMMPS-14May16 with Intel-15.0.6 and Intel-MPI-5.0.3

Step 1: Remember to initialise Intel Environment. In your .bashrc

source /usr/local/intel/impi/5.0.3.049/bin64/mpivars.sh intel64
source /usr/local/intel/composerxe/bin/compilervars.sh intel64
source /usr/local/intel/mkl/bin/mklvars.sh intel64

Step 2: Untar LAMMPS

# tar -zxvf lammps-stable.tar.gz

Step 3: Prepare selected libraries for lammps

3a. lib/reax

# make -f Makefile.gfortran

3b. lib/meam

# make -f Makefile.ifort

3c. lib/poems

# make -f Makefile.icc

3d. lib/colvars

# 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
# make no-kokkos

Step 5: Install User-Contributed Intel Optimised Package (user-intel) and User-Contributed OpenMP Packages (user-omp)

# make yes-user-intel
# make yes-user-omp

Step 6: Compile LAMMPS

Check make options. Go to src

# make intel_cpu_intelmpi -j 16

Step 6a:

If in the midst of compilation you land yourself in this error ld: unable to to locate -lompstub. This is due to Intel 2015 using depreciating ompstub to ompistub5. Just go to the Intel Directory

# cd /usr/local/intel_2015/composerxe/lib/intel64
# ln -s  libiompstubs5.so libompstub.so

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

# cp -Rv bench /usr/local/lammps-14May16
# cp -Rv doc /usr/local/lammps-14May16
# cp -Rv examples /usr/local/lammps-14May16
# cp -Rv potentials /usr/local/lammps-14May16
# cp README /usr/local/lammps-14May16
# cp -Rv tools /usr/local/lammps-14May16
# cp -Rv lib /usr/local/lammps-14May16
# cp src/lmp_intel_cpu_intelmpi /usr/local/lammps-14May16/bin

7a. Create a softlinks

# ln -s /usr/local/lammps-7Dec15/bin/lmp_intel_cpu_intelmpi lammps

References:

  1. Quick install guide for LAMMPS on Linux cluster
  2. LAMMPS Optimized for Intel on Quad Socket Xeon

 

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 (http://www.fftw.org/download.html)

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.

MPI_PATH =
MPI_LIB =

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

References:

  1. Quick install guide for LAMMPS on Linux cluster