Skip to content

Building GEOSgcm with spack‐stack

Matt Thompson edited this page Jun 20, 2024 · 2 revisions

At the moment, only GEOSgcm v11.6.0 and higher will build with spack-stack v1.7. NOTE: This is preliminary and might change and there is no guarantee the model runs, etc. as testing is ongoing.

Loading spack-stack

These instructions are taken from the spack-stack documentation and duplicated here for convenience.

SLES 12

First, set up spack-stack for SLES 12:

module purge
module use /discover/swdev/gmao_SIteam/modulefiles-SLES12
module use /discover/swdev/jcsda/spack-stack/scu16/modulefiles
module load miniconda/3.9.7
module load ecflow/5.8.4

Intel

For spack-stack-1.7.0 with Intel, proceed with loading the following modules:

module use /gpfsm/dswdev/jcsda/spack-stack/scu16/spack-stack-1.7.0/envs/ue-intel-2021.6.0/install/modulefiles/Core
module load stack-intel/2021.6.0
module load stack-intel-oneapi-mpi/2021.6.0
module load stack-python/3.10.13

GNU

For spack-stack-1.7.0 with GNU, proceed with loading the following modules:

module use /gpfsm/dswdev/jcsda/spack-stack/scu16/spack-stack-1.7.0/envs/ue-gcc-12.1.0/install/modulefiles/Core
module load stack-gcc/12.1.0
module load stack-openmpi/4.1.3
module load stack-python/3.10.13

SLES 15

For using spack-stack on SLES 15, first:

module purge
module use /discover/swdev/gmao_SIteam/modulefiles-SLES15
module use /discover/swdev/jcsda/spack-stack/scu17/modulefiles
module load ecflow/5.11.4

Intel

For spack-stack-1.7.0 with Intel, load the following modules after loading ecflow:

module use /gpfsm/dswdev/jcsda/spack-stack/scu17/spack-stack-1.7.0/envs/ue-intel-2021.10.0/install/modulefiles/Core
module load stack-intel/2021.10.0
module load stack-intel-oneapi-mpi/2021.10.0
module load stack-python/3.10.13

GNU

For spack-stack-1.7.0 with GNU, load the following modules after loading ecflow:

module use /gpfsm/dswdev/jcsda/spack-stack/scu17/spack-stack-1.7.0/envs/ue-gcc-12.3.0/install/modulefiles/Core
module load stack-gcc/12.3.0
module load stack-openmpi/4.1.6
module load stack-python/3.10.13

Load modules for building

Next, load the modules needed to build GEOSgcm:

module load esmf python py-pyyaml py-numpy pflogger fargparse zlib-ng cmake mepo

Clone GEOSgcm

If you haven't already, clone GEOSgcm:

mepo clone [email protected]:GEOS-ESM/GEOSgcm.git

Obviously, you can add a tag if you prefer (mepo clone -b v11.6.0 ...)

Build GEOSgcm

Building GEOSgcm is now a simple two-step CMake process

cmake -B build -S . --install-prefix=$(pwd)/install -DCMAKE_BUILD_TYPE=Release
cmake --build build --target install -j 10

Of course, you can change the build and install paths as wanted, and you can change the build type as well.

NOTE: Do NOT use -j 10 on a head node, only on a compute node. For a head node, you should limit to -j 2.