Skip to content

Commit

Permalink
add option to build a different branch
Browse files Browse the repository at this point in the history
defaults to main
  • Loading branch information
hkershaw-brown committed Dec 11, 2023
1 parent 4d92949 commit 42b33e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions developer_tests/build_everything/run_all_quickbuilds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

# Usage: run_all_quickbuilds.sh compiler [gcc intel nvhpc cce]

if [ $# -ne 1 ]; then
echo "ERROR: expecting 1 argument"
if [ $# -eq 0 ]; then
echo "ERROR: expecting at least one argument"
exit 1
fi

compiler=$1
branch=${2:-main} # checkout branch if given, or use main

# Check if the script is running in a batch job or interactive session
if [[ -z $PBS_ENVIRONMENT ]]; then
Expand All @@ -32,21 +33,26 @@ elif [[ $compiler == "nvhpc" ]]; then
mkmf_template="mkmf.template.nvhpc"
else
echo "$compiler is not a valid argument"
exit 1
exit 3
fi


test_dir="/glade/derecho/scratch/$USER/build_everything/$compiler"
if [[ -d $test_dir ]]; then
echo "Directory exists: $test_dir"
exit 2
exit 4
fi

mkdir -p $test_dir
cd $test_dir
git clone 'https://github.com/NCAR/DART.git'
cd DART
export DART=$(git rev-parse --show-toplevel)
git checkout $branch
if [[ $? -ne 0 ]]; then
echo "unknown branch"
exit 5
fi

# mkmf for chosen compiler
module load $compiler
Expand Down Expand Up @@ -118,5 +124,6 @@ for st in ${status[@]}; do
done

module -t list
echo "branch : " $(git branch --show-current)

mv $test_dir $test_dir.$(date +"%FT%H%M")
2 changes: 1 addition & 1 deletion developer_tests/build_everything/submit_jobs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cat <<EOF > $outfile
export TMPDIR=/glade/derecho/scratch/$USER/temp
mkdir -p $TMPDIR
time ./run_all_quickbuilds.sh $compiler
time ./run_all_quickbuilds.sh $compiler $1
EOF

Expand Down

0 comments on commit 42b33e6

Please sign in to comment.