Hello, LAMMPS!

Posted on March 4, 2019

Large-scale Atomic/Molecular Massively Parallel Simulator (LAMMPS) is a molecular dynamics program from Sandia National Laboratories.

1 Installation on Ubuntu

1.1 Install Dependency

Install relative dependency on you Linux operating system.

sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install gfortran
sudo apt-get install make

Download and extract fftw-3.3.8.tar.gz and mpich-3.2.tar.gz.

Install FFTW3:

cd %fftw3%   # the directoty you extract to
sudo ./configure --prefix=/usr/local --enable-float 
sudo make -j4
sudo make install

Install MPICH:

cd %mpich%   # the directoty you extract to
sudo ./configure --prefix=/usr/local
sudo make -j4
sudo make install

1.2 Install LAMMPS

Download and extract lammps-stable.tar.gz.

Comment this line in %lammps%/src/MAKE/Makefile.mpi (Add ‘#’):

LMP_INC = -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64

Then install LAMMPS with commands:

cd %lammps%/src   # the directoty you extract to
sudo make mpi -j4

1.3 Run LAMMPS

Run LAMMPS with following lines:

cd %lammps%/examples/shear/
/usr/local/bin/mpirun -np 4 /home/%username%/%lammps%/src/lmp_mpi < in.shear  

LAMMPS Trial


2 Installation on Windows

2.1 Enable .Net Framework 2.0

For Windows 7, Windows 8, Windows 10:

Control Pannel > Turn Windows features on or off.

Enable .Net Framework

Then .Net Framework 2.0 will be automatically installed.

For Windows Server 2003, Windows XP:

Download and install Service Pack 2 for .NET Framework 2.0 manually.

2.2 Install LAMMPS

Download LAMMPS here.

Download LAMMPS

Click on 64-bit Windows download area, where you can find all versions of LAMMPS for 64-bit Windows.

Download and install LAMMPS-64bit-XXXXX-MPI.exe for multi-threaded parallel calculation.

Download LAMMPS

2.3 Install MPICH2

For multi-threaded parallel calculation, you will need MPICH2. You can also download MPICH2 here.

Download MPICH2

Double click on mpich2-1.4.1p1-win-x86-64.msi to install.

After that, run wmpiregister.exe in %MPICH2%/bin. Enter your Windows user account and password, then click “Register”.

Register MPICH2

2.4 Run LAMMPS

Make sure environment variable has following items:

  • %MPICH2%\bin

  • %LAMMPS%\bin

Windows Environment Variable

Run Command Prompt as Administrator.

Change directoty to some folder as workspace.

Run LAMMPS with following lines:

mpiexec -localonly 4 lmp_mpi -in hello_world.in