compiling lammps with modified pair.cpp

Dear lammps-users

I was trying to compile lammps parallel version (lammps_stable_1feb14 release) with a modified pair_sw.cpp. Before compilation i copied modified pair_sw.cpp to src directory and replace the old one. I successfully compiled, and performed some test run also. After compilation i rechecked my modified source file (pair_sw.cpp) in src directory, it was replaced with old one which came with lammps bundle. I don’t know why it is happening ?.
Then i compiled a serial version , it was perfectly fine, the modified source code was not replaced by old one after compilation. Please comment over this issue.


  1. cp modified pair_sw.cpp to src file and replaced the old one
  2. compiled the lammps with following bash script

cd lib/atc
make -f Makefile.g++
cd …/awpmd
make -f Makefile.openmpi
cd …/colvars
make -f Makefile.g++
cd …/meam
make -f Makefile.gfortran
cd …/poems
make -f Makefile.g++
cd …/reax
make -f Makefile.gfortran
cd …/…/src
make yes-all no-kim no-gpu no-user-cuda g++



when you build LAMMPS with additional packages, every time you write "make yes-foo" files of this "foo" package are copied from the corresponding subfolder to src. As sw is part of the MANYBODY package, when you execute make yes-all pair_sw.cpp in src is replaced with (original) pair_sw.cpp from MANYBODY. If you don't want it to happen, overwrite pair_sw.cpp in MANYBODY subfolder of src, not in src itself.


28.05.2014, 12:55, "Anees P" <[email protected]>: