[lammps-users] Plugin package

Hi,

I have compiled LAMMPS (version 29 Sep 2021) with enabled plugin package:

– <<< Build configuration >>>

Operating System: Linux CentOS Linux 8

Build type: RelWithDebInfo

Install path: /opt/lammps/lammps-20210929-cuda

Generator: Unix Makefiles using /bin/gmake

– Enabled packages: BODY;DIPOLE;GPU;KSPACE;MANYBODY;MISC;ML-IAP;ML-SNAP;MOLECULE;PLUGIN;PYTHON

and want to load the deepmd-kit package as a plugin. However trying to do so with “plugin load xxx.so” command fails, regardless if xxx.so is in LD_LIBRARY_PATH or given absolutely.

The error message is:

“ERROR: Unknown command: plugin load”

lmp –h gives me:

Installed packages:

BODY DIPOLE GPU KSPACE MANYBODY MISC MLIAP MOLECULE PYTHON SNAP

Is PLUGIN missing here (and if yes, why)? The plugin.cpp was compiled and I have got no error during compilation.

Regards,

Holger

Did you enable BUILD_SHARED_LIBS when configuring LAMMPS?

Please check the CMake output for corresponding warnings.

I just made a check and the error message you are reporting is incomplete and not possible to get unless you are using an executable that has been compiled whithout the PLUGIN package at all. If BUILD_SHARED_LIBS is missing there would be a warning instead: WARNING: Ignoring plugin command. LAMMPS must be built as a shared library for it to work. (src/PLUGIN/plugin.cpp:80)

So, the only way how you can get the lmp -h output and the error message you get would be that you may have compiled the proper version of LAMMPS, but when running it, you are not using that executable, but a different one that was compiled without the PLUGIN package. Possibly a version that is in the PATH somewhere but you didn’t update the PATH or didn’t install the newly compiled version there.

Ok, you are completely right. I have overlooked to set the path correctly regarding the version: 20201029 → 20210929. Sorry for the confusion.

Best regards,

Holger