From b4900c483bd9cdb274aae6f75c0815a5f86bdaae Mon Sep 17 00:00:00 2001 From: GeorgeGayno-NOAA <52789452+GeorgeGayno-NOAA@users.noreply.github.com> Date: Mon, 1 May 2023 11:31:30 -0400 Subject: [PATCH] Improve repository build script (#819) Update the build_all.sh script to do a "submodule update" if necessary before building. Update build instructions in README.md. Update the rt.sh script to remove the recursive clone as submodules are now handled by the build script. Fixes #818. --- README.md | 17 +++++++++-------- build_all.sh | 7 +++++++ fix/link_fixdirs.sh | 10 +++++++++- reg_tests/rt.sh | 4 ++-- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 65661d60a..9ca48f03e 100644 --- a/README.md +++ b/README.md @@ -59,20 +59,21 @@ It also uses the following repositories: ## Installing -On Orion, Jet, Hera and WCOSS2, invoke the build script: +On Orion, Jet, Hera and WCOSS2 do the following: + +1) Set the 'fixed' directories using the `link_fixdirs.sh` +script in `./fix`. Usage: `./link_fixdirs.sh $RUN_ENVIR $machine`, +where `$RUN_ENVIR` is "emc" or "nco" (most developers +should choose "emc") and `$machine` is the platform. Example: ``` -./build_all.sh +./link_fixdirs.sh emc hera ``` -Otherwise, do: +2) Then, invoke the build script: ``` -mkdir build -cd build -cmake -DCMAKE_INSTALL_PREFIX=/path/to/install .. -make -j2 -make install +./build_all.sh ``` ## Contents diff --git a/build_all.sh b/build_all.sh index 41d380f14..75f830326 100755 --- a/build_all.sh +++ b/build_all.sh @@ -26,6 +26,13 @@ else set -x fi +# Ensure the submodules have been initialized. + +if [[ ! -d ./ccpp-physics/physics ]]; then + git submodule init + git submodule update +fi + # 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. diff --git a/fix/link_fixdirs.sh b/fix/link_fixdirs.sh index 3533a78d1..7fcc370c6 100755 --- a/fix/link_fixdirs.sh +++ b/fix/link_fixdirs.sh @@ -1,7 +1,15 @@ #!/bin/bash set -ex -#--Make symbolic links to 'fixed' directories. +# Set up the 'fixed' directories. +# +# This script takes two arguments: +# +# $RUN_ENVIR - Either 'emc' (creates links) or +# 'nco' (copies data). +# +# $machine - is the machine. Choices are: +# 'wcoss2', 'hera', 'jet', 'orion', 's4' RUN_ENVIR=${1} machine=${2} diff --git a/reg_tests/rt.sh b/reg_tests/rt.sh index 5a2750fd0..1bf12f987 100755 --- a/reg_tests/rt.sh +++ b/reg_tests/rt.sh @@ -1,4 +1,4 @@ -#!/bin/bash -l +#!/bin/bash ulimit -s unlimited @@ -16,7 +16,7 @@ cd ${WORK_DIR} rm -f reg_test_results.txt rm -rf UFS_UTILS -git clone --recursive https://github.com/ufs-community/UFS_UTILS.git +git clone https://github.com/ufs-community/UFS_UTILS.git rc=$? # Check to see if the clone was successful. Previously, it has