Skip to content

Commit

Permalink
Update Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
wdeconinck committed Nov 2, 2023
1 parent b3563ae commit fd0d6ca
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 54 deletions.
3 changes: 1 addition & 2 deletions .github/inactive_workflows/fesom2_icepack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ jobs:

- name: prepeare FESOM2_icepack
run: |
sed -i 's/USE_ICEPACK OFF/USE_ICEPACK ON/g' CMakeLists.txt
cd ./src/icepack_drivers/
./download_icepack.sh
cd ../../
- name: Compile model
run: |
bash -l configure.sh ubuntu
bash -l configure.sh ubuntu -DUSE_ICEPACK=ON
- name: Create global test run with ICEPACK
run: |
Expand Down
37 changes: 31 additions & 6 deletions .github/workflows/fesom2.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,43 @@ jobs:
steps:
# NK: this changes working directory to fesom2
- uses: actions/checkout@v2


- name: Git safe directory
run: |
git config --global --add safe.directory ${PWD}
- name: Compile model (binary)
run: |
bash -l configure.sh ubuntu
./configure.sh ubuntu
- name: Compile model (ifs_interface)
run: |
export BUILD_DIR=$PWD/build.ifs_interface
./configure.sh ubuntu -DENABLE_IFS_INTERFACE=ON -DCMAKE_INSTALL_PREFIX=$PWD/install.ifs_interface
- name: Test downstream from current install-dir
run: |
rm -rf test_downstream/build
export fesom_ROOT=${PWD}
cmake -S test_downstream -B test_downstream/build -DASSERT_HAVE_IFS_INTERFACE=OFF -DASSERT_FESOM_DIR=${fesom_ROOT}
cmake --build test_downstream/build
test_downstream/build/main
- name: Compile model (library)
- name: Test downstream from ifs_interface build-dir
run: |
bash ./test/ifs_interface/configure_lib.sh -l
export fesom_ROOT=$PWD/build.ifs_interface
rm -rf test_downstream/build
cmake -S test_downstream -B test_downstream/build -DASSERT_HAVE_IFS_INTERFACE=ON -DASSERT_FESOM_DIR=${fesom_ROOT}
cmake --build test_downstream/build
test_downstream/build/main
- name: Library exists
- name: Test downstream from ifs_interface install-dir
run: |
bash ./test/ifs_interface/check_exist.sh
export fesom_ROOT=$PWD/install.ifs_interface
rm -rf test_downstream/build
cmake -S test_downstream -B test_downstream/build -DASSERT_HAVE_IFS_INTERFACE=ON -DASSERT_FESOM_DIR=${fesom_ROOT}
cmake --build test_downstream/build
test_downstream/build/main
- name: Create global test run
run: |
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/fesom2_openmp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ jobs:
# NK: this changes working directory to fesom2
- uses: actions/checkout@v2

- name: switch OpenMP ON
- name: Git safe directory
run: |
cd ./src/
sed -i 's/with OpenMP\" OFF/with OpenMP\" ON/g' CMakeLists.txt
cd ../
git config --global --add safe.directory ${PWD}
- name: Compile model
run: |
bash -l configure.sh ubuntu
bash -l configure.sh ubuntu -DENABLE_OPENMP=ON
- name: Create global test run with 4 OpenMP threads
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
src/icepack_drivers/Icepack
lib/*.a
lib/*.so
lib64/*
/work_*
Makefile.in
mesh_part/build
15 changes: 10 additions & 5 deletions configure.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#!/usr/bin/env bash

set -e
HERE=$PWD

SOURCE_DIR="$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd -P )"
BUILD_DIR=${BUILD_DIR:-build}

source env.sh # source this from your run script too
mkdir build || true # make sure not to commit this to svn or git
cd build
cmake .. $@ -DCMAKE_BUILD_TYPE=Debug # not required when re-compiling
# additional cmake arguments can be passed to configure.sh
# this also includes fesom specific options in CMakeLists, can be used as -DFESOM_COUPLED=ON
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
cmake .. -DCMAKE_INSTALL_PREFIX=$HERE -DCMAKE_BUILD_TYPE=Debug ${CMAKE_ARGS} $@
# not required when re-compiling
# additional cmake arguments can be passed to configure.sh
# this also includes fesom specific options in CMakeLists, can be used as -DFESOM_COUPLED=ON
make install -j`nproc --all`
7 changes: 5 additions & 2 deletions env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ else
fi


if [[ $LOGINHOST =~ ^m[A-Za-z0-9]+\.hpc\.dkrz\.de$ ]]; then
if [[ "$LOGINHOST" == "local" ]]; then
echo "Using local environment $BEING_EXECUTED"
[ $BEING_EXECUTED = true ] && exit
return 0 # if we are being sourced, return from this script here
elif [[ $LOGINHOST =~ ^m[A-Za-z0-9]+\.hpc\.dkrz\.de$ ]]; then
STRATEGY="mistral.dkrz.de"
elif [[ $LOGINHOST =~ ^levante ]] || [[ $LOGINHOST =~ ^l[:alnum:]+\.lvt\.dkrz\.de$ ]]; then
STRATEGY="levante.dkrz.de"
Expand Down Expand Up @@ -85,7 +89,6 @@ else
return # if we are being sourced, return from this script here
fi


if [ $BEING_EXECUTED = true ]; then
# file is being executed, why is this here?
echo $DIR/env/$STRATEGY
Expand Down
7 changes: 4 additions & 3 deletions env/ubuntu/shell
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export FC=mpifort CC=mpicc CXX=mpicxx
export BLAS_LIBRARIES=/usr/lib/x86_64-linux-gnu/blas/
export UBUNTU_BLAS_LIBRARY="libblas.a"

if [[ -f "/usr/lib/x86_64-linux-gnu/liblapack.so.3" ]]; then
export LAPACK_LIBRARIES=/usr/lib/x86_64-linux-gnu/liblapack.so.3
export CMAKE_ARGS=-DLAPACK_LIBRARIES=${LAPACK_LIBRARIES}
fi

16 changes: 13 additions & 3 deletions test/ifs_interface/check_exist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@

set -e

FILE=./lib/libfesom.a
if [ -f "$FILE" ]; then
LIB_NAMES=("libfesom.a" "libfesom.so" "libfesom.dylib")

libfesom_exists=false
for LIB_NAME in ${LIB_NAMES[@]}; do
FILE=./lib/${LIB_NAME}
if [ -f "$FILE" ]; then
echo "$FILE compiled and linked."
libfesom_exists=true
fi
done

if ${libfesom_exists}; then
exit 0
else
echo "$FILE does not exist."
echo "libfesom not found"
exit 1
fi

19 changes: 19 additions & 0 deletions test/ifs_interface/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

# custom build script in use at ECMWF

set -e

#cd ../../
source env.sh # source this from your run script too

HERE=$PWD
echo "+ mkdir -p build"
mkdir -p build
echo "+ cd build"
cd build
echo + cmake .. -DCMAKE_INSTALL_PREFIX=$HERE -DBUILD_SHARED_LIBS=ON -DENABLE_IFS_INTERFACE=ON ${CMAKE_ARGS} $@ # not required when re-compiling
cmake .. -DCMAKE_INSTALL_PREFIX=$HERE -DBUILD_SHARED_LIBS=ON -DENABLE_IFS_INTERFACE=ON ${CMAKE_ARGS} $@ # not required when re-compiling
echo "+ make install -j`nproc --all`"
make install -j`nproc --all`

28 changes: 0 additions & 28 deletions test/ifs_interface/configure_lib.sh

This file was deleted.

0 comments on commit fd0d6ca

Please sign in to comment.