NOAA-GFDL / SHiELD_build

Other
7 stars 17 forks source link

gnu.mk file OPENMP, Undefined reference to `omp_get_ ... #11

Closed StevePny closed 2 years ago

StevePny commented 2 years ago

The mk_make script builds with:

(cd exec/${CONFIG}_${COMPILER} ; make -j 8 OPENMP=Y NETCDF=3 ${COMP} AVX=${AVX} ${BIT} NCEPLIBS="${NCEPLIBS}" -f Makefile_fv3)

which indicates the use of OPENMP=Y. However in the gnu.mk template file https://github.com/NOAA-GFDL/SHiELD_build/blob/main/site/gnu.mk it has the openmp flag commented out, for example: FFLAGS_OPENMP = #-fopenmp at: https://github.com/NOAA-GFDL/SHiELD_build/blob/d6581a4610adf3961bb987061358bed1f40a80de/site/gnu.mk#L51 https://github.com/NOAA-GFDL/SHiELD_build/blob/d6581a4610adf3961bb987061358bed1f40a80de/site/gnu.mk#L58 https://github.com/NOAA-GFDL/SHiELD_build/blob/d6581a4610adf3961bb987061358bed1f40a80de/site/gnu.mk#L67

This causes a series of compile-time errors of the type omp_get_ ...

At the moment I'm changing this using:

sed "s/#-fopenmp/-fopenmp/g" < ${BUILD_ROOT}/${TEMPLATE} > OUT \
  && mv OUT ${BUILD_ROOT}/${TEMPLATE}

and the model seems to compile successfully.

Is there a reason for removing the openmp flags?

bensonr commented 2 years ago

I do not see any compilation errors associated with the lack of -fopenmp in the gnu.mk template. Regardless, it does make sense to activate it and a future PR will address it.

laurenchilutti commented 2 years ago

Resolved by PR #12