How to define my compiler in Makefile correctly ?

I am trying to build LAMMPS with USER_PLUMED using make in the src folder. However, while doing a make mpi I run into the following error :

mpicxx -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I../../lib/nnp/include -I../../lib/plumed/includelink -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -D__PLUMED_WRAPPER_CXX=1 -c ../min.cpp
In file included from ../pointers.h:24:0,
from ../min.h:17,
from ../min.cpp:22:
../lmptype.h:34:4: error: #error LAMMPS is planning to transition to C++11. To disable this error please use a C++11 compliant compiler, enable C++11 (or later) compliance, or define LAMMPS_CXX98 in your makefile
#error LAMMPS is planning to transition to C++11. To disable this error please us
^
Makefile:104: recipe for target 'min.o' failed
make[1]: *** [min.o] Error 1

However, my gcc version is 5.4.0 which is compliant with C++14 as well. What needs to be defined in the Makefile exactly? Is there any documentation for this ( specifically with make and not cmake)

I did the following before this:

https://lammps.sandia.gov/doc/Build_settings.html#cxx11

Hi Axel,
This documentation tells flags only for cmake. I need to specifically use make for my build process because i am patching another custom package as well.

No, it doesn’t.

make -D CMAKE_CXX_FLAGS="-O3 -g -fopenmp -DNDEBUG -std=c++11" mpi
doesn’t work. Please tell me where am I going wrong?

This is for cmake not make. There is a whole section in the manual explaining how to build with make and how to adjust makefiles. Don’t expect a copy and paste solution. You need to do some reading and possibly additional reading up, if you don’t know how makefiles work in general.

Axel