From 3ed236c859e83b13f8d9b1d8eac47218a318d8cf Mon Sep 17 00:00:00 2001 From: laurenchilutti <60401591+laurenchilutti@users.noreply.github.com> Date: Wed, 7 Jun 2023 14:58:12 -0400 Subject: [PATCH] Bug Fixes (#23) * -DHAVE_GETTID should only be added the FMS build cppdefs when on Gaea. * fixing intel.mk * loading python causes problems in gnu.mk and intel.mk because nc-config --libs is no longer blank. And fixing error in intel.mk and gnu.mk * update use yaml functionality in COMPILE and MAKE_libFMS so that building FMS without the -Duse_yaml flag is the defualt --- Build/COMPILE | 1 + Build/mk_scripts/MAKE_libFMS | 4 ++-- site/environment.gnu.sh | 12 ++++++++++-- site/environment.intel.sh | 12 ++++++++++-- site/gnu.mk | 4 ++-- site/intel.mk | 4 ++-- 6 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Build/COMPILE b/Build/COMPILE index 4b61c0b..06061c1 100755 --- a/Build/COMPILE +++ b/Build/COMPILE @@ -156,6 +156,7 @@ echo -e "\tbit = $bit" echo -e "\tavx = $avx" echo -e "\tcompiler = $compiler" echo -e "\tclean = $clean" +echo -e "\tyaml = $yaml" echo -e "\n" sleep 5 diff --git a/Build/mk_scripts/MAKE_libFMS b/Build/mk_scripts/MAKE_libFMS index fb4f10e..6bd8cba 100755 --- a/Build/mk_scripts/MAKE_libFMS +++ b/Build/mk_scripts/MAKE_libFMS @@ -42,7 +42,7 @@ do ;; noyaml|yaml) YAML="${arg#*=}" - if [ $YAML='yaml' ] ; then + if [ ${YAML} = 'yaml' ] ; then USE_YAML=-Duse_yaml fi shift # Remove yaml from processing @@ -56,7 +56,7 @@ done # # CPPDEFS needed to build libFMS -cppDefs="-Duse_libMPI -Duse_netCDF -Duse_LARGEFILE -DHAVE_SCHED_GETAFFINITY -DINTERNAL_FILE_NML -DGFS_PHYS -DGFS_CONSTANTS ${USE_YAML} -DHAVE_GETTID" +cppDefs="-Duse_libMPI -Duse_netCDF -Duse_LARGEFILE -DHAVE_SCHED_GETAFFINITY -DINTERNAL_FILE_NML -DGFS_PHYS -DGFS_CONSTANTS ${USE_YAML} ${FMS_CPPDEFS}" # # clean up and create the FMS library directory diff --git a/site/environment.gnu.sh b/site/environment.gnu.sh index ecdcb52..f91e287 100755 --- a/site/environment.gnu.sh +++ b/site/environment.gnu.sh @@ -40,9 +40,11 @@ case $hostname in module load cray-netcdf/4.9.0.3 module load craype-hugepages4M module load cmake/3.23.1 - module load python/3.9 module load libyaml/0.2.5 + # Add -DHAVE_GETTID to the FMS cppDefs + export FMS_CPPDEFS=-DHAVE_GETTID + # make your compiler selections here export FC=ftn export CC=cc @@ -72,9 +74,11 @@ case $hostname in module load cray-netcdf/4.8.1.3 module load craype-hugepages4M module load cmake/3.20.1 - module load python/3.9 module load libyaml/0.2.5 + # Add -DHAVE_GETTID to the FMS cppDefs + export FMS_CPPDEFS=-DHAVE_GETTID + # make your compiler selections here export FC=ftn export CC=cc @@ -103,6 +107,7 @@ case $hostname in export HDF5=${HDF5_ROOT} export LIBRARY_PATH="${LIBRARY_PATH}:${NETCDF}/lib:${HDF5}/lib" export NETCDF_DIR=${NETCDF} + export FMS_CPPDEFS="" # make your compiler selections here export FC=mpif90 @@ -131,6 +136,7 @@ case $hostname in export LIBRARY_PATH="${LIBRARY_PATH}:${NETCDF4}/lib:${HDF5}/lib" export NETCDF_DIR=${NETCDF4} + export FMS_CPPDEFS="" # make your compiler selections here export FC=mpif90 @@ -158,6 +164,7 @@ case $hostname in export LIBRARY_PATH="${LIBRARY_PATH}:${NETCDF}/lib:${HDF5}/lib" export NETCDF_DIR=${NETCDF} + export FMS_CPPDEFS="" # make your compiler selections here export FC=mpif90 @@ -185,6 +192,7 @@ case $hostname in export CPATH="${NETCDF_ROOT}/include:${CPATH}" export NETCDF_DIR=${NETCDF_ROOT} + export FMS_CPPDEFS="" # make your compiler selections here export FC=mpif90 diff --git a/site/environment.intel.sh b/site/environment.intel.sh index 196dd85..b3eced6 100755 --- a/site/environment.intel.sh +++ b/site/environment.intel.sh @@ -43,9 +43,11 @@ case $hostname in module load cray-netcdf module load craype-hugepages4M module load cmake/3.23.1 - module load python/3.9 module load libyaml/0.2.5 + # Add -DHAVE_GETTID to the FMS cppDefs + export FMS_CPPDEFS=-DHAVE_GETTID + # make your compiler selections here export FC=ftn export CC=cc @@ -74,9 +76,11 @@ case $hostname in module load cray-netcdf/4.8.1.3 module load craype-hugepages4M module load cmake/3.20.1 - module load python/3.9 module load libyaml/0.2.5 + # Add -DHAVE_GETTID to the FMS cppDefs + export FMS_CPPDEFS=-DHAVE_GETTID + # make your compiler selections here export FC=ftn export CC=cc @@ -104,6 +108,7 @@ case $hostname in export HDF5=${HDF5_ROOT} export LIBRARY_PATH="${LIBRARY_PATH}:${NETCDF}/lib:${HDF5}/lib" export NETCDF_DIR=${NETCDF} + export FMS_CPPDEFS="" # make your compiler selections here export FC=mpiifort @@ -133,6 +138,7 @@ case $hostname in export LIBRARY_PATH="${LIBRARY_PATH}:${NETCDF4}/lib:${HDF5}/lib" export NETCDF_DIR=${NETCDF4} + export FMS_CPPDEFS="" # make your compiler selections here export FC=mpiifort @@ -155,6 +161,7 @@ case $hostname in export LIBRARY_PATH="${LIBRARY_PATH}:${NETCDF}/lib:${HDF5}/lib" export NETCDF_DIR=${NETCDF} + export FMS_CPPDEFS="" # make your compiler selections here export FC=mpiifort @@ -182,6 +189,7 @@ case $hostname in export CPATH="${NETCDF_ROOT}/include:${CPATH}" export NETCDF_DIR=${NETCDF_ROOT} + export FMS_CPPDEFS="" # make your compiler selections here export FC=mpiifort diff --git a/site/gnu.mk b/site/gnu.mk index b6bbc36..e14ac7d 100644 --- a/site/gnu.mk +++ b/site/gnu.mk @@ -39,7 +39,7 @@ else INCLUDE = -I$(NETCDF_ROOT)/include LIBS += -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz endif -INCLUDE := $(shell pkg-config --cflags yaml-0.1) +INCLUDE += $(shell pkg-config --cflags yaml-0.1) FPPFLAGS := -cpp -Wp,-w $(INCLUDE) CPPFLAGS := $(shell pkg-config --cflags yaml-0.1) @@ -120,7 +120,7 @@ ifeq ($(NETCDF),3) CPPDEFS += -Duse_LARGEFILE endif endif -LIBS := $(shell pkg-config --libs yaml-0.1) +LIBS += $(shell pkg-config --libs yaml-0.1) LDFLAGS += $(LIBS) -L$(NETCDF_ROOT)/lib -L$(HDF5_DIR)/lib #--------------------------------------------------------------------------- diff --git a/site/intel.mk b/site/intel.mk index db01c74..26dace6 100644 --- a/site/intel.mk +++ b/site/intel.mk @@ -39,7 +39,7 @@ else INCLUDE = -I$(NETCDF_ROOT)/include LIBS += -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz endif -INCLUDE := $(shell pkg-config --cflags yaml-0.1) +INCLUDE += $(shell pkg-config --cflags yaml-0.1) FPPFLAGS := -fpp -Wp,-w $(INCLUDE) CPPFLAGS := $(shell pkg-config --cflags yaml-0.1) @@ -123,7 +123,7 @@ ifeq ($(NETCDF),3) endif endif -LIBS := $(shell pkg-config --libs yaml-0.1) +LIBS += $(shell pkg-config --libs yaml-0.1) LDFLAGS += $(LIBS) #---------------------------------------------------------------------------