From 290abc864a966a14ad97fb4621db7b09811561f8 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 18 Mar 2024 17:34:28 -0400 Subject: [PATCH 01/11] build rdbfmsua the hard way --- modulefiles/gfsutils_hera.intel.lua | 6 -- modulefiles/gfsutils_orion.intel.lua | 6 -- modulefiles/gfsutils_wcoss2.intel.lua | 5 -- modulefiles/rdbfmsua_hera.intel.lua | 26 ++++++ modulefiles/rdbfmsua_orion.intel.lua | 25 ++++++ modulefiles/rdbfmsua_wcoss2.intel.lua | 36 ++++++++ src/rdbfmsua.fd/makefile | 19 +++++ src/rdbfmsua.fd/makefile.hera.intel | 12 +++ src/rdbfmsua.fd/makefile.wcoss2.intel | 9 ++ src/rdbfmsua.fd/to_be_deleted/makefile | 84 ------------------- src/rdbfmsua.fd/to_be_deleted/makefile.hera | 76 ----------------- src/rdbfmsua.fd/to_be_deleted/makefile.wcoss2 | 76 ----------------- ush/build.sh | 16 ++++ 13 files changed, 143 insertions(+), 253 deletions(-) create mode 100644 modulefiles/rdbfmsua_hera.intel.lua create mode 100644 modulefiles/rdbfmsua_orion.intel.lua create mode 100644 modulefiles/rdbfmsua_wcoss2.intel.lua create mode 100644 src/rdbfmsua.fd/makefile create mode 100644 src/rdbfmsua.fd/makefile.hera.intel create mode 100644 src/rdbfmsua.fd/makefile.wcoss2.intel delete mode 100644 src/rdbfmsua.fd/to_be_deleted/makefile delete mode 100644 src/rdbfmsua.fd/to_be_deleted/makefile.hera delete mode 100644 src/rdbfmsua.fd/to_be_deleted/makefile.wcoss2 diff --git a/modulefiles/gfsutils_hera.intel.lua b/modulefiles/gfsutils_hera.intel.lua index e7273293..2618bed0 100644 --- a/modulefiles/gfsutils_hera.intel.lua +++ b/modulefiles/gfsutils_hera.intel.lua @@ -14,10 +14,4 @@ load(pathJoin("cmake", cmake_ver)) load("gfsutils_common") -local gempak_ver=os.getenv("gempak_ver") or "7.4.2" --- load(pathJoin("gempak", gempak_ver)) - --- Used in rdbfmsua.f -setenv("gfortran_ROOT", "/apps/gnu/gcc-9.2.0") - whatis("Description: GFS utilities environment on Hera with Intel Compilers") diff --git a/modulefiles/gfsutils_orion.intel.lua b/modulefiles/gfsutils_orion.intel.lua index 985051ca..8eb29c2b 100644 --- a/modulefiles/gfsutils_orion.intel.lua +++ b/modulefiles/gfsutils_orion.intel.lua @@ -14,10 +14,4 @@ load(pathJoin("cmake", cmake_ver)) load("gfsutils_common") -local gempak_ver=os.getenv("gempak_ver") or "7.5.1" --- load(pathJoin("gempak", gempak_ver)) - --- Used in rdbfmsua.f -setenv("gfortran_ROOT", "/apps/gcc-8/gcc-8.3.0") - whatis("Description: GFS utilities environment on Orion with Intel Compilers") diff --git a/modulefiles/gfsutils_wcoss2.intel.lua b/modulefiles/gfsutils_wcoss2.intel.lua index 4f9df05b..a3219117 100644 --- a/modulefiles/gfsutils_wcoss2.intel.lua +++ b/modulefiles/gfsutils_wcoss2.intel.lua @@ -24,7 +24,6 @@ local nemsiogfs_ver=os.getenv("nemsiogfs_ver") or "2.5.3" local wrf_io_ver=os.getenv("wrf_io_ver") or "1.2.0" local g2_ver=os.getenv("g2_ver") or "3.4.5" local landsfcutil_ver=os.getenv("landsfcutil_ver") or "2.4.1" -local gempak_ver=os.getenv("gempak_ver") or "7.14.1" local wgrib2_ver=os.getenv("wgrib2_ver") or "2.0.8" load(pathJoin("PrgEnv-intel", PrgEnv_intel_ver)) @@ -50,12 +49,8 @@ load(pathJoin("nemsio", nemsio_ver)) load(pathJoin("wrf_io", wrf_io_ver)) load(pathJoin("g2", g2_ver)) load(pathJoin("landsfcutil", landsfcutil_ver)) --- load(pathJoin("gempak", gempak_ver)) load(pathJoin("wgrib2", wgrib2_ver)) --- Used in rdbfmsua.f -setenv("gfortran_ROOT", "//opt/cray/pe/gcc/10.3.0/snos") - pushenv("HPC_OPT", "/apps/ops/para/libs") prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/compiler/intel/19.1.3.304") prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/mpi/intel/19.1.3.304/cray-mpich/8.1.7") diff --git a/modulefiles/rdbfmsua_hera.intel.lua b/modulefiles/rdbfmsua_hera.intel.lua new file mode 100644 index 00000000..69dda265 --- /dev/null +++ b/modulefiles/rdbfmsua_hera.intel.lua @@ -0,0 +1,26 @@ +help([[ +Build environment for GFS utilities on Hera +]]) + +prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/gsi-addon-dev/install/modulefiles/Core") + +local stack_intel_ver=os.getenv("stack_intel_ver") or "2021.5.0" +local stack_impi_ver=os.getenv("stack_impi_ver") or "2021.5.1" +local cmake_ver=os.getenv("cmake_ver") or "3.23.1" + +load(pathJoin("stack-intel", stack_intel_ver)) +load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) + +local bufr_ver=os.getenv("bufr_ver") or "11.7.0" +local bacio_ver=os.getenv("bacio_ver") or "2.4.1" +local w3emc_ver=os.getenv("w3emc_ver") or "2.10.0" +local gempak_ver=os.getenv("gempak_ver") or "7.4.2" + +load(pathJoin("bufr", bufr_ver)) +load(pathJoin("bacio", bacio_ver)) +load(pathJoin("w3emc", w3emc_ver)) +load(pathJoin("gempak", gempak_ver)) + +setenv("gfortran_ROOT", "/apps/gnu/gcc-9.2.0") + +whatis("Description: GFS utilities environment on Hera with Intel Compilers") diff --git a/modulefiles/rdbfmsua_orion.intel.lua b/modulefiles/rdbfmsua_orion.intel.lua new file mode 100644 index 00000000..5a80bee4 --- /dev/null +++ b/modulefiles/rdbfmsua_orion.intel.lua @@ -0,0 +1,25 @@ +help([[ +Build environment for GFS utilities on Orion +]]) + +prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/orion/spack-stack-1.6.0/envs/gsi-addon-env/install/modulefiles/Core") + +local stack_intel_ver=os.getenv("stack_intel_ver") or "2022.0.2" +local stack_impi_ver=os.getenv("stack_impi_ver") or "2021.5.1" + +load(pathJoin("stack-intel", stack_intel_ver)) +load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) + +local bufr_ver=os.getenv("bufr_ver") or "11.7.0" +local bacio_ver=os.getenv("bacio_ver") or "2.4.1" +local w3emc_ver=os.getenv("w3emc_ver") or "2.10.0" +local gempak_ver=os.getenv("gempak_ver") or "7.5.1" + +load(pathJoin("bufr", bufr_ver)) +load(pathJoin("bacio", bacio_ver)) +load(pathJoin("w3emc", w3emc_ver)) +load(pathJoin("gempak", gempak_ver)) + +setenv("gfortran_ROOT", "/apps/gcc-8/gcc-8.3.0") + +whatis("Description: GFS utilities environment on Orion with Intel Compilers") diff --git a/modulefiles/rdbfmsua_wcoss2.intel.lua b/modulefiles/rdbfmsua_wcoss2.intel.lua new file mode 100644 index 00000000..e1551110 --- /dev/null +++ b/modulefiles/rdbfmsua_wcoss2.intel.lua @@ -0,0 +1,36 @@ +help([[ +Build environment for GFS utilities on WCOSS2 +]]) + +local PrgEnv_intel_ver=os.getenv("PrgEnv_intel_ver") or "8.1.0" +local intel_ver=os.getenv("intel_ver") or "19.1.3.304" +local craype_ver=os.getenv("craype_ver") or "2.7.10" +local cray_mpich_ver=os.getenv("cray_mpich_ver") or "8.1.9" + +local jasper_ver=os.getenv("jasper_ver") or "2.0.25" +local zlib_ver=os.getenv("zlib_ver") or "1.2.11" +local libpng_ver=os.getenv("libpng_ver") or "1.6.37" +local netcdf_ver=os.getenv("netcdf_ver") or "4.7.4" + +local bufr_ver=os.getenv("bufr_ver") or "11.7.0" +local bacio_ver=os.getenv("bacio_ver") or "2.4.1" +local w3emc_ver=os.getenv("w3emc_ver") or "2.9.2" +local gempak_ver=os.getenv("gempak_ver") or "7.14.1" + +load(pathJoin("PrgEnv-intel", PrgEnv_intel_ver)) +load(pathJoin("intel", intel_ver)) +load(pathJoin("craype", craype_ver)) +load(pathJoin("cray-mpich", cray_mpich_ver)) + +load(pathJoin("jasper", jasper_ver)) +load(pathJoin("zlib", zlib_ver)) +load(pathJoin("libpng", libpng_ver)) + +load(pathJoin("bufr", bufr_ver)) +load(pathJoin("bacio", bacio_ver)) +load(pathJoin("w3emc", w3emc_ver)) +load(pathJoin("gempak", gempak_ver)) + +setenv("gfortran_ROOT", "//opt/cray/pe/gcc/10.3.0/snos") + +whatis("Description: GFS utilities environment on WCOSS2 with Intel Compilers") diff --git a/src/rdbfmsua.fd/makefile b/src/rdbfmsua.fd/makefile new file mode 100644 index 00000000..becf382b --- /dev/null +++ b/src/rdbfmsua.fd/makefile @@ -0,0 +1,19 @@ +SHELL=/bin/sh + +include makefile.${MACHINE_ID}.${COMPILER} + +CMD = rdbfmsua.x +OBJS = rdbfmsua.o + +$(CMD): $(OBJS) + $(FC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) + +clean: + -rm -f ${OBJS} ${CMD} + +clobber: clean + -rm -f ${CMD} + +install: + -mv ${CMD} ${PREFIX}/ + diff --git a/src/rdbfmsua.fd/makefile.hera.intel b/src/rdbfmsua.fd/makefile.hera.intel new file mode 100644 index 00000000..c63b2ec1 --- /dev/null +++ b/src/rdbfmsua.fd/makefile.hera.intel @@ -0,0 +1,12 @@ +FC = ifort + +GFORTRAN=/apps/gcc/6.2.0/lib64 + +FFLAGS = -g -traceback -I${GEMPAK}/include -I${OS_INC} +LIBS = ${BUFR_LIB4} \ + ${GEMLIB}/gemlib.a \ + ${GEMLIB}/appl.a \ + ${GEMLIB}/syslib.a \ + ${GEMLIB}/cgemlib.a \ + ${GEMLIB}/bridge.a \ + -L${GFORTRAN} -lgfortran diff --git a/src/rdbfmsua.fd/makefile.wcoss2.intel b/src/rdbfmsua.fd/makefile.wcoss2.intel new file mode 100644 index 00000000..5dc8d88c --- /dev/null +++ b/src/rdbfmsua.fd/makefile.wcoss2.intel @@ -0,0 +1,9 @@ +FC = ftn + +GFORTRAN=/opt/cray/pe/gcc/10.3.0/snos/lib64/libgfortran.a + +FFLAGS = -g -traceback -I${GEMINC} -I${OS_INC} +LIBS = ${BUFR_LIB4} \ + -L${GEMOLB} -lgemlib -lappl -lsyslib -lcgemlib \ + ${GEMOLB}/libbridge.a \ + ${GFORTRAN} diff --git a/src/rdbfmsua.fd/to_be_deleted/makefile b/src/rdbfmsua.fd/to_be_deleted/makefile deleted file mode 100644 index 69d183f3..00000000 --- a/src/rdbfmsua.fd/to_be_deleted/makefile +++ /dev/null @@ -1,84 +0,0 @@ -SHELL=/bin/sh -# -# This makefile was produced by /usr/bin/fmgen at 11:21:07 AM on 10/28/94 -# If it is invoked by the command line -# make -f makefile -# it will compile the fortran modules indicated by SRCS into the object -# modules indicated by OBJS and produce an executable named a.out. -# -# If it is invoked by the command line -# make -f makefile a.out.prof -# it will compile the fortran modules indicated by SRCS into the object -# modules indicated by OBJS and produce an executable which profiles -# named a.out.prof. -# -# To remove all the objects but leave the executables use the command line -# make -f makefile clean -# -# To remove everything but the source files use the command line -# make -f makefile clobber -# -# To remove the source files created by /usr/bin/fmgen and this makefile -# use the command line -# make -f makefile void -# -# The parameters SRCS and OBJS should not need to be changed. If, however, -# you need to add a new module add the name of the source module to the -# SRCS parameter and add the name of the resulting object file to the OBJS -# parameter. The new modules are not limited to fortran, but may be C, YACC, -# LEX, or CAL. An explicit rule will need to be added for PASCAL modules. -# -OBJS= rdbfmsua.o - - -# Tunable parameters -# -# FC Name of the fortran compiling system to use -# LDFLAGS Flags to the loader -# LIBS List of libraries -# CMD Name of the executable -# -FC = ifort -# FFLAGS = -O3 -q32 -I${GEMINC} -I${NAWIPS}/os/${NA_OS}/include -# FFLAGS = -I${GEMINC} -I${NAWIPS}/os/${NA_OS}/include -FFLAGS = -I${GEMINC} -I${OS_INC} -# LDFLAGS = -O3 -q32 -s -# LDFLAGS = -Wl,-Map,MAPFILE - -# BRIDGE=/gpfs/dell1/nco/ops/nwpara/gempak.v7.3.1/nawips/os/linux3.10.0_x86_64/lib/libbridge.a -BRIDGE=${GEMOLB}/libbridge.a - -LIBS = ${DECOD_UT_LIB} ${BUFR_LIB4} \ - -L${GEMOLB} -lgemlib -lappl -lsyslib -lcgemlib -lgfortran ${BRIDGE} - -# -L${GEMOLB} -lgemlib -lappl -lsyslib -lcgemlib -lgfortran ${BRIDGE} -# -L/nwprod/gempak/nawips1/os/linux2.6.32_x86_64/lib -lgemlib -lappl -lsyslib -lcgemlib -lbridge -lncepBUFR \ -# -lgfortran - -CMD = rdbfmsua - -# To perform the default compilation, use the first line -# To compile with flowtracing turned on, use the second line -# To compile giving profile additonal information, use the third line -# CFLAGS= -O3 -q32 - -# Lines from here on down should not need to be changed. They are the -# actual rules which make uses to build a.out. -# - -$(CMD): $(OBJS) - $(FC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) - - -# The following rule reads the required NAWIPS definitions and then recursively -# runs this same makefile with a new target in the spawned shell. -# - -clean: - -rm -f ${OBJS} - -clobber: clean - -rm -f ${CMD} - -void: clobber - -rm -f ${SRCS} makefile diff --git a/src/rdbfmsua.fd/to_be_deleted/makefile.hera b/src/rdbfmsua.fd/to_be_deleted/makefile.hera deleted file mode 100644 index 0df163a4..00000000 --- a/src/rdbfmsua.fd/to_be_deleted/makefile.hera +++ /dev/null @@ -1,76 +0,0 @@ -SHELL=/bin/sh -# -# This makefile was produced by /usr/bin/fmgen at 11:21:07 AM on 10/28/94 -# If it is invoked by the command line -# make -f makefile -# it will compile the fortran modules indicated by SRCS into the object -# modules indicated by OBJS and produce an executable named a.out. -# -# If it is invoked by the command line -# make -f makefile a.out.prof -# it will compile the fortran modules indicated by SRCS into the object -# modules indicated by OBJS and produce an executable which profiles -# named a.out.prof. -# -# To remove all the objects but leave the executables use the command line -# make -f makefile clean -# -# To remove everything but the source files use the command line -# make -f makefile clobber -# -# To remove the source files created by /usr/bin/fmgen and this makefile -# use the command line -# make -f makefile void -# -# The parameters SRCS and OBJS should not need to be changed. If, however, -# you need to add a new module add the name of the source module to the -# SRCS parameter and add the name of the resulting object file to the OBJS -# parameter. The new modules are not limited to fortran, but may be C, YACC, -# LEX, or CAL. An explicit rule will need to be added for PASCAL modules. -# -OBJS= rdbfmsua.o - - -# Tunable parameters -# -# FC Name of the fortran compiling system to use -# LDFLAGS Flags to the loader -# LIBS List of libraries -# CMD Name of the executable -# -FC = ifort -FFLAGS = -g -traceback -I${GEMINC} -I${OS_INC} - -BRIDGE=${GEMOLB}/bridge.a -GFORTRAN=/apps/gcc/6.2.0/lib64 - -LIBS = ${DECOD_UT_LIB} ${BUFR_LIB4} \ - ${GEMLIB}/gemlib.a ${GEMLIB}/appl.a ${GEMLIB}/syslib.a ${GEMLIB}/cgemlib.a -L${GFORTRAN} -lgfortran ${BRIDGE} - -CMD = rdbfmsua - -# To perform the default compilation, use the first line -# To compile with flowtracing turned on, use the second line -# To compile giving profile additonal information, use the third line -# CFLAGS= -O3 -q32 - -# Lines from here on down should not need to be changed. They are the -# actual rules which make uses to build a.out. -# - -$(CMD): $(OBJS) - $(FC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) - - -# The following rule reads the required NAWIPS definitions and then recursively -# runs this same makefile with a new target in the spawned shell. -# - -clean: - -rm -f ${OBJS} - -clobber: clean - -rm -f ${CMD} - -void: clobber - -rm -f ${SRCS} makefile diff --git a/src/rdbfmsua.fd/to_be_deleted/makefile.wcoss2 b/src/rdbfmsua.fd/to_be_deleted/makefile.wcoss2 deleted file mode 100644 index 2fb948ac..00000000 --- a/src/rdbfmsua.fd/to_be_deleted/makefile.wcoss2 +++ /dev/null @@ -1,76 +0,0 @@ -SHELL=/bin/sh -# -# This makefile was produced by /usr/bin/fmgen at 11:21:07 AM on 10/28/94 -# If it is invoked by the command line -# make -f makefile -# it will compile the fortran modules indicated by SRCS into the object -# modules indicated by OBJS and produce an executable named a.out. -# -# If it is invoked by the command line -# make -f makefile a.out.prof -# it will compile the fortran modules indicated by SRCS into the object -# modules indicated by OBJS and produce an executable which profiles -# named a.out.prof. -# -# To remove all the objects but leave the executables use the command line -# make -f makefile clean -# -# To remove everything but the source files use the command line -# make -f makefile clobber -# -# To remove the source files created by /usr/bin/fmgen and this makefile -# use the command line -# make -f makefile void -# -# The parameters SRCS and OBJS should not need to be changed. If, however, -# you need to add a new module add the name of the source module to the -# SRCS parameter and add the name of the resulting object file to the OBJS -# parameter. The new modules are not limited to fortran, but may be C, YACC, -# LEX, or CAL. An explicit rule will need to be added for PASCAL modules. -# -OBJS= rdbfmsua.o - - -# Tunable parameters -# -# FC Name of the fortran compiling system to use -# LDFLAGS Flags to the loader -# LIBS List of libraries -# CMD Name of the executable -# -FC = ftn -FFLAGS = -g -traceback -I${GEMINC} -I${OS_INC} - -BRIDGE=${GEMOLB}/libbridge.a -GFORTRAN=/opt/cray/pe/gcc/10.3.0/snos/lib64/libgfortran.a - -LIBS = ${DECOD_UT_LIB} ${BUFR_LIB4} \ - -L${GEMOLB} -lgemlib -lappl -lsyslib -lcgemlib ${GFORTRAN} ${BRIDGE} - -CMD = rdbfmsua - -# To perform the default compilation, use the first line -# To compile with flowtracing turned on, use the second line -# To compile giving profile additonal information, use the third line -# CFLAGS= -O3 -q32 - -# Lines from here on down should not need to be changed. They are the -# actual rules which make uses to build a.out. -# - -$(CMD): $(OBJS) - $(FC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) - - -# The following rule reads the required NAWIPS definitions and then recursively -# runs this same makefile with a new target in the spawned shell. -# - -clean: - -rm -f ${OBJS} - -clobber: clean - -rm -f ${CMD} - -void: clobber - -rm -f ${SRCS} makefile diff --git a/ush/build.sh b/ush/build.sh index 41f66e1b..20c5431b 100755 --- a/ush/build.sh +++ b/ush/build.sh @@ -40,4 +40,20 @@ make -j ${BUILD_JOBS:-8} VERBOSE=${BUILD_VERBOSE:-} make install set +x +# Build rdbfmsua.x separately due to GEMPAK issues +# Load modules +source $DIR_ROOT/ush/module-setup.sh +module use $DIR_ROOT/modulefiles +module load rdbfmsua_$MACHINE_ID.$COMPILER +module show gempak +module list + +cd $DIR_ROOT/src/rdbfmsua.fd +export MACHINE_ID +export COMPILER +export PREFIX=${INSTALL_PREFIX}/bin +make clean +make VERBOSE=${BUILD_VERBOSE:-} +make install VERBOSE=${BUILD_VERBOSE:-} + exit From 85be0acb6d6aef041d79a960ae9a459c1e161120 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 18 Mar 2024 17:39:17 -0400 Subject: [PATCH 02/11] use gfortran_ROOT --- modulefiles/rdbfmsua_wcoss2.intel.lua | 2 +- src/rdbfmsua.fd/makefile.hera.intel | 4 +--- src/rdbfmsua.fd/makefile.wcoss2.intel | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/modulefiles/rdbfmsua_wcoss2.intel.lua b/modulefiles/rdbfmsua_wcoss2.intel.lua index e1551110..fa6ab142 100644 --- a/modulefiles/rdbfmsua_wcoss2.intel.lua +++ b/modulefiles/rdbfmsua_wcoss2.intel.lua @@ -31,6 +31,6 @@ load(pathJoin("bacio", bacio_ver)) load(pathJoin("w3emc", w3emc_ver)) load(pathJoin("gempak", gempak_ver)) -setenv("gfortran_ROOT", "//opt/cray/pe/gcc/10.3.0/snos") +setenv("gfortran_ROOT", "/opt/cray/pe/gcc/10.3.0/snos") whatis("Description: GFS utilities environment on WCOSS2 with Intel Compilers") diff --git a/src/rdbfmsua.fd/makefile.hera.intel b/src/rdbfmsua.fd/makefile.hera.intel index c63b2ec1..983584e8 100644 --- a/src/rdbfmsua.fd/makefile.hera.intel +++ b/src/rdbfmsua.fd/makefile.hera.intel @@ -1,7 +1,5 @@ FC = ifort -GFORTRAN=/apps/gcc/6.2.0/lib64 - FFLAGS = -g -traceback -I${GEMPAK}/include -I${OS_INC} LIBS = ${BUFR_LIB4} \ ${GEMLIB}/gemlib.a \ @@ -9,4 +7,4 @@ LIBS = ${BUFR_LIB4} \ ${GEMLIB}/syslib.a \ ${GEMLIB}/cgemlib.a \ ${GEMLIB}/bridge.a \ - -L${GFORTRAN} -lgfortran + -L${gfrortran_ROOT}/lib64 -lgfortran diff --git a/src/rdbfmsua.fd/makefile.wcoss2.intel b/src/rdbfmsua.fd/makefile.wcoss2.intel index 5dc8d88c..4b256cbc 100644 --- a/src/rdbfmsua.fd/makefile.wcoss2.intel +++ b/src/rdbfmsua.fd/makefile.wcoss2.intel @@ -1,9 +1,7 @@ FC = ftn -GFORTRAN=/opt/cray/pe/gcc/10.3.0/snos/lib64/libgfortran.a - FFLAGS = -g -traceback -I${GEMINC} -I${OS_INC} LIBS = ${BUFR_LIB4} \ -L${GEMOLB} -lgemlib -lappl -lsyslib -lcgemlib \ ${GEMOLB}/libbridge.a \ - ${GFORTRAN} + ${gfortran_ROOT}/lib64/libgfortran.a From 192b7d6c3626eb674ceb9fee972d1e77ee55dfa5 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 18 Mar 2024 17:47:31 -0400 Subject: [PATCH 03/11] shellcheck it --- src/rdbfmsua.fd/makefile | 4 ++-- ush/build.sh | 37 +++++++++++++++++++------------------ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/rdbfmsua.fd/makefile b/src/rdbfmsua.fd/makefile index becf382b..a83c0fd4 100644 --- a/src/rdbfmsua.fd/makefile +++ b/src/rdbfmsua.fd/makefile @@ -9,11 +9,11 @@ $(CMD): $(OBJS) $(FC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) clean: - -rm -f ${OBJS} ${CMD} + -rm -f ${OBJS} clobber: clean -rm -f ${CMD} install: - -mv ${CMD} ${PREFIX}/ + -mv ${CMD} ${PREFIX}/bin/ diff --git a/ush/build.sh b/ush/build.sh index 20c5431b..91fc72a4 100755 --- a/ush/build.sh +++ b/ush/build.sh @@ -3,6 +3,7 @@ set -eu # Get the root of the cloned GFS-utils directory +#shellcheck disable=SC2155 readonly DIR_ROOT=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )/.." && pwd -P) # User Options @@ -15,45 +16,45 @@ INSTALL_PREFIX=${INSTALL_PREFIX:-"${DIR_ROOT}/install"} #==============================================================================# # Detect machine (sets MACHINE_ID) -source $DIR_ROOT/ush/detect_machine.sh +source "${DIR_ROOT}/ush/detect_machine.sh" # Load modules -source $DIR_ROOT/ush/module-setup.sh -module use $DIR_ROOT/modulefiles -module load gfsutils_$MACHINE_ID.$COMPILER +source "${DIR_ROOT}/ush/module-setup.sh" +module use "${DIR_ROOT}/modulefiles" +module load "gfsutils_${MACHINE_ID}.${COMPILER}" module list # Collect BUILD Options -CMAKE_OPTS+=" -DCMAKE_BUILD_TYPE=$BUILD_TYPE" +CMAKE_OPTS+=" -DCMAKE_BUILD_TYPE=${BUILD_TYPE}" # Install destination for built executables, libraries, CMake Package config -CMAKE_OPTS+=" -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" +CMAKE_OPTS+=" -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}" # Re-use or create a new BUILD_DIR (Default: create new BUILD_DIR) -[[ ${BUILD_CLEAN:-"YES"} =~ [yYtT] ]] && rm -rf $BUILD_DIR -mkdir -p $BUILD_DIR && cd $BUILD_DIR +[[ ${BUILD_CLEAN:-"YES"} =~ [yYtT] ]] && rm -rf "${BUILD_DIR}" +mkdir -p "${BUILD_DIR}" && cd "${BUILD_DIR}" # Configure, build, install set -x -cmake $CMAKE_OPTS $DIR_ROOT -make -j ${BUILD_JOBS:-8} VERBOSE=${BUILD_VERBOSE:-} +cmake "${CMAKE_OPTS}" "${DIR_ROOT}" +make -j "${BUILD_JOBS:-8}" VERBOSE="${BUILD_VERBOSE:-}" make install set +x -# Build rdbfmsua.x separately due to GEMPAK issues +# Build rdbfmsua.x with makefile separately due to GEMPAK issues in cmake # Load modules -source $DIR_ROOT/ush/module-setup.sh -module use $DIR_ROOT/modulefiles -module load rdbfmsua_$MACHINE_ID.$COMPILER +source "${DIR_ROOT}/ush/module-setup.sh" +module use "${DIR_ROOT}/modulefiles" +module load "rdbfmsua_${MACHINE_ID}.${COMPILER}" module show gempak module list -cd $DIR_ROOT/src/rdbfmsua.fd +cd "${DIR_ROOT}/src/rdbfmsua.fd" export MACHINE_ID export COMPILER -export PREFIX=${INSTALL_PREFIX}/bin +export PREFIX="${INSTALL_PREFIX}" make clean -make VERBOSE=${BUILD_VERBOSE:-} -make install VERBOSE=${BUILD_VERBOSE:-} +make VERBOSE="${BUILD_VERBOSE:-}" +make install VERBOSE="${BUILD_VERBOSE:-}" exit From e6df584abc871ca236649fd47293feedc30a575d Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 18 Mar 2024 17:50:03 -0400 Subject: [PATCH 04/11] remove module show gempak --- ush/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ush/build.sh b/ush/build.sh index 91fc72a4..32837609 100755 --- a/ush/build.sh +++ b/ush/build.sh @@ -46,7 +46,6 @@ set +x source "${DIR_ROOT}/ush/module-setup.sh" module use "${DIR_ROOT}/modulefiles" module load "rdbfmsua_${MACHINE_ID}.${COMPILER}" -module show gempak module list cd "${DIR_ROOT}/src/rdbfmsua.fd" From 6943240bf968b228d8fa76c0906a40d7bdb15f75 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Mon, 18 Mar 2024 17:25:20 -0500 Subject: [PATCH 05/11] Fix cmake command, add Orion for rdbfmsua --- src/rdbfmsua.fd/makefile.orion.intel | 10 ++++++++++ ush/build.sh | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/rdbfmsua.fd/makefile.orion.intel diff --git a/src/rdbfmsua.fd/makefile.orion.intel b/src/rdbfmsua.fd/makefile.orion.intel new file mode 100644 index 00000000..983584e8 --- /dev/null +++ b/src/rdbfmsua.fd/makefile.orion.intel @@ -0,0 +1,10 @@ +FC = ifort + +FFLAGS = -g -traceback -I${GEMPAK}/include -I${OS_INC} +LIBS = ${BUFR_LIB4} \ + ${GEMLIB}/gemlib.a \ + ${GEMLIB}/appl.a \ + ${GEMLIB}/syslib.a \ + ${GEMLIB}/cgemlib.a \ + ${GEMLIB}/bridge.a \ + -L${gfrortran_ROOT}/lib64 -lgfortran diff --git a/ush/build.sh b/ush/build.sh index 32837609..b7bf22fb 100755 --- a/ush/build.sh +++ b/ush/build.sh @@ -1,7 +1,6 @@ #!/bin/bash set -eu - # Get the root of the cloned GFS-utils directory #shellcheck disable=SC2155 readonly DIR_ROOT=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )/.." && pwd -P) @@ -36,7 +35,7 @@ mkdir -p "${BUILD_DIR}" && cd "${BUILD_DIR}" # Configure, build, install set -x -cmake "${CMAKE_OPTS}" "${DIR_ROOT}" +cmake ${CMAKE_OPTS} "${DIR_ROOT}" make -j "${BUILD_JOBS:-8}" VERBOSE="${BUILD_VERBOSE:-}" make install set +x From b343a68af766d686af56653da62f7d5ee4f64a84 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 18 Mar 2024 20:19:14 -0400 Subject: [PATCH 06/11] skip rdbmsua.x if no modulefile --- ush/build.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ush/build.sh b/ush/build.sh index b7bf22fb..ac7f2cc3 100755 --- a/ush/build.sh +++ b/ush/build.sh @@ -42,10 +42,15 @@ set +x # Build rdbfmsua.x with makefile separately due to GEMPAK issues in cmake # Load modules -source "${DIR_ROOT}/ush/module-setup.sh" -module use "${DIR_ROOT}/modulefiles" -module load "rdbfmsua_${MACHINE_ID}.${COMPILER}" -module list +if [[ -f "${DIR_ROOT}/modulefiles/rdbfmsua_${MACHINE_ID}.${COMPILER}" ]]; then + source "${DIR_ROOT}/ush/module-setup.sh" + module use "${DIR_ROOT}/modulefiles" + module load "rdbfmsua_${MACHINE_ID}.${COMPILER}" + module list +else + echo "No modulefile for 'rdbfmsua' on '${MACHINE_ID}'. Skip building 'rdbfmsua.x'" + exit 0 +fi cd "${DIR_ROOT}/src/rdbfmsua.fd" export MACHINE_ID From 7a71132eb63bb8541c8e10d44c84bc3f8c234538 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 18 Mar 2024 20:27:01 -0400 Subject: [PATCH 07/11] update machine makefiles --- src/rdbfmsua.fd/makefile.hera.intel | 1 - src/rdbfmsua.fd/makefile.orion.intel | 1 - src/rdbfmsua.fd/makefile.wcoss2.intel | 1 - 3 files changed, 3 deletions(-) diff --git a/src/rdbfmsua.fd/makefile.hera.intel b/src/rdbfmsua.fd/makefile.hera.intel index 983584e8..c63c8458 100644 --- a/src/rdbfmsua.fd/makefile.hera.intel +++ b/src/rdbfmsua.fd/makefile.hera.intel @@ -1,5 +1,4 @@ FC = ifort - FFLAGS = -g -traceback -I${GEMPAK}/include -I${OS_INC} LIBS = ${BUFR_LIB4} \ ${GEMLIB}/gemlib.a \ diff --git a/src/rdbfmsua.fd/makefile.orion.intel b/src/rdbfmsua.fd/makefile.orion.intel index 983584e8..c63c8458 100644 --- a/src/rdbfmsua.fd/makefile.orion.intel +++ b/src/rdbfmsua.fd/makefile.orion.intel @@ -1,5 +1,4 @@ FC = ifort - FFLAGS = -g -traceback -I${GEMPAK}/include -I${OS_INC} LIBS = ${BUFR_LIB4} \ ${GEMLIB}/gemlib.a \ diff --git a/src/rdbfmsua.fd/makefile.wcoss2.intel b/src/rdbfmsua.fd/makefile.wcoss2.intel index 4b256cbc..ace3e124 100644 --- a/src/rdbfmsua.fd/makefile.wcoss2.intel +++ b/src/rdbfmsua.fd/makefile.wcoss2.intel @@ -1,5 +1,4 @@ FC = ftn - FFLAGS = -g -traceback -I${GEMINC} -I${OS_INC} LIBS = ${BUFR_LIB4} \ -L${GEMOLB} -lgemlib -lappl -lsyslib -lcgemlib \ From 3ab4a796dc3b33f8fc96b95938e1d58964819eb1 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Tue, 19 Mar 2024 15:17:47 -0500 Subject: [PATCH 08/11] Fix detection of rdbfsmua modulefile Build script was checking for the existance of a modulefile for rdbfmsua, but did not include the '.lua' that exists in the filename. Changed the detection to instead try to load the file and detect when there is an error. --- ush/build.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ush/build.sh b/ush/build.sh index ac7f2cc3..ede4ebe9 100755 --- a/ush/build.sh +++ b/ush/build.sh @@ -35,6 +35,7 @@ mkdir -p "${BUILD_DIR}" && cd "${BUILD_DIR}" # Configure, build, install set -x +# shellcheck disable=SC2086 cmake ${CMAKE_OPTS} "${DIR_ROOT}" make -j "${BUILD_JOBS:-8}" VERBOSE="${BUILD_VERBOSE:-}" make install @@ -42,13 +43,13 @@ set +x # Build rdbfmsua.x with makefile separately due to GEMPAK issues in cmake # Load modules -if [[ -f "${DIR_ROOT}/modulefiles/rdbfmsua_${MACHINE_ID}.${COMPILER}" ]]; then - source "${DIR_ROOT}/ush/module-setup.sh" - module use "${DIR_ROOT}/modulefiles" - module load "rdbfmsua_${MACHINE_ID}.${COMPILER}" +source "${DIR_ROOT}/ush/module-setup.sh" +module use "${DIR_ROOT}/modulefiles" +if module load "rdbfmsua_${MACHINE_ID}.${COMPILER}" &> /dev/null; then module list else - echo "No modulefile for 'rdbfmsua' on '${MACHINE_ID}'. Skip building 'rdbfmsua.x'" + echo "WARNING: Unable to load modelfile for 'rdbfmsua' on '${MACHINE_ID}' (does it exist?)." + echo " Skipping building 'rdbfmsua.x'" exit 0 fi From 149e5180cf5fa351eef42c8b77bfe7271279f10d Mon Sep 17 00:00:00 2001 From: Walter Kolczynski Date: Tue, 19 Mar 2024 20:23:32 +0000 Subject: [PATCH 09/11] Remove unneeded modules on WCOSS --- modulefiles/rdbfmsua_wcoss2.intel.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modulefiles/rdbfmsua_wcoss2.intel.lua b/modulefiles/rdbfmsua_wcoss2.intel.lua index fa6ab142..40a9c564 100644 --- a/modulefiles/rdbfmsua_wcoss2.intel.lua +++ b/modulefiles/rdbfmsua_wcoss2.intel.lua @@ -22,10 +22,6 @@ load(pathJoin("intel", intel_ver)) load(pathJoin("craype", craype_ver)) load(pathJoin("cray-mpich", cray_mpich_ver)) -load(pathJoin("jasper", jasper_ver)) -load(pathJoin("zlib", zlib_ver)) -load(pathJoin("libpng", libpng_ver)) - load(pathJoin("bufr", bufr_ver)) load(pathJoin("bacio", bacio_ver)) load(pathJoin("w3emc", w3emc_ver)) From 57492f2805e7c4275bf216b0fd321bccc99a22e1 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Tue, 19 Mar 2024 16:29:32 -0400 Subject: [PATCH 10/11] Update modulefiles/rdbfmsua_wcoss2.intel.lua --- modulefiles/rdbfmsua_wcoss2.intel.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modulefiles/rdbfmsua_wcoss2.intel.lua b/modulefiles/rdbfmsua_wcoss2.intel.lua index 40a9c564..5f44a62c 100644 --- a/modulefiles/rdbfmsua_wcoss2.intel.lua +++ b/modulefiles/rdbfmsua_wcoss2.intel.lua @@ -7,10 +7,6 @@ local intel_ver=os.getenv("intel_ver") or "19.1.3.304" local craype_ver=os.getenv("craype_ver") or "2.7.10" local cray_mpich_ver=os.getenv("cray_mpich_ver") or "8.1.9" -local jasper_ver=os.getenv("jasper_ver") or "2.0.25" -local zlib_ver=os.getenv("zlib_ver") or "1.2.11" -local libpng_ver=os.getenv("libpng_ver") or "1.6.37" -local netcdf_ver=os.getenv("netcdf_ver") or "4.7.4" local bufr_ver=os.getenv("bufr_ver") or "11.7.0" local bacio_ver=os.getenv("bacio_ver") or "2.4.1" From 4f7ab89b48e1fc690dfbe541519bb4a131d20d75 Mon Sep 17 00:00:00 2001 From: Walter Kolczynski Date: Tue, 19 Mar 2024 21:22:07 +0000 Subject: [PATCH 11/11] Remove unneeded mpich module --- modulefiles/rdbfmsua_wcoss2.intel.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/modulefiles/rdbfmsua_wcoss2.intel.lua b/modulefiles/rdbfmsua_wcoss2.intel.lua index 5f44a62c..43e7d204 100644 --- a/modulefiles/rdbfmsua_wcoss2.intel.lua +++ b/modulefiles/rdbfmsua_wcoss2.intel.lua @@ -5,8 +5,6 @@ Build environment for GFS utilities on WCOSS2 local PrgEnv_intel_ver=os.getenv("PrgEnv_intel_ver") or "8.1.0" local intel_ver=os.getenv("intel_ver") or "19.1.3.304" local craype_ver=os.getenv("craype_ver") or "2.7.10" -local cray_mpich_ver=os.getenv("cray_mpich_ver") or "8.1.9" - local bufr_ver=os.getenv("bufr_ver") or "11.7.0" local bacio_ver=os.getenv("bacio_ver") or "2.4.1" @@ -16,7 +14,6 @@ local gempak_ver=os.getenv("gempak_ver") or "7.14.1" load(pathJoin("PrgEnv-intel", PrgEnv_intel_ver)) load(pathJoin("intel", intel_ver)) load(pathJoin("craype", craype_ver)) -load(pathJoin("cray-mpich", cray_mpich_ver)) load(pathJoin("bufr", bufr_ver)) load(pathJoin("bacio", bacio_ver))