Unable to compile LAMMPS with PLUMED using CMake

370 views
Skip to first unread message

Benedek Goldmann

unread,
Jun 4, 2024, 11:11:12 AM6/4/24
to PLUMED users
Dear Community,

I am trying to compile the LAMMPS MD package with PLUMED using CMake, based on these articles:

Below, I provide an outline of my issue, with the attached file containing complete inputs and outputs.

I am using the latest stable version of LAMMPS (2Aug2023). I am able to compile this fine by itself, but not with PLUMED. The CMake command I use when trying to compile with PLUMED is "cmake -D PKG_PLUMED=yes -D DOWNLOAD_PLUMED=yes ../cmake". This command runs fine, returning the output in the attached file.

Then, when I run "cmake --build .", I get to "[100%] Linking CXX executable lmp", where I get a number of error messages. Specifically, these errors claim undefined references to a number of mpi-related objects (ompi_mpi_cxx_op_intercept, MPI::Comm::Comm(), MPI::Datatype::Free(), MPI::Win::Free()) in the plumed_build-prefix/lib/libplumed.a(kernel.o) file. See attached file for the complete message.

I spent a considerable time searching through various forums to try to overcome this error, but I could not find a case quite like mine. I would be very grateful for any advice.

Best wishes,
Ben Goldmann
University of Edinburgh


output.txt

Jonathan Cappola

unread,
Jun 25, 2024, 2:36:59 PM6/25/24
to PLUMED users
Hi Ben,

I just ran into this same issue yesterday compiling LAMMPS 2Aug2023 automatically with PLUMED v2.8.2, likely similar to what you are looking at. I ended up needing to have PLUMED compile with the "shared" option and manually place/link the shared library files (libplumed.so and libplumedKernel.so) from <lammpsdir>/build/plumed_build-prefix/lib to my usr/lib. It is either that or link the library files directly from the build directories to your library path.

Hope this helps,

Jonathan Cappola
Arizona State University

Andrey Poletayev

unread,
Jul 9, 2024, 8:13:56 AM7/9/24
to PLUMED users
Hi Ben, 
If you're doing this for archer2 or another UK HPC, let me know as I likely have build scripts. 
On (UK) HPCs, I would recommend module loading PLUMED and then using -D PKG_PLUMED=yes -D PLUMED_MODE=runtime so it just finds the loaded module.
-Andrey

Reply all
Reply to author
Forward
0 new messages