range-based ‘for’ loops are not allowed in C++98 mode

Dear all,

I am currently trying to install lammps. In order to do so I used a cmake command which worked properly followed
by a make command in the build directory where I get this specific error

This is documented behavior. Please see: https://lammps.sandia.gov/doc/Build_extras.html#user-colvars
You either have to enable C++11 support in your compiler (e.g. with -std=c++11 for gcc 4.8.x), use a newer, directly c++11 compatible compiler, or compile USER-COLVARS without the Lepton library.

Axel.

Hi Benedikt, can you post which version of CMake you are using, and on what version of LAMMPS?

If you are using LAMMPS up to 3Mar2020, compilation of Lepton should have been automatically disabled when you are not building LAMMPS with C++11. In the development versions after 3Mar2020, C++11 and a more recent CMake are now enforced for all of LAMMPS. Either way, it looks like a bug that you got to that point of the build in the first place.

With any recent version of LAMMPS, you can always use -D COLVARS_LEPTON=no if you are not using the particular “customFunction” feature:
You can also modify the original Lepton code, if you wish. Just submit a pull request here:
https://github.com/openmm/openmm

Giacomo