Skip to content

Commit

Permalink
Add ability to compile script to use non-intel compilers; add Cheyenn…
Browse files Browse the repository at this point in the history
…e modulefiles for gnu and intel (#468)

* Add cheyenne modulefile

* Intel 19 --> 2021

* Add ability to specify compiler; move all existing modulefiles to ${name}_intel since they are all for intel compilers; add "cheyenne_gnu" modulefile

* Revert move of intel modulefiles; now the implicit default for a modulefile is intel, only gnu and other compilers will have the compiler name appended to the modulefile

* Allow for lua modulefiles with ".lua" appended
  • Loading branch information
mkavulich committed Mar 31, 2022
1 parent 5bdb289 commit af62bd2
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 7 deletions.
40 changes: 40 additions & 0 deletions modulefiles/cheyenne
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#%Module#

proc ModulesHelp { } {
puts stderr "Loads modules required for building upp"
}
module-whatis "Loads UPP prerequisites on Cheyenne for Intel 2021.2"

module purge

module load cmake/3.18.2
module load ncarenv/1.3
module load intel/2021.2
module load mpt/2.22
module load ncarcompilers/0.5.0
module unload netcdf

module use /glade/p/ral/jntp/GMTB/tools/hpc-stack-v1.2.0/modulefiles/stack
module load hpc/1.2.0
module load hpc-intel/2021.2
module load hpc-mpt/2.22

module load jasper/2.0.25
module load zlib/1.2.11
module load png/1.6.35

module load hdf5/1.10.6
module load netcdf/4.7.4

module load bacio/2.4.1
module load crtm/2.3.0
module load g2/3.4.2
module load g2tmpl/1.10.0
module load ip/3.3.3
module load nemsio/2.5.2
module load sfcio/1.4.1
module load sigio/2.3.2
module load sp/2.3.3
module load w3nco/2.4.1
module load w3emc/2.7.3
module load wrf_io/1.2.0
41 changes: 41 additions & 0 deletions modulefiles/cheyenne_gnu
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#%Module#

proc ModulesHelp { } {
puts stderr "Loads modules required for building upp"
}
module-whatis "Loads UPP prerequisites on Cheyenne for Intel 2021.2"

module purge

module load cmake/3.18.2
module load ncarenv/1.3
module load gnu/10.1.0
module load mpt/2.22
module load ncarcompilers/0.5.0
module load python/3.7.9
module unload netcdf

module use /glade/p/ral/jntp/GMTB/tools/hpc-stack-v1.2.0/modulefiles/stack
module load hpc/1.2.0
module load hpc-gnu/10.1.0
module load hpc-mpt/2.22

module load jasper/2.0.25
module load zlib/1.2.11
module load png/1.6.35

module load hdf5/1.10.6
module load netcdf/4.7.4

module load bacio/2.4.1
module load crtm/2.3.0
module load g2/3.4.2
module load g2tmpl/1.10.0
module load ip/3.3.3
module load nemsio/2.5.2
module load sfcio/1.4.1
module load sigio/2.3.2
module load sp/2.3.3
module load w3nco/2.4.1
module load w3emc/2.7.3
module load wrf_io/1.2.0
28 changes: 21 additions & 7 deletions tests/compile_upp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ set -eu

usage() {
echo
echo "Usage: $0 [-g] [-w] -h"
echo "Usage: $0 [-p] [-g] [-w] [-v] [-c] -h"
echo
echo " -p installation prefix <prefix> DEFAULT: ../install"
echo " -g Build with GTG(users with gtg repos. access only) DEFAULT: OFF"
echo " -w Build without WRF-IO DEFAULT: ON"
echo " -v Build with cmake verbose DEFAULT: NO"
echo " -g build with GTG(users with gtg repos. access only) DEFAULT: OFF"
echo " -w build without WRF-IO DEFAULT: ON"
echo " -v build with cmake verbose DEFAULT: NO"
echo " -c Compiler to use for build DEFAULT: intel"
echo " -h display this message and quit"
echo
exit 1
Expand All @@ -21,8 +22,9 @@ usage() {
prefix="../install"
gtg_opt=" -DBUILD_WITH_GTG=OFF"
wrfio_opt=" -DBUILD_WITH_WRFIO=ON"
compiler="intel"
verbose_opt=""
while getopts ":p:gwvh" opt; do
while getopts ":p:gwc:vh" opt; do
case $opt in
p)
prefix=$OPTARG
Expand All @@ -33,6 +35,9 @@ while getopts ":p:gwvh" opt; do
w)
wrfio_opt=" -DBUILD_WITH_WRFIO=OFF"
;;
c)
compiler=$OPTARG
;;
v)
verbose_opt="VERBOSE=1"
;;
Expand All @@ -43,7 +48,6 @@ while getopts ":p:gwvh" opt; do
done
cmake_opts=" -DCMAKE_INSTALL_PREFIX=$prefix"${wrfio_opt}${gtg_opt}

hostname
source ./detect_machine.sh
if [[ $(uname -s) == Darwin ]]; then
readonly MYDIR=$(cd "$(dirname "$(greadlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P)
Expand All @@ -60,7 +64,17 @@ if [[ $MACHINE_ID != "unknown" ]]; then
module purge
fi
module use $PATHTR/modulefiles
modulefile=${MACHINE_ID}
if [[ $compiler == "intel" ]]; then
modulefile=${MACHINE_ID}
else
modulefile=${MACHINE_ID}_${compiler}
fi
if [ -f "${PATHTR}/modulefiles/${modulefile}" -o -f "${PATHTR}/modulefiles/${modulefile}.lua" ]; then
echo "Building for machine ${MACHINE_ID}, compiler ${compiler}"
else
echo "Modulefile does not exist for machine ${MACHINE_ID}, compiler ${compiler}"
exit 1
fi
module load $modulefile
module list
fi
Expand Down

0 comments on commit af62bd2

Please sign in to comment.