a msm_omp.cpp compile error

Hi,

I was building lammps-24Jan13.

I use
$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
on mac os x 10.8.2.

I executed following commands at src/.
make yes\-all make no-user-molfile
make no\-user\-cuda export KIM_DIR=~/openkim-api-v1.1.1
$ make openmpi

then i got a compile error of msm_omp.cpp as follows:
$ make openmpi
mpic++ -O2 -funroll-loops -fstrict-aliasing -Wall -W -Wno-uninitialized -fopenmp -DLAMMPS_GZIP -DLMP_USER_OMP -I../../lib/colvars -I../../lib/awpmd/ivutils/include -I../../lib/awpmd/systems/interact -I../../lib/atc -I../../lib/reax -I../../lib/poems -I../../lib/meam -I../../lib/awpmd/ivutils/include -I../../lib/awpmd/systems/interact -I../../lib/awpmd/ivutils/include -I../../lib/awpmd/systems/interact -DFFT_FFTW3 -I/Users/chibaf/openkim-api-v1.1.1/KIM_API -c msm_omp.cpp
msm_omp.cpp: In member function ‘void LAMMPS_NS::MSMOMP::direct_eval(int) [with int <anonymous> = 1, int <anonymous> = 1, int <anonymous> = 1]’:
msm_omp.cpp:93: instantiated from here
msm_omp.cpp:210: error: ‘n’ not specified in enclosing parallel
msm_omp.cpp:227: error: enclosing parallel
msm_omp.cpp: In member function ‘void LAMMPS_NS::MSMOMP::direct_eval(int) [with int <anonymous> = 1, int <anonymous> = 1, int <anonymous> = 0]’:
msm_omp.cpp:95: instantiated from here
msm_omp.cpp:210: error: ‘n’ not specified in enclosing parallel
msm_omp.cpp:227: error: enclosing parallel
msm_omp.cpp: In member function ‘void LAMMPS_NS::MSMOMP::direct_eval(int) [with int <anonymous> = 1, int <anonymous> = 0, int <anonymous> = 1]’:
msm_omp.cpp:98: instantiated from here
msm_omp.cpp:210: error: ‘n’ not specified in enclosing parallel
msm_omp.cpp:227: error: enclosing parallel
msm_omp.cpp: In member function ‘void LAMMPS_NS::MSMOMP::direct_eval(int) [with int <anonymous> = 1, int <anonymous> = 0, int <anonymous> = 0]’:
msm_omp.cpp:100: instantiated from here
msm_omp.cpp:210: error: ‘n’ not specified in enclosing parallel
msm_omp.cpp:227: error: enclosing parallel
msm_omp.cpp: In member function ‘void LAMMPS_NS::MSMOMP::direct_eval(int) [with int <anonymous> = 0, int <anonymous> = 1, int <anonymous> = 1]’:
msm_omp.cpp:105: instantiated from here
msm_omp.cpp:210: error: ‘n’ not specified in enclosing parallel
msm_omp.cpp:227: error: enclosing parallel
msm_omp.cpp: In member function ‘void LAMMPS_NS::MSMOMP::direct_eval(int) [with int <anonymous> = 0, int <anonymous> = 1, int <anonymous> = 0]’:
msm_omp.cpp:107: instantiated from here
msm_omp.cpp:210: error: ‘n’ not specified in enclosing parallel
msm_omp.cpp:227: error: enclosing parallel
msm_omp.cpp: In member function ‘void LAMMPS_NS::MSMOMP::direct_eval(int) [with int <anonymous> = 0, int <anonymous> = 0, int <anonymous> = 1]’:
msm_omp.cpp:110: instantiated from here
msm_omp.cpp:210: error: ‘n’ not specified in enclosing parallel
msm_omp.cpp:227: error: enclosing parallel
msm_omp.cpp: In member function ‘void LAMMPS_NS::MSMOMP::direct_eval(int) [with int <anonymous> = 0, int <anonymous> = 0, int <anonymous> = 0]’:
msm_omp.cpp:112: instantiated from here
msm_omp.cpp:210: error: ‘n’ not specified in enclosing parallel
msm_omp.cpp:227: error: enclosing parallel
make[1]: *** [msm_omp.o] Error 1
make: *** [openmpi] Error 2

this is a bug of mdm_omp.cpp?

regards,
chibaf (Fumihiro CHIBA)

Hi,

I was building lammps-24Jan13.

I use
$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
on mac os x 10.8.2.

I executed following commands at src/.

msm_omp.cpp: In member function ‘void LAMMPS_NS::MSMOMP::direct_eval(int) [with int <anonymous> = 0, int <anonymous> = 0, int <anonymous> = 0]’:
msm_omp.cpp:112: instantiated from here
msm_omp.cpp:210: error: ‘n’ not specified in enclosing parallel
msm_omp.cpp:227: error: enclosing parallel
make[1]: *** [msm_omp.o] Error 1
make: *** [openmpi] Error 2

this is a bug of mdm_omp.cpp?

no. this is likely a compiler bug. "n" is declared const and thus
does not need to be declared as shared in the omp pragma.

axel.

hi, axel.

I employed gcc version 4.8 from ( http://hpc.sourceforge.net ) instead of "i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1".
Then i got no compile error. And lammps-24Jan13 was built.

My trouble seemed to be a compiler bug.

Thank you for your advice.

chibaf (Fumihiro CHIBA)