LAMMPS packages not getting installed when built

Dear All,

I apologise if this problem seems trivial and is more Ubuntu specific than LAMMPS, I’m still getting used to Linux and have used LAMMPS only on Windows before. I did install the packages separately in the src/ directory using
make yes-all
after running cmake and generating a Makefile. If I install the packages before running cmake it shows:
Found package(s) installed by the make-based build system

Please run

make -C /home/pundarikaksha/Downloads/lammps-7Aug19/src no-all purge

to uninstall

Running the above command uninstalls all the packages I just installed. (I already removed the previously build files and binary in order to rebuild).
Some context. I had already built a lammps binary before without the packages. It was later I realized I needed to do so separately. Looking at the forums, I learnt that I needed to rebuild after installing the packages.

So after I install the packages just after this, I build the binary in the build directory using
make install
However, this just builds the binary without referencing the installed packages. How should I actually go about including the packages in the binary.

I apologize if I’ve made a very trivial error, this platform is still very new to me. Thanks in advance for your help.


I use make to compile LAMMPS and this is how I do it.

  1. Download LAMMPS and unpack it to my chosen directory

  2. cd into the src directory

  3. make clean-all # to make sure the src directory is free of object files (which it should be if you just downloaded LAMMPS)

  4. make no-all # to uninstall all packages

  5. make yes-class2 yes-compress yes-gpu yes-kspace yes-manybody yes-mc yes-molecule yes-qeq yes-rigid yes-user-intel yes-user-misc yes-user-reaxc # These are the packages I usually install

  6. make mpi # make MPI LAMMPS, if you just want the serial version then do “make serial”

I included the make clean-all and make no-all because I frequently recompile LAMMPS and removing and uninstalling things helps with debugging later. It’s also needed if you have to compile packages prior to installation like the GPU package.

Hope this helps,

LAMMPS has two ways of being configured and compiled. 1) the traditional way with makefiles and having to manually edit them and 2) using the cmake configuration tool. You are mixing the two, but they are not compatible and thus that cannot work.

Option 1) is usually best suited for people with experience in compiling LAMMPS and knowledge of how to edit makefiles for their specific purposes and platform. Option 2) is usually best suited for people with limited experience in such matters. To build a LAMMPS executable with a large part of the commonly used functionality included, you can use steps like the following:

cd path/to/lammps
mkdir build
cd build
cmake -C …/cmake/presets/most.cmake …/cmake
cmake --build .
make install

after which you should have a LAMMPS executable “lmp” with a lot of the optional functionality included installed in $HOME/.local/bin, which should be in your PATH environment, if you are using a fairly modern linux machine. We are constantly improving the cmake options to be as automatic, portable and error free (assuming a correct installation of the optional support packages and libraries) as possible. With the latest LAMMPS release (19 March 2020), this should have seen a significant improvement after we moved the minimum required cmake version to 3.10.