Help with loading .dcd trajectories

I am attempting to optimize md frames with LAMMPS and am having difficulty loading the previously dumped .dcd files:

I am getting Exception: ERROR on proc 0: No suitable molfile plugin found (src/MOLFILE/reader_molfile.cpp:85) when trying to load a .dcd trajectory “read_dump {traj_file} {frame_idx} x y z box yes format molfile dcd”

I copy-pasted the two plugin files from VMD-2.0.0 (molfile_plugin.h & vmdplugin.h) to
/opt/lammps/lib/molfile/

Before compiling with cmake:
cmake -S cmake -B build -D PKG_MOLFILE=yes -D PKG_GPU=yes -D PKG_KOKKOS=yes -D PKG_OPENMP=yes -D PKG_OPT=yes -D PKG_MOLECULE=yes -D PKG_INTERLAYER=yes -D PKG_DIPOLE=yes -D PKG_REPLICA=yes -D PKG_FEP=yes -D PKG_COLVARS=yes -D PKG_MC=yes -D PKG_PLUGIN=yes -D PKG_YAFF=yes -D PKG_EXTRA-DUMP=yes -D PKG_KSPACE=yes -D CMAKE_CXX_FLAGS=“-O1” -D PKG_RIGID=yes -D PKG_PYTHON=yes -D BUILD_SHARED_LIBS=ON
cmake --build build -j 8

But I still have the same issue.
Have I compiled LAMMPS incorrectly?

Can anyone help with this?

If it helps I am running the March 2026 patch of LAMMPS on Ubuntu 24.04.4 LTS.
The .py script and system/dcd files are tarred here https://drive.google.com/file/d/1aeOxA9J1C2lUCjN1GxPeDBx0gJmhmvDb/view?usp=sharing (I am new so I am not yet allowed to attach files directly.)

No.

I can try.

These are not plugin files, but the header files that define the binary interface for the specific VMD molfile plugin distribution that you are using.
You also need the actual plugin, in this case /path/to/vmd/plugins/LINUXAMD64/molfile/dcdplugin.so
Best you copy it to the working directory with the DCD file(s).

With that you should see something like:

Dump reader uses molfile plugin: CHARMM,NAMD,XPLOR DCD Trajectory v1.18 by Axel Kohlmeyer, Justin Gullingsrud, John Stone
Scanning dump file ...
dcdplugin) detected standard 32-bit DCD file of native endianness
dcdplugin) CHARMM format DCD file (also NAMD 2.1 and later)
Reading snapshot from dump file ...
  orthogonal box = (-36.150002 -36.150002 -36.150002) to (36.150002 36.150002 36.150002)
  32000 atoms before read
  32000 atoms in snapshot
  0 atoms purged
  32000 atoms replaced
  0 atoms trimmed
  0 atoms added
  32000 atoms after read

At least that is what I just saw with a custom test (your posted folder has no sharing access, so I could not download it).

Thank you! Copy-pasting the plugin to the working directory seems to have do the trick.

Does there exist a more elegant solution? Something akin to compiling LAMMPS with this plugin?
I have many MD runs to minimize and even programmatically copy-pasting the .so plugin for each run feels a little wrong.

Thanks in advance,
-ZP

Just look at the documentation: read_dump command — LAMMPS documentation
You can specify the path to where the molfile plugins are located.

The very nature of a plugin is that you do not link to it but load it at runtime. Plugin files have been specifically linked so they can be loaded at runtime.