[lammps-users] Installation

Dear All,

I try to install LAMMPS ,and use make g++ after editing my makefile.g++ .
I was unable to get my executable generated with a list of error message .

A part of my Make file where I make the changes is here .Can you help me out .
I have attached my error file.Below is a part of my Make file used .

CC = /usr/bin/g++
LINK = /usr/bin/g++
SIZE = size

I am confused on the specific field the above FLAGS should specify.

Thank You

note.doc (42.5 KB)

Dear John,

If you are using Ubuntu, you can follow this installation step.

sudo apt-get install build-essential fftw-dev tcsh mpich2 gfortran

Then, extract your Lammps software:

tar xvzf lammps.tar.gz

Copy Makefile (I attached) to lammps/src/MAKE/Makefile.ubuntu (make sure you change the name of file to Makefile.ubuntu)

compile: Make sure you are sitting in lammps-24Jan10/src (not the MAKE directory!). You’ll need the STUBS library if you’re making a serial binary

# for parallel binaries
make ubuntu
# for serial, make STUBS, then LAMMPS
cd STUBS ; make ; cd ..
make ubuntu

Try an example to verify it works

# change to the examples/crack directory
cd ../examples/crack
# for serial or parallel builds
../../lmp_ubuntu < in.crack
# for parallel builds only
mpiexec -np 2 ../../lmp_ubuntu < in.crack

Best regard,

2010/12/10 John S <[email protected]…24…>

Makefile.ubuntu_parallel.txt (649 Bytes)

Makefile.ubuntu_serial.txt (2.25 KB)

The error is no mpi,h file. So you need to make
settings in the MPI section of the Makefile.g++.
The doc pages on building LAMMPS discuss this
the MPI settings in detail.


Dear All,

Thank you for your response.I am not using Ubuntu, it is RH Linux box, where I try to install Lammps .
By MPI settings , can you specify which you are referring to ,is it "Building LAMMPS as a library ".

Thank You

Dear Users,

I was able to compile and get my executable as lmp_serial.
The process was as :
cd src/STUBS
cd …
make serial
I used g++ as compiler in my Makefile.serial.

I am sorry to ask this , if someone can elaborate me on the compilation steps for the the parallel, where I need to make the changes in Makefile.linux.

Thank You

i just compiled it today on parallel.
i changed g++ to mpicxx in my Makefile, the school machine have mpi already, so mpicxx worked for me

Dear All,

Do you receive an error as below while installing lammps .I used make linux.
And made changes in my Makefile.linux as CC > mpiCC.

make[1]: Entering directory `/usr/local/lammps/lammps-7Dec10/src/Obj_linux’


fft3d.h(164): catastrophic error: could not open source file “fftw.h”

#include “fftw.h”


compilation aborted for fft3d.cpp (code 4)

make[1]: *** [fft3d.o] Error 4

make[1]: Leaving directory `/usr/local/lammps/lammps-7Dec10/src/Obj_linux’

make: *** [linux] Error 2

Can anybody point out what this is related to.
I thank all for the help.


Yes, use -DFFT_NONE

Yixin’s fix will work if you don’t (immediately) intend on using a kspace solver for long-range coulombic interactions.

If you do, you’ll need to properly link to your FFT library (i.e. edit the ‘FFT_PATH =’ line), since it looks like your compiler can’t find it. Do you happen to know where that is?

Dear All,

As Yixin said , it fixed my error and I got the executable.

At present I do not intend to use kspace for long range columbic interactions. I am not sure on how to link it to the FFT library ( I will see the documentation).I will appreciate if you would like to suggest on this.

I thank all for your help.


Hey John,
Section 2.2.4 deals specifically with FFT library linking. After reading that, I also realized that what I told you was wrong. You’ll only need to link to an FFT library for the PPPM kspace solver (but that one does happen to be fastest for most large systems).

The documentation is pretty straightforward from there, although you may need to lookup documentation for whichever FFT library you use to specficy FFT_PATH.

Good luck!