Error with "restrict" keyword in KSPACE package

I downloaded the latest LAMMPS source on Sept. 28 and am getting the following error compiling on the Cray:

CC -O2 -D CUDA_ARCH=20 -hgnu -DLAMMPS_GZIP -DNODE_PARTITION -I../../lib/cuda -DLMP_USER_CUDA -DMPICH_SKIP_MPICXX -I/opt/cray/mpt/5.5.2/gni/mpich2-cray/74/include -DFFT_CUFFT -DFFT_FFTW3 -I /opt/fftw/ -I/opt/nvidia/cuda/5.0.20//include -DUNIX -DFFT_CUFFT -DCUDA_PRECISION=2 -DCUDA_ARCH=20 -c force.cpp

CC-643 crayc++: ERROR File = msm.h, Line = 95
The "restrict" keyword is not allowed in this context.

void restrict(int,int,int);
CC-40 crayc++: ERROR File = msm.h, Line = 95
An identifier is expected.

This problem didn’t occur with the sources I downloaded in July.
The msm.h and force.cpp files have not changed between the two drops.
The list of include-files is pretty long, though, so it will take me awhile to sort out what the changes are.
In the meantime, from looking at the error, can any of you tell offhand what the problem is?


Hi Carl. Your compiler is complaining because we’ve added a function called “restrict” when we added the MSM capability to LAMMPS on Sept 14, 2012. Note that restrict is a c99 keyword, but is not part of the C++ standard yet. Some compilers will complain, as you’ve discovered.

We’ll need to change that function name. In the meanwhile, please try picking a different name for that function and see if it will compile.