Skip to content

Commit

Permalink
Bug Fixes (#23)
Browse files Browse the repository at this point in the history
* -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
  • Loading branch information
laurenchilutti authored Jun 7, 2023
1 parent d192536 commit 3ed236c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
1 change: 1 addition & 0 deletions Build/COMPILE
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions Build/mk_scripts/MAKE_libFMS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 10 additions & 2 deletions site/environment.gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions site/environment.intel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions site/gnu.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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

#---------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions site/intel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

#---------------------------------------------------------------------------
Expand Down

0 comments on commit 3ed236c

Please sign in to comment.