Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
99 changes: 99 additions & 0 deletions .ci/tests/buildCMake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#!/bin/sh
help()
{
echo "./buildCMake.sh as_host workingdir [options] [-- <hostenv.sh options>]"
echo " as_host First argument must be the host configuration to use for environment loading"
echo " workingdir Second argument must be the working dir to immediate cd to"
echo " -c Configuration build type, piped directly into configure"
echo " -b Build command passed into compile"
echo " -r Clean command passed into cleanCmake"
echo " -e environment variables in comma-delimited list, e.g. var=1,foo,bar=0"
echo " -- <hostenv.sh options> Directly pass options to hostenv.sh, equivalent to hostenv.sh <options>"
echo " -h Print this message"
echo ""
echo "If you wish to use an env var in your arg such as '-c \$PRESELECT -e PRESELECT=GNU',"
echo "you will need to do '-c \\\$PRESELECT -e PRESELECT=32' to delay shell expansion"
}


echo "Input arguments:"
echo "$*"

AS_HOST=$1
shift
if [ $AS_HOST = "-h" ]; then
help
exit 0
fi

workingDirectory=$1
shift

cd $workingDirectory

# Get some helper functions
. .ci/env/helpers.sh

while getopts c:b:r:e:h opt; do
case $opt in
c)
configuration="$OPTARG"
;;
b)
buildCommand="$OPTARG"
;;
r)
cleanCommand="$OPTARG"
;;
e)
envVars="$envVars,$OPTARG"
;;
h) help; exit 0 ;;
*) help; exit 1 ;;
:) help; exit 1 ;;
\?) help; exit 1 ;;
esac
done

shift "$((OPTIND - 1))"

# Everything else goes to our env setup
. .ci/env/hostenv.sh $*

# Now evaluate env vars in case it pulls from hostenv.sh
if [ ! -z "$envVars" ]; then
setenvStr "$envVars"
fi

# Re-evaluate input values for delayed expansion
eval "cleanCommand=\"$cleanCommand\""
eval "configuration=\"$configuration\""
eval "buildCommand=\"$buildCommand\""

echo "./cleanCMake.sh -a $cleanCommand"
./cleanCMake.sh -a $cleanCommand
echo "Clean done"

echo "./configure_new $configuration"
./configure_new $configuration
result=$?
echo "Configure done"

if [ $result -ne 0 ]; then
echo "Failed to configure, command returned non-zero exit status"
exit 1
fi

echo "./compile_new $buildCommand"
./compile_new $buildCommand
result=$?
echo "Compile done"



if [ $result -ne 0 ]; then
echo "Failed to compile, command returned non-zero exit status"
exit 1
fi

echo "TEST $(basename $0) PASS"
101 changes: 101 additions & 0 deletions .ci/wrf_compilation_tests-cmake.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"submit_options" :
{
"timelimit" : "00:20:00",
"working_directory" : "..",
"arguments" :
{
"base_env_numprocs" : [ "-e", "NUM_PROCS=8" ],

".*cmake.*::base_env_dirs" : [ "-e", "WK_DIR=$PWD,BUILD_DIR=_build_$NAME$DM$SM,INSTALL_DIR=$WK_DIR/install_$NAME$DM$SM" ],
".*cmake.*.::args_compilecmd" : [ "-c", "-p $NAME -d $BUILD_DIR -i $INSTALL_DIR -x -- -DCMAKE_BUILD_TYPE=Release -DWRF_CORE=ARW -DWRF_NESTING=BASIC -DWRF_CASE=EM_REAL $USE_MPI $USE_OPENMP" ],
".*cmake.*.::args_buildcmd" : [ "-b", "$BUILD_DIR -j $NUM_PROCS" ],
".*cmake.*.::args_cleancmd" : [ "-r", "-d $BUILD_DIR -i $INSTALL_DIR" ],

".*cmake.*dm.*::args_config" : [ "-e", "USE_MPI=-DUSE_MPI=ON,DM=_dm" ],
".*cmake.*sm.*::args_config" : [ "-e", "USE_OMP=-DUSE_OMP=ON,SM=_sm" ],

".*cmake.*gnu.*::args_name" : [ "-e", "NAME=gnu" ],
".*cmake.*intel-classic::args_name" : [ "-e", "NAME=ifort" ],
".*cmake.*intel-llvm.*::args_name" : [ "-e", "NAME=ifx" ],
".*cmake.*pgi.*::args_name" : [ "-e", "NAME=pgi" ]
},
"hsn.de.hpc" :
{
"submission" : "PBS",
"queue" : "main",
"hpc_arguments" :
{
"node_select" : { "-l " : { "select" : 1, "ncpus" : 8 } },
"priority" : { "-l " : { "job_priority" : "economy" } }
},
"arguments" :
{
"base_env_numprocs" : [ "-e", "NUM_PROCS=8" ],
"very_last_modules" : [ "netcdf" ],
".*gnu.*::test_modules" : [ "gcc" ],
".*intel-classic.*::test_modules" : [ "ncarenv/23.09", "intel-classic" ],
".*intel-llvm.*::test_modules" : [ "intel-oneapi" ],
".*pgi.*::test_modules" : [ "nvhpc" ],
".*dm.*::test_mpi_module" : [ "cray-mpich" ],
".*cmake.*::test_cmake_module" : [ "cmake" ]
}
}
},

"cmake-gnu-serial" : { "steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } } },
"cmake-gnu-sm" : { "steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } } },
"cmake-gnu-dm" : { "steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } } },
"cmake-gnu-dm+sm" : { "steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } } },

"cmake-intel-classic-serial" : {
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
"steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } }
},
"cmake-intel-classic-sm" : {
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
"steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } }
},
"cmake-intel-classic-dm" : {
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
"steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } }
},
"cmake-intel-classic-dm+sm" : {
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
"steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } }
},

"cmake-intel-llvm-serial" : {
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
"steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } }
},
"cmake-intel-llvm-sm" : {
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
"steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } }
},
"cmake-intel-llvm-dm" : {
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
"steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } }
},
"cmake-intel-llvm-dm+sm" : {
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
"steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } }
},

"cmake-pgi-serial" : {
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
"steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } }
},
"cmake-pgi-sm" : {
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
"steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } }
},
"cmake-pgi-dm" : {
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
"steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } }
},
"cmake-pgi-dm+sm" : {
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
"steps" : { "build" : { "command" : ".ci/tests/buildCMake.sh" } }
}
}
2 changes: 1 addition & 1 deletion .ci/wrf_compilation_tests-make.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"base_env_numprocs" : [ "-e", "NUM_PROCS=8" ],
"very_last_modules" : [ "netcdf" ],
".*gnu.*::test_modules" : [ "gcc" ],
".*intel-classic.*::test_modules" : [ "intel-classic" ],
".*intel-classic.*::test_modules" : [ "ncarenv/23.09", "intel-classic" ],
".*intel-llvm.*::test_modules" : [ "intel-oneapi" ],
".*pgi.*::test_modules" : [ "nvhpc" ],
".*dm.*::test_mpi_module" : [ "cray-mpich" ]
Expand Down
32 changes: 31 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
id : make-tests
fileroot : wrf_compilation_tests-make
args : -j='{"node_select":{"-l ":{"select":1}}}'
pool : 8
pool : 16
tpool : 1
mkdirs : true
tests :
Expand All @@ -90,6 +90,36 @@ jobs:
- make-pgi-dm+sm
# add new compilation tests here

- host : derecho
hpc-workflows_path : .ci/hpc-workflows
archive : /glade/work/aislas/github/runners/wrf/derecho/logs/
account : NMMM0012
name : "CMake Compilation Tests"
id : cmake-tests
fileroot : wrf_compilation_tests-cmake
args : -j='{"node_select":{"-l ":{"select":1}}}'
pool : 16
tpool : 1
mkdirs : false
tests :
- cmake-gnu-serial
- cmake-gnu-sm
- cmake-gnu-dm
- cmake-gnu-dm+sm
- cmake-intel-classic-serial
- cmake-intel-classic-sm
- cmake-intel-classic-dm
- cmake-intel-classic-dm+sm
- cmake-intel-llvm-serial
- cmake-intel-llvm-sm
- cmake-intel-llvm-dm
- cmake-intel-llvm-dm+sm
- cmake-pgi-serial
- cmake-pgi-sm
- cmake-pgi-dm
- cmake-pgi-dm+sm
# add new compilation tests here

uses : ./.github/workflows/test_workflow.yml
with :
# This should be the only hard-coded value, we don't use ${{ inputs.test }}
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ jobs:
submodules: true
ref: ${{ inputs.event_name == 'push' && github.ref || inputs.ref }}

############################################################################
# WRF Specific
# More checkout, just do everything so we have it all at the ready. This unfortunately will limit testing
# of on-the-fly checkouts
- name: Checkout extra via manage_externals
id : manage_externals
run : |
cd main
./tools/manage_externals/checkout_externals -e arch/Externals.cfg
############################################################################


# Immediately copy out to # of tests to do
- name: Create testing directories
Expand Down
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,14 @@ execute_process(
OUTPUT_FILE ${LOG_FILE}
ERROR_FILE ${LOG_FILE}
)
if ( ${MANAGE_EXTERNALS_STATUS} AND NOT ${MANAGE_EXTERNALS_STATUS} EQUAL 0 )
message( FATAL_ERROR "Failed to checkout external repos via manage_externals" )
else()
message( STATUS "Finished checking out external repos via manage_externals" )
endif()
# The manage_externals return code only informs critical failures and not whether the code
# exists or not and so this check often leads to false positives (success) when failure
# was expected
# if ( ${MANAGE_EXTERNALS_STATUS} AND NOT ${MANAGE_EXTERNALS_STATUS} EQUAL 0 )
# message( FATAL_ERROR "Failed to checkout external repos via manage_externals" )
# else()
# message( STATUS "Finished checking out external repos via manage_externals" )
# endif()


################################################################################
Expand Down