Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use spack-stack modulefiles #56

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Check environment
cmake_minimum_required(VERSION 3.5)

# Set the project name and version
# set the project name and version
bbakernoaa marked this conversation as resolved.
Show resolved Hide resolved
project(NEXUS
VERSION 0.2.0
LANGUAGES Fortran)

# set compiler
if(NOT DEFINED ENV{FC})
message(FATAL_ERROR "CMAKE_Fortran_COMPILER is not defined")
endif()
bbakernoaa marked this conversation as resolved.
Show resolved Hide resolved

# Include local macros
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

Expand Down
30 changes: 0 additions & 30 deletions modulefiles/hera.intel

This file was deleted.

32 changes: 0 additions & 32 deletions modulefiles/orion.intel

This file was deleted.

32 changes: 32 additions & 0 deletions modulefiles/ufs_common.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
whatis("Description: UFS build environment common libraries")

help([[Load UFS Model common libraries]])

local ufs_modules = {
{["jasper"] = "2.0.32"},
{["zlib"] = "1.2.13"},
{["libpng"] = "1.6.37"},
{["hdf5"] = "1.14.0"},
{["netcdf-c"] = "4.9.2"},
{["netcdf-fortran"] = "4.6.1"},
{["parallelio"] = "2.5.10"},
{["esmf"] = "8.6.0"},
{["fms"] = "2024.01"},
{["bacio"] = "2.4.1"},
{["crtm"] = "2.4.0"},
{["g2"] = "3.5.1"},
{["g2tmpl"] = "1.13.0"},
{["ip"] = "4.3.0"},
{["sp"] = "2.5.0"},
{["w3emc"] = "2.10.0"},
{["gftl-shared"] = "1.6.1"},
{["mapl"] = "2.40.3-esmf-8.6.0"},
{["scotch"] = "7.0.4"},
bbakernoaa marked this conversation as resolved.
Show resolved Hide resolved
}

for i = 1, #ufs_modules do
for name, default_version in pairs(ufs_modules[i]) do
local env_version_name = string.gsub(name, "-", "_") .. "_ver"
load(pathJoin(name, os.getenv(env_version_name) or default_version))
end
end
30 changes: 30 additions & 0 deletions modulefiles/ufs_derecho.intel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
help([[
loads UFS Model prerequisites for NOAA Parallelworks/Intel
]])

setenv("LMOD_TMOD_FIND_FIRST","yes")
prepend_path("MODULEPATH", "/glade/work/epicufsrt/contrib/spack-stack/derecho/modulefiles")
load("ecflow/5.8.4")
load("mysql/8.0.33")

setenv("LMOD_TMOD_FIND_FIRST","yes")
prepend_path("MODULEPATH", "/lustre/desc1/scratch/epicufsrt/contrib/modulefiles_extra")
prepend_path("MODULEPATH", "/glade/work/epicufsrt/contrib/spack-stack/derecho/spack-stack-1.6.0/envs/fms-2024.01/install/modulefiles/Core")

unload("ncarcompilers")
stack_intel_ver=os.getenv("stack_intel_ver") or "2021.10.0"
load(pathJoin("stack-intel", stack_intel_ver))

stack_cray_mpich_ver=os.getenv("stack-cray-mpich_ver") or "8.1.25"
load(pathJoin("stack-cray-mpich", stack_cray_mpich_ver))

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

stack_python_ver=os.getenv("stack_python_ver") or "3.10.13"
load(pathJoin("stack-python", stack_python_ver))

setenv("CMAKE_Platform", "derecho.intel")
load("ufs-weather-model-env")

whatis("Description: UFS build environment")
33 changes: 33 additions & 0 deletions modulefiles/ufs_gaea.intel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
help([[
This module loads libraries required for building and running UFS Weather Model
on the NOAA RDHPC machine Gaea C5 using Intel-2023.1.0.
]])

whatis([===[Loads libraries needed for building the UFS Weather Model on Gaea ]===])

prepend_path("MODULEPATH", "/ncrc/proj/epic/spack-stack/spack-stack-1.6.0/envs/fms-2024.01/install/modulefiles/Core")

stack_intel_ver=os.getenv("stack_intel_ver") or "2023.1.0"
bbakernoaa marked this conversation as resolved.
Show resolved Hide resolved
load(pathJoin("stack-intel", stack_intel_ver))

stack_cray_mpich_ver=os.getenv("stack_cray_mpich_ver") or "8.1.25"
bbakernoaa marked this conversation as resolved.
Show resolved Hide resolved
load(pathJoin("stack-cray-mpich", stack_cray_mpich_ver))

stack_python_ver=os.getenv("stack_python_ver") or "3.10.13"
load(pathJoin("stack-python", stack_python_ver))

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

load("ufs_common")

nccmp_ver=os.getenv("nccmp_ver") or "1.9.0.1"
load(pathJoin("nccmp", nccmp_ver))

unload("darshan-runtime")
unload("cray-libsci")

setenv("CC","cc")
setenv("CXX","CC")
setenv("FC","ftn")
setenv("CMAKE_Platform","gaea.intel")
26 changes: 26 additions & 0 deletions modulefiles/ufs_hera.intel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
help([[
loads UFS Model prerequisites for Hera/Intel
]])

prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/fms-2024.01/install/modulefiles/Core")

stack_intel_ver=os.getenv("stack_intel_ver") or "2021.5.0"
load(pathJoin("stack-intel", stack_intel_ver))

stack_impi_ver=os.getenv("stack_impi_ver") or "2021.5.1"
load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver))

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

load("ufs_common")

nccmp_ver=os.getenv("nccmp_ver") or "1.9.0.1"
load(pathJoin("nccmp", nccmp_ver))

setenv("CC", "mpiicc")
setenv("CXX", "mpiicpc")
setenv("FC", "mpiifort")
setenv("CMAKE_Platform", "hera.intel")

whatis("Description: UFS build environment")
33 changes: 33 additions & 0 deletions modulefiles/ufs_hera.intelllvm.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
help([[
loads UFS Model prerequisites for Hera/IntelLLVM
]])

prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/upp-addon-env/install/modulefiles/Core")

stack_intel_ver=os.getenv("stack_intel_ver") or "2021.5.0"
load(pathJoin("stack-intel", stack_intel_ver))

stack_impi_ver=os.getenv("stack_impi_ver") or "2021.5.1"
load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver))

load("gnu")
load("intel/2023.2.0")

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

load("ufs_common")

nccmp_ver=os.getenv("nccmp_ver") or "1.9.0.1"
load(pathJoin("nccmp", nccmp_ver))

setenv("I_MPI_CC", "icx")
setenv("I_MPI_CXX", "icpx")
setenv("I_MPI_FC", "ifx")

setenv("CC", "mpicc")
setenv("CXX", "mpiicpc")
setenv("FC", "mpifc")
setenv("CMAKE_Platform", "hera.intel")

whatis("Description: UFS build environment")
26 changes: 26 additions & 0 deletions modulefiles/ufs_hercules.intel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
help([[
loads UFS Model prerequisites for Hercules/Intel
]])

prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.6.0/envs/fms-2024.01/install/modulefiles/Core")

stack_intel_ver=os.getenv("stack_intel_ver") or "2021.9.0"
load(pathJoin("stack-intel", stack_intel_ver))

stack_impi_ver=os.getenv("stack_impi_ver") or "2021.9.0"
load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver))

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

load("ufs_common")

nccmp_ver=os.getenv("nccmp_ver") or "1.9.0.1"
load(pathJoin("nccmp", nccmp_ver))

setenv("CC", "mpiicc")
setenv("CXX", "mpiicpc")
setenv("FC", "mpiifort")
setenv("CMAKE_Platform", "hercules.intel")

whatis("Description: UFS build environment")
30 changes: 30 additions & 0 deletions modulefiles/ufs_hercules.intelllvm.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
help([[
loads UFS Model prerequisites for Hercules/IntelLLVM
]])

prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.6.0/envs/upp-addon-env/install/modulefiles/Core")

stack_intel_ver=os.getenv("stack_intel_ver") or "2021.9.0"
load(pathJoin("stack-intel", stack_intel_ver))

stack_impi_ver=os.getenv("stack_impi_ver") or "2021.9.0"
load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver))

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

load("ufs_common")

nccmp_ver=os.getenv("nccmp_ver") or "1.9.0.1"
load(pathJoin("nccmp", nccmp_ver))

setenv("I_MPI_CC", "icx")
setenv("I_MPI_CXX", "icpx")
setenv("I_MPI_F90", "ifx")

setenv("CC", "mpiicc")
setenv("CXX", "mpiicpc")
setenv("FC", "mpiifort")
setenv("CMAKE_Platform", "hercules.intel")

whatis("Description: UFS build environment")
37 changes: 37 additions & 0 deletions modulefiles/ufs_linux.gnu
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

#%Module######################################################################
##
## UFS prerequisites: Linux (tested: Ubuntu) with gcc/gfortran compilers

echo "Setting environment variables for UFS Model on Linux with gcc/gfortran"

##
## load programming environment: compiler, flags, paths
##
export CC=${CC:-mpicc}
export CXX=${CXX:-mpicxx}
export F77=${F77:-mpif77}
export F90=${F90:-mpif90}
export FC=${FC:-mpif90}

##
## set up variables for ../cmake/configure_linux.gnu.cmake
##
export CMAKE_Platform=linux.gnu

##
## use own NetCDF library
##
export NETCDF=${NETCDF:-/home/builder/opt}

##
## use pre-compiled EMSF library for above compiler / MPI combination
##
export ESMFMKFILE=${ESMFMKFILE:-/home/builder/opt/lib/esmf.mk}

##
## NCEP libraries (need to download and build manually, see doc/README_{UBUNTU,CENTOS,...}.txt and https://github.com/NCAR/NCEPlibs)
##
export NCEPLIBS_DIR=${NCEPLIBS_DIR:-/home/builder/opt}
export CMAKE_PREFIX_PATH=${NCEPLIBS_DIR}
37 changes: 37 additions & 0 deletions modulefiles/ufs_linux.intel
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

#%Module######################################################################
##
## UFS prerequisites: Linux (tested: Ubuntu) with gcc/gfortran compilers

echo "Setting environment variables for UFS Model on Linux with gcc/gfortran"

##
## load programming environment: compiler, flags, paths
##
export CC=${CC:-mpicc}
export CXX=${CXX:-mpicxx}
export F77=${F77:-mpif77}
export F90=${F90:-mpif90}
export FC=${FC:-mpif90}

##
## set up variables for ../cmake/configure_linux.intel.cmake
##
export CMAKE_Platform=linux.intel

##
## use own NetCDF library
##
export NETCDF=${NETCDF:-/home/builder/opt}

##
## use pre-compiled EMSF library for above compiler / MPI combination
##
export ESMFMKFILE=${ESMFMKFILE:-/home/builder/opt/lib/esmf.mk}

##
## NCEP libraries (need to download and build manually, see doc/README_{UBUNTU,CENTOS,...}.txt and https://github.com/NCAR/NCEPlibs)
##
export NCEPLIBS_DIR=${NCEPLIBS_DIR:-/home/builder/opt}
export CMAKE_PREFIX_PATH=${NCEPLIBS_DIR}
Loading