Skip to content

Commit

Permalink
feature_1552_gcc_10 (#1752)
Browse files Browse the repository at this point in the history
* Cleaned bash comparison operators; Made changes for MET to compile using GNU 10.1.0 compilers

* Updated documentation for new flag for BUFRLIB compilation
  • Loading branch information
jprestop authored Apr 14, 2021
1 parent 5ba033c commit a2bad6c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 17 deletions.
2 changes: 1 addition & 1 deletion met/docs/Users_Guide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ NCEP's BUFRLIB is used by the MET to decode point-based observation datasets in
.. code-block:: none
gcc -c -DUNDERSCORE `./getdefflags_C.sh` *.c >> make.log
gfortran -c -fno-second-underscore `./getdefflags_F.sh` modv*.F moda*.F \
gfortran -c -fno-second-underscore -fallow-argument-mismatch `./getdefflags_F.sh` modv*.F moda*.F \
`ls -1 *.F *.f | grep -v "mod[av]_"` >> make.log
ar crv libbufr.a *.o
Expand Down
42 changes: 26 additions & 16 deletions scripts/installation/compile_MET_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export LD_LIBRARY_PATH=${TEST_BASE}/external_libs/lib:${MET_PYTHON}/lib:${MET_NE
echo "LD_LIBRARY_PATH = ${LD_LIBRARY_PATH}"

# Constants
if [ -z ${MET_GRIB2CLIB} ]; then
if [ [ -z ${MET_GRIB2CLIB} && -z ${MET_GRIB2CINC} ] ]; then
COMPILE_ZLIB=1
COMPILE_LIBPNG=1
COMPILE_JASPER=1
Expand Down Expand Up @@ -128,18 +128,18 @@ COMPILER_VERSION=`echo $COMPILER | cut -d'_' -f2`

echo "USE_MODULES = ${USE_MODULES}"

if [ ${USE_MODULES} == "TRUE" ]; then
if [ ${USE_MODULES} = "TRUE" ]; then
echo "module load ${COMPILER_FAMILY}/${COMPILER_VERSION}"
echo ${COMPILER_FAMILY}/${COMPILER_VERSION}

module load ${COMPILER_FAMILY}/${COMPILER_VERSION}
if [ ${COMPILER_FAMILY} == "PrgEnv-intel" ]; then
if [ ${COMPILER_FAMILY} = "PrgEnv-intel" ]; then
module load craype
module switch craype craype-sandybridge
fi
fi

if [ ${COMPILER_FAMILY} == "gnu" ]; then
if [ ${COMPILER_FAMILY} = "gnu" ]; then
if [ -z ${CC} ]; then
export CC=`which gcc`
else
Expand All @@ -165,7 +165,7 @@ if [ ${COMPILER_FAMILY} == "gnu" ]; then
else
export F90=${F90}
fi
elif [ ${COMPILER_FAMILY} == "pgi" ]; then
elif [ ${COMPILER_FAMILY} = "pgi" ]; then
if [ -z ${CC} ]; then
export CC=`which pgcc`
else
Expand Down Expand Up @@ -225,7 +225,7 @@ echo "export F90=${F90}"

# Load Python module

if [ ${USE_MODULES} == "TRUE" ]; then
if [ ${USE_MODULES} = "TRUE" ]; then
if [ ! -z ${PYTHON_MODULE} ]; then
PYTHON_NAME=` echo $PYTHON_MODULE | cut -d'_' -f1`
PYTHON_VERSION_NUM=`echo $PYTHON_MODULE | cut -d'_' -f2`
Expand All @@ -241,7 +241,7 @@ python --version
# Compile GSL
if [ $COMPILE_GSL -eq 1 ]; then

if [ ${COMPILER_FAMILY} == "pgi" ]; then
if [ ${COMPILER_FAMILY} = "pgi" ]; then
vrs="1.11";
else
vrs="2.1";
Expand Down Expand Up @@ -295,8 +295,8 @@ if [ $COMPILE_BUFRLIB -eq 1 ]; then

# For GNU and Intel follow BUFRLIB11 instructions
if [[ ${COMPILER_FAMILY} == "gnu" ]]; then
${FC} -c -fno-second-underscore `./getdefflags_F.sh` modv*.F moda*.F `ls -1 *.F *.f | grep -v "mod[av]_"` >> make.log 2>&1
elif [[ ${COMPILER_FAMILY} == "intel" ]] || [[ ${COMPILER_FAMILY} == "ics" ]] || [[ ${COMPILER_FAMILY} == "ips" ]] || [[ ${COMPILER_FAMILY} == "ips" ]] || [[ ${COMPILER_FAMILY} == "PrgEnv-intel" ]]; then
${FC} -c -fno-second-underscore -fallow-argument-mismatch `./getdefflags_F.sh` modv*.F moda*.F `ls -1 *.F *.f | grep -v "mod[av]_"` >> make.log 2>&1
elif [[ ${COMPILER_FAMILY} == "intel" ]] || [[ ${COMPILER_FAMILY} == "ics" ]] || [[ ${COMPILER_FAMILY} == "ips" ]] || [[ ${COMPILER_FAMILY} == "ips" ]] || [[ ${COMPILER_FAMILY} == "PrgEnv-intel" ]]; then
${FC} -c `./getdefflags_F.sh` modv*.F moda*.F `ls -1 *.F *.f | grep -v "mod[av]_"` >> make.log 2>&1
elif [[ ${COMPILER_FAMILY} == "pgi" ]]; then
${FC} -c -Mnosecond_underscore `./getdefflags_F.sh` modv*.F moda*.F `ls -1 *.F *.f | grep -v "mod[av]_"` >> make.log 2>&1
Expand Down Expand Up @@ -460,8 +460,14 @@ if [ $COMPILE_HDF -eq 1 ]; then
echo "configure returned with non-zero ($ret) status"
exit 1
fi
cat mfhdf/hdiff/Makefile | sed 's/LIBS = -ljpeg -lz/LIBS = -ljpeg -lz -lm/g' > Makefile_NEW
mv Makefile_NEW mfhdf/hdiff/Makefile
cat mfhdf/hdiff/Makefile | \
sed 's/LIBS = -ljpeg -lz/LIBS = -ljpeg -lz -lm/g' \
> Makefile_new
mv Makefile_new mfhdf/hdiff/Makefile
cat hdf/src/Makefile | \
sed 's/FFLAGS = -O2/FFLAGS = -w -fallow-argument-mismatch -O2/g' \
> Makefile_new
mv Makefile_new hdf/src/Makefile
echo "make > make.log 2>&1"
make > make.log 2>&1
ret=$?
Expand Down Expand Up @@ -624,7 +630,7 @@ fi
if [ $COMPILE_CAIRO -eq 1 ]; then

# If on Cray, compile PIXMAN
if [ ${COMPILER_FAMILY} == "PrgEnv-intel" ]; then
if [ ${COMPILER_FAMILY} = "PrgEnv-intel" ]; then
echo
echo "Compiling pixman at `date`"
mkdir -p ${LIB_DIR}/pixman
Expand Down Expand Up @@ -664,7 +670,7 @@ if [ $COMPILE_CAIRO -eq 1 ]; then
tar -xf ${TAR_DIR}/cairo*.tar*
cd cairo*
export PKG_CONFIG=`which pkg-config`
if [ ${COMPILER_FAMILY} == "PrgEnv-intel" ]; then
if [ ${COMPILER_FAMILY} = "PrgEnv-intel" ]; then
export PKG_CONFIG_PATH=${LIB_DIR}/lib/pkgconfig/
fi
echo "cd `pwd`"
Expand Down Expand Up @@ -699,7 +705,7 @@ if [ $COMPILE_MET -eq 1 ]; then
cd ${MET_DIR}
# If using source from a tar file remove everything and unpack the tar file
# FALSE = compiling from github repo and we don't want to overwrite the files
if [ ${USE_MET_TAR_FILE} == "TRUE" ]; then
if [ ${USE_MET_TAR_FILE} = "TRUE" ]; then
rm -rf met*
tar -xzf ${MET_TARBALL}
fi
Expand All @@ -712,7 +718,11 @@ if [ $COMPILE_MET -eq 1 ]; then
fi

if [ -z ${MET_GRIB2CLIB} ]; then
export MET_GRIB2C=${LIB_DIR}
export MET_GRIB2CLIB=${LIB_DIR}/lib
export MET_GRIB2CINC=${LIB_DIR}/include
export LIB_JASPER=${LIB_DIR}/lib
export LIB_LIBPNG=${LIB_DIR}/lib
export LIB_Z=${LIB_DIR}/lib
else
export MET_GRIB2CLIB=${MET_GRIB2CLIB}
export MET_GRIB2CINC=${MET_GRIB2CINC}
Expand Down Expand Up @@ -744,7 +754,7 @@ if [ $COMPILE_MET -eq 1 ]; then
export LIBS="${LIBS} -lhdf5_hl -lhdf5 -lz"
export MET_FONT_DIR=${TEST_BASE}/fonts

if [ ${SET_D64BIT} == "TRUE" ]; then
if [ ${SET_D64BIT} = "TRUE" ]; then
export CFLAGS="-D__64BIT__"
export CXXFLAGS="-D__64BIT__"
fi
Expand Down
29 changes: 29 additions & 0 deletions scripts/installation/config/install_met_env.cheyenne_gcc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module load ncarenv/1.3
module load gnu/10.1.0
module load python/3.7.9
module load netcdf/4.7.4
ncar_pylib

export TEST_BASE=/glade/p/ral/jntp/MET/MET_cross_platform_testing/met-10.0.0-beta4/gcc
export COMPILER=gnu_10.1.0
export MET_SUBDIR=${TEST_BASE}
export MET_TARBALL=met-10.0.0-beta4.20210302.tar.gz
export USE_MODULES=TRUE
export MET_PYTHON=/glade/u/apps/ch/opt/python/3.7.9/gnu/9.1.0
export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.7m
export MET_PYTHON_LD=-L${MET_PYTHON}/lib\ -lpython3.7m\ -lcrypt\ -lpthread\ -ldl\ -lutil\ -lm
export MET_NETCDF=/glade/u/apps/ch/opt/netcdf/4.7.4/gnu/10.1.0/
export EXTERNAL_LIBS=/glade/p/ral/jntp/MET/MET_cross_platform_testing/met-10.0.0-beta4/gcc/external_libs/
export MET_GSL=${EXTERNAL_LIBS}
export MET_BUFRLIB=${EXTERNAL_LIBS}
export BUFRLIB_NAME=-lbufr
export MET_HDF5=/glade/u/apps/ch/opt/netcdf/4.7.4/gnu/10.1.0/
export MET_GRIB2CLIBS=${EXTERNAL_LIBS}/lib
export MET_GRIB2CINC=${EXTERNAL_LIBS}/include
export GRIB2CLIB_NAME=-lgrib2c
export LIB_JASPER=${EXTERNAL_LIBS}/lib
export LIB_LIBPNG=${EXTERNAL_LIBS}/lib
export LIB_Z=${EXTERNAL_LIBS}/lib
#export SET_D64BIT=FALSE
export CFLAGS="-Wall -g"
export CXXFLAGS="-Wall -g"

0 comments on commit a2bad6c

Please sign in to comment.