Compiling lammps

Hello all,

I am using supercomputing facility. I tried to install lammps. The lammps folder appeared but lmp_mpi did not come in src folder. What could be the reason?

Th Software details are as follows

Software Infrastructure

Operating System

Sankalp runs Scientific Linux 5.5 operating system.

Compilers Available

GNU: C (gcc), C++ (g++), F77 (g77), F90 (gfortran)

Intel : C/C++ (icc), F77/F90 (ifort), both with version 11.1

Parallel Environment

The following MPI versions are available in the system.

  1. OpenMPI , compiled for both GNU compiler and Intel compiler
  2. Mvapich , compiled for both GNU compiler and Intel compiler
  3. Mvapich2 , compiled for both GNU compiler and Intel compiler

Compilation and Execution of Sequential Programs

Depending on the programming language, one can compile a sequential program as follows:

g77/ifort –o program program.f

gfortran/ifort –o program program.f90

gcc/icc –o program program.c

g++/icc –o program program.cpp

The compiled program can be executed on the frontend node as follows:


Compiling parallel programs

Since there are several compilers (gcc, icc, g77, gfortran, ifort) and several APIs (openmpi, mvapich, mvapich2) available, there are different compilation shell scripts to cater to each combination. In general all these shell scripts have a similar syntax like

$ /MPIPATH/bin/mpif77 -o program program.f

$ /MPIPATH/bin/mpif90 -o program program.f90

$ /MPIPATH/bin/mpicc -o program program.c

$ /MPIPATH/bin/mpiCC -o program program.cpp

One can find out exact path of MPI flavor, he or she wants to use, by listing ‘/usr/local/’ folder.

Settings required before executing Parallel Applications

Before submitting jobs on the cluster, one needs to create “ssh” public and private keys (No need to create again if created once). This is done as follows:

ssh-keygen -t rsa

Press enter for any questions asked.

cp .ssh/ .ssh/authorized_keys

Besides this, one should also set path for the current working directory in ‘.bashrc’ or ‘.cshrc’ file depending on the default shell set for their home area.

Please suggest…

did you try typing “make mpi” in the source directory after having compiler modules loaded ?


I tried make mpi in src folder, but error is coming. The screenshot is attached


how to set Environment variable QUIP_ROOT as shown on screenshot


​that is the wrong question. you should ask: how to not act as an ignorant,
impatient and unreasonable person​?

your should:

- read the LAMMPS manual *carefully*. there is a whole section about
compiling LAMMPS. read this and get local(!) help, if you don't understand

- compiling LAMMPS from source requires you understand basics of makefiles,
compilers and compiling. if you do not have this (as evidenced in your
posts), either learn this first, or get help from a competent person. the
mailing list cannot and will not teach you these skills.

- as explained in the section about installing optional packages, several
of them require additional steps. some of them are quite elaborate and
require compiling and installing additional software, adjusting settings
and compiling/configuring libraries bundled with LAMMPS. if you haven't
done this, start by trying to compile a version of LAMMPS with *no*
optional packages installed (make no-all; make mpi) and resolve any
compilation problems with that first. then install desired packages
one-by-one and follow the necessary instructions for additional steps as

- reconsider whether compiling LAMMPS on a machine with such an *extremely*
old linux distribution is worth the effort. scientific linux 5.x is based
on a software stack that is over 12 years old. its default compilers do not
fully comply and implement necessary C++ (and Fortran) standards. several
optional packages require fairly modern compilers (KOKKOS is currently the
most demanding due its advanced usage of modern C++ including the C++11
standard). the LAMMPS developers cannot guarantee that *anything* will
work, we do not test on such old machines and will not correct any problems
resulting from that.

​so, get local help and read the documentation and associated README files
and additional documentation *carefully*.​