Plumed Instalation Error

Dear All,

When I try to install Plumed2.2.3.0 with Lammps23-Jun-2022, the following Error massage was shown:

I do appreciate your help so I can solve this issue.

My procesure after installing Plumed is:
In lammps home dir: ./plumed patch-p (select lammps)
In src: make yes-USER-PLUMED
Then: make mpi

Gathering installed package information (may take a little while)
make[1]: Entering directory ‘/home/leo/Downloads/lammps-23Jun2022/src’
Gathering git version information
make[1]: Leaving directory ‘/home/leo/Downloads/lammps-23Jun2022/src’
Compiling LAMMPS for machine mpi
make[1]: Entering directory ‘/home/leo/Downloads/lammps-23Jun2022/src/Obj_mpi’
make[1]: Leaving directory ‘/home/leo/Downloads/lammps-23Jun2022/src/Obj_mpi’
make[1]: Entering directory ‘/home/leo/Downloads/lammps-23Jun2022/src/Obj_mpi’
mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I…/…/lib/plumed/includelink -DLMP_OPENMP -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c …/main.cpp
mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I…/…/lib/plumed/includelink -DLMP_OPENMP -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c …/fix_plumed.cpp
…/fix_plumed.cpp: In constructor ‘LAMMPS_NS::FixPlumed::FixPlumed(LAMMPS_NS::LAMMPS*, int, char**)’:
…/fix_plumed.cpp:137:3: error: ‘virial_flag’ was not declared in this scope
137 | virial_flag=1;
| ^~~~~~~~~~~
…/fix_plumed.cpp: In member function ‘virtual int LAMMPS_NS::FixPlumed::setmask()’:
…/fix_plumed.cpp:161:11: error: ‘THERMO_ENERGY’ was not declared in this scope
161 | mask |= THERMO_ENERGY;
| ^~~~~~~~~~~~~
make[1]: *** [Makefile:114: fix_plumed.o] Error 1
make[1]: Leaving directory ‘/home/leo/Downloads/lammps-23Jun2022/src/Obj_mpi’
make: *** [Makefile:393: mpi] Error 2

Dear All,

I have tried it with an older version of Lammps and it was compiled.

Did you make an update of the file before compiling with the newer version?

You need to use the make pu command (package update) after changing included packages.

Edit: The package update trick did help me out when changing included package. But I also failed to mention that the Plumed package requires specific instructions as detailed here. Which is your setup regarding these? Are you using the latest version of Plumed?

Dear Germain,

This time I used Plumed 2.4.8 with Lammps 31Mar17 (Previously I was using Plumed 2.2.3.0 and Lammps 23Jun2022). I just copied the plumed new executive file in another (older) varsion of Lammps’s home dir and after doing ./configure, I compiled Lammps in src directory. But I did not do (make pu). I will try again with your suggestion and the provided link. Thanks a lot for this.

You are trying to install a very old version of Plumed with a much newer version of LAMMPS.
The patching method of adding Plumed to a code is very fragile, since it breaks with internal changes of the MD software you are trying to patch. There have been quite a few of these internal changes in LAMMPS, so it is not a surprise.

That said, the Plumed developers have since contributed a package to LAMMPS so that Plumed is now a “first class citizen” of the LAMMPS software and requires no more patching, but you have to follow the installation instructions for the PLUMED package in the LAMMPS documentation.

In general, we don’t recommend using old versions of well maintained software. There are more recent versions of LAMMPS and they support more recent versions of Plumed (last tested version is Plumed 2.8.2) and in both of them are plenty of bugs fixed that were present in older versions and lots of exciting new features.

Dear Axel,

Thanks for this. The issues were solved by using the newer versions of both.