Skip to content

Commit

Permalink
Updates to compile on wcoss2.
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGayno-NOAA committed Aug 3, 2022
1 parent 223f9c3 commit a531c85
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 56 deletions.
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,3 @@ endif()

add_subdirectory(sorc)

# Run unit tests.
include(CTest)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()

24 changes: 18 additions & 6 deletions build_all.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#! /usr/bin/env bash
#
# This build script is only used on NOAA WCOSS systems. All other
# users should set module files as needed, and build directly with
# CMake.
# This build script is only used on officially supported machines. All other
# users should set module files as needed, and build directly with CMake.
#
# George Gayno

Expand All @@ -15,7 +14,7 @@ export MOD_PATH
if [[ "$target" == "linux.*" || "$target" == "macosx.*" ]]; then
unset -f module
set +x
source ./modulefiles/build.$target > /dev/null
source ./modulefiles/build.$target > /dev/null
set -x
else
set +x
Expand All @@ -26,8 +25,18 @@ else
set -x
fi

CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DEMC_EXEC_DIR=ON"
#CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DEMC_EXEC_DIR=ON -DENABLE_DOCS=ON"
# The unit test data download is part of the build system. Not all machines can
# access the EMC ftp site, so turn off the build (-DBUILD_TESTING=OFF) of the units tests accordingly.
# Those with access to the EMC ftp site are: Orion and Hera.

if [[ "$target" == "hera" || "$target" == "orion" || "$target" == "wcoss2" ]]; then
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DEMC_EXEC_DIR=ON -DBUILD_TESTING=OFF"
#CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DEMC_EXEC_DIR=ON -DBUILD_TESTING=ON"
#CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DEMC_EXEC_DIR=ON -DENABLE_DOCS=ON -DBUILD_TESTING=ON"
else
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DEMC_EXEC_DIR=ON -DBUILD_TESTING=OFF"
#CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DEMC_EXEC_DIR=ON -DENABLE_DOCS=ON -DBUILD_TESTING=OFF"
fi

rm -fr ./build
mkdir ./build && cd ./build
Expand All @@ -37,4 +46,7 @@ cmake .. ${CMAKE_FLAGS}
make -j 8 VERBOSE=1
make install

#make test
#ctest -I 4,5

exit
82 changes: 82 additions & 0 deletions modulefiles/build.wcoss2.intel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
help([[
Load environment to compile UFS_UTILS on WCOSS2
]])

cmake_ver=os.getenv("cmake_ver") or "3.20.2"
load(pathJoin("cmake", cmake_ver))

PrgEnv_intel_ver=os.getenv("PrgEnv_intel_ver") or "8.1.0"
load(pathJoin("PrgEnv-intel", PrgEnv_intel_ver))

craype_ver=os.getenv("craype_ver") or "2.7.13"
load(pathJoin("craype", craype_ver))

intel_ver=os.getenv("intel_ver") or "19.1.3.304"
load(pathJoin("intel", intel_ver))

cray_mpich_ver=os.getenv("cray_mpich_ver") or "8.1.7"
load(pathJoin("cray-mpich", cray_mpich_ver))


libjpeg_ver=os.getenv("libjpeg_ver") or "9c"
load(pathJoin("libjpeg", libjpeg_ver))

zlib_ver=os.getenv("zlib_ver") or "1.2.11"
load(pathJoin("zlib", zlib_ver))

libpng_ver=os.getenv("libpng_ver") or "1.6.37"
load(pathJoin("libpng", libpng_ver))

hdf5_ver=os.getenv("hdf5_ver") or "1.10.6"
load(pathJoin("hdf5", hdf5_ver))

netcdf_ver=os.getenv("netcdf_ver") or "4.7.4"
load(pathJoin("netcdf", netcdf_ver))

bacio_ver=os.getenv("bacio_ver") or "2.4.1"
load(pathJoin("bacio", bacio_ver))

sfcio_ver=os.getenv("sfcio_ver") or "1.4.1"
load(pathJoin("sfcio", sfcio_ver))

w3nco_ver=os.getenv("w3nco_ver") or "2.4.1"
load(pathJoin("w3nco", w3nco_ver))

nemsio_ver=os.getenv("nemsio_ver") or "2.5.2"
load(pathJoin("nemsio", nemsio_ver))

sigio_ver=os.getenv("sigio_ver") or "2.3.2"
load(pathJoin("sigio", sigio_ver))

sp_ver=os.getenv("sp_ver") or "2.3.3"
load(pathJoin("sp", sp_ver))

ip_ver=os.getenv("ip_ver") or "3.3.3"
load(pathJoin("ip", ip_ver))

g2_ver=os.getenv("g2_ver") or "3.4.5"
load(pathJoin("g2", g2_ver))

wgrib2_ver=os.getenv("wgrib2_ver") or "2.0.8"
load(pathJoin("wgrib2", wgrib2_ver))

-- for mpiexec command
cray_pals_ver=os.getenv("cray_pals_ver") or "1.0.12"
load(pathJoin("cray-pals", cray_pals_ver))

udunits_ver=os.getenv("udunits_ver") or "2.2.28"
load(pathJoin("udunits", udunits_ver))

gsl_ver=os.getenv("gsl_ver") or "2.7"
load(pathJoin("gsl", gsl_ver))

nco_ver=os.getenv("nco_ver") or "4.9.7"
load(pathJoin("nco", nco_ver))

setenv("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")
esmf_ver=os.getenv("esmf_ver") or "8.2.1b04"
load(pathJoin("esmf", esmf_ver))

whatis("Description: UFS_UTILS build environment")
3 changes: 1 addition & 2 deletions sorc/chgres_cube.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ target_link_libraries(
sp::sp_d
w3nco::w3nco_d
esmf
wgrib2::wgrib2_lib
wgrib2::wgrib2_api
wgrib2::wgrib2
MPI::MPI_Fortran
NetCDF::NetCDF_Fortran)

Expand Down
45 changes: 3 additions & 42 deletions sorc/machine-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ if [[ -d /lfs3 ]] ; then
fi
target=jet
module purge
elif [[ -d /lfs/h1 ]] ; then
target=wcoss2
module reset
elif [[ -d /scratch1 ]] ; then
# We are on NOAA Hera
if ( ! eval module help > /dev/null 2>&1 ) ; then
Expand All @@ -35,48 +38,6 @@ elif [[ -d /scratch1 ]] ; then
fi
target=hera
module purge
elif [[ -d /gpfs/hps && -e /etc/SuSE-release ]] ; then
# We are on NOAA Luna or Surge
if ( ! eval module help > /dev/null 2>&1 ) ; then
echo load the module command 1>&2
source /opt/modules/default/init/$__ms_shell
fi
target=wcoss_cray

# Silence the "module purge" to avoid the expected error messages
# related to modules that load modules.
module purge > /dev/null 2>&1
module use /usrx/local/prod/modulefiles
module use /gpfs/hps/nco/ops/nwprod/lib/modulefiles
module use /gpfs/hps/nco/ops/nwprod/modulefiles
module use /opt/cray/alt-modulefiles
module use /opt/cray/craype/default/alt-modulefiles
module use /opt/cray/ari/modulefiles
module use /opt/modulefiles
module purge > /dev/null 2>&1

# Workaround until module issues are fixed:
#unset _LMFILES_
#unset LOADEDMODULES
echo y 2> /dev/null | module clear > /dev/null 2>&1

module use /usrx/local/prod/modulefiles
module use /gpfs/hps/nco/ops/nwprod/lib/modulefiles
module use /gpfs/hps/nco/ops/nwprod/modulefiles
module use /opt/cray/alt-modulefiles
module use /opt/cray/craype/default/alt-modulefiles
module use /opt/cray/ari/modulefiles
module use /opt/modulefiles
module load modules

elif [[ -L /usrx && "$( readlink /usrx 2> /dev/null )" =~ dell ]] ; then
# We are on NOAA Venus or Mars
if ( ! eval module help > /dev/null 2>&1 ) ; then
echo load the module command 1>&2
source /usrx/local/prod/lmod/lmod/init/$__ms_shell
fi
target=wcoss_dell_p3
module purge
elif [[ -d /glade ]] ; then
# We are on NCAR Cheyenne
if ( ! eval module help > /dev/null 2>&1 ) ; then
Expand Down

0 comments on commit a531c85

Please sign in to comment.