"make omp" fails with <<unrecognized command line option ‘-restrict’>>

Hi,
I would like to use GPU acceleration with the OMP binary, lmp_omp. the commands I use are:

$ make yes-gpu
Installing package gpu
$ make yes-molecule
Installing package molecule
  updating package GPU
$ make yes-colloid
Installing package colloid
  updating package GPU

However, make omp fails with the following error:

 make omp -j8
Gathering installed package information (may take a little while)
make[1]: warning: -j8 forced in submake: resetting jobserver mode.
make[1]: Entering directory '/disk2/cactus/cactus-full/sources/lammps/29Oct2020/src'
make[1]: 'lmpinstalledpkgs.h' is up to date.
Gathering git version information
make[1]: Leaving directory '/disk2/cactus/cactus-full/sources/lammps/29Oct2020/src'
Compiling LAMMPS for machine omp
make[1]: warning: -j8 forced in submake: resetting jobserver mode.
make[1]: Entering directory '/disk2/cactus/cactus-full/sources/lammps/29Oct2020/src/Obj_omp'
cc -O -o fastdep.exe ../DEPEND/fastdep.c
make[1]: Leaving directory '/disk2/cactus/cactus-full/sources/lammps/29Oct2020/src/Obj_omp'
make[1]: warning: -j8 forced in submake: resetting jobserver mode.
make[1]: Entering directory '/disk2/cactus/cactus-full/sources/lammps/29Oct2020/src/Obj_omp'
mpicxx -g -O3 -restrict -fopenmp  -DLAMMPS_GZIP  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1     -c ../main.cpp
mpicxx -g -O3 -restrict -fopenmp  -DLAMMPS_GZIP  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1     -c ../ewald.cpp
mpicxx -g -O3 -restrict -fopenmp  -DLAMMPS_GZIP  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1     -c ../neigh_list.cpp
mpicxx -g -O3 -restrict -fopenmp  -DLAMMPS_GZIP  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1     -c ../angle_cosine.cpp
mpicxx -g -O3 -restrict -fopenmp  -DLAMMPS_GZIP  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1     -c ../pair_gauss_gpu.cpp
mpicxx -g -O3 -restrict -fopenmp  -DLAMMPS_GZIP  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1     -c ../pair_morse_gpu.cpp
mpicxx -g -O3 -restrict -fopenmp  -DLAMMPS_GZIP  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1     -c ../pair_lj96_cut.cpp
mpicxx -g -O3 -restrict -fopenmp  -DLAMMPS_GZIP  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1     -c ../rerun.cpp
g++: error: unrecognized command line option ‘-restrict’; did you mean ‘-Wrestrict’?
g++: error: unrecognized command line option ‘-restrict’; did you mean ‘-Wrestrict’?
g++: error: unrecognized command line option ‘-restrict’; did you mean ‘-Wrestrict’?
make[1]: *** [Makefile:109: main.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:109: neigh_list.o] Error 1
make[1]: *** [Makefile:109: ewald.o] Error 1
g++: error: unrecognized command line option ‘-restrict’; did you mean ‘-Wrestrict’?
make[1]: *** [Makefile:109: pair_gauss_gpu.o] Error 1
g++: error: unrecognized command line option ‘-restrict’; did you mean ‘-Wrestrict’?
g++: error: unrecognized command line option ‘-restrict’; did you mean ‘-Wrestrict’?
g++: error: unrecognized command line option ‘-restrict’; did you mean ‘-Wrestrict’?
make[1]: *** [Makefile:109: angle_cosine.o] Error 1
make[1]: *** [Makefile:109: pair_lj96_cut.o] Error 1
make[1]: *** [Makefile:109: pair_morse_gpu.o] Error 1
g++: error: unrecognized command line option ‘-restrict’; did you mean ‘-Wrestrict’?
make[1]: *** [Makefile:109: rerun.o] Error 1
make[1]: Leaving directory '/disk2/cactus/cactus-full/sources/lammps/29Oct2020/src/Obj_omp'
make: *** [Makefile:212: omp] Error 2

In fact mpicxx works as you can see below.

$ mpicxx
g++: fatal error: no input files
compilation terminated.

Any idea on how to fix that?

Option 1: use the CMake build procedure. “-restrict” will only be used with compilers that support it. CMake can test for that.
Option 2: copy src/MAKE/OPTIONS/Makefile.omp to src/MAKE/MINE/Makefile.omp and remove the “-restrict” flag