Skip to content

Commit 45da06f

Browse files
committed
o Add MPI flags for CI
1 parent ca75ae4 commit 45da06f

1 file changed

Lines changed: 124 additions & 122 deletions

File tree

.github/workflows/yac-optional.yml

Lines changed: 124 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,124 @@
1-
name: YAC Optional CI
2-
3-
on:
4-
pull_request:
5-
paths:
6-
- ".github/workflows/yac-optional.yml"
7-
- "uxarray/remap/**"
8-
- "test/test_remap_yac.py"
9-
workflow_dispatch:
10-
11-
jobs:
12-
yac-optional:
13-
name: YAC v3.9.3 (Ubuntu)
14-
runs-on: ubuntu-latest
15-
defaults:
16-
run:
17-
shell: bash -l {0}
18-
env:
19-
YAC_VERSION: v3.9.3
20-
YAXT_VERSION: v0.11.5
21-
steps:
22-
- name: checkout
23-
uses: actions/checkout@v4
24-
with:
25-
token: ${{ github.token }}
26-
27-
- name: conda_setup
28-
uses: conda-incubator/setup-miniconda@v3
29-
with:
30-
activate-environment: uxarray_build
31-
channel-priority: strict
32-
python-version: "3.11"
33-
channels: conda-forge
34-
environment-file: ci/environment.yml
35-
miniforge-variant: Miniforge3
36-
miniforge-version: latest
37-
38-
- name: Install build dependencies (apt)
39-
run: |
40-
sudo apt-get update
41-
sudo apt-get install -y \
42-
autoconf \
43-
automake \
44-
gawk \
45-
gfortran \
46-
libfyaml-dev \
47-
libnetcdf-dev \
48-
libopenmpi-dev \
49-
libtool \
50-
make \
51-
openmpi-bin \
52-
pkg-config
53-
54-
- name: Install Python build dependencies
55-
run: |
56-
python -m pip install --upgrade pip
57-
python -m pip install cython mpi4py wheel
58-
59-
- name: Build and install YAXT
60-
run: |
61-
set -euxo pipefail
62-
YAC_PREFIX="${GITHUB_WORKSPACE}/yac_prefix"
63-
echo "YAC_PREFIX=${YAC_PREFIX}" >> "${GITHUB_ENV}"
64-
git clone --depth 1 --branch "${YAXT_VERSION}" https://gitlab.dkrz.de/dkrz-sw/yaxt.git
65-
if [ ! -x yaxt/configure ]; then
66-
if [ -x yaxt/autogen.sh ]; then
67-
(cd yaxt && ./autogen.sh)
68-
else
69-
(cd yaxt && autoreconf -i)
70-
fi
71-
fi
72-
mkdir -p yaxt/build
73-
cd yaxt/build
74-
../configure --prefix="${YAC_PREFIX}" CC=mpicc FC=mpif90
75-
make -j2
76-
make install
77-
78-
- name: Build and install YAC
79-
run: |
80-
set -euxo pipefail
81-
git clone --depth 1 --branch "${YAC_VERSION}" https://gitlab.dkrz.de/dkrz-sw/yac.git
82-
if [ ! -x yac/configure ]; then
83-
if [ -x yac/autogen.sh ]; then
84-
(cd yac && ./autogen.sh)
85-
else
86-
(cd yac && autoreconf -i)
87-
fi
88-
fi
89-
mkdir -p yac/build
90-
cd yac/build
91-
../configure \
92-
--prefix="${YAC_PREFIX}" \
93-
--with-yaxt-root="${YAC_PREFIX}" \
94-
--with-netcdf-root="${CONDA_PREFIX}" \
95-
--with-fyaml-root=/usr \
96-
--enable-python-bindings \
97-
CC=mpicc \
98-
FC=mpif90
99-
make -j2
100-
make install
101-
102-
- name: Configure YAC runtime paths
103-
run: |
104-
set -euxo pipefail
105-
PY_VER="$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"
106-
echo "LD_LIBRARY_PATH=${YAC_PREFIX}/lib:${LD_LIBRARY_PATH:-}" >> "${GITHUB_ENV}"
107-
echo "PYTHONPATH=${YAC_PREFIX}/lib/python${PY_VER}/site-packages:${YAC_PREFIX}/lib/python${PY_VER}/dist-packages:${PYTHONPATH:-}" >> "${GITHUB_ENV}"
108-
109-
- name: Verify YAC Python bindings
110-
run: |
111-
python - <<'PY'
112-
import yac
113-
print("YAC version:", getattr(yac, "__version__", "unknown"))
114-
PY
115-
116-
- name: Install uxarray
117-
run: |
118-
python -m pip install . --no-deps
119-
120-
- name: Run tests (uxarray with YAC)
121-
run: |
122-
python -m pytest test/test_remap_yac.py
1+
name: YAC Optional CI
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/yac-optional.yml"
7+
- "uxarray/remap/**"
8+
- "test/test_remap_yac.py"
9+
workflow_dispatch:
10+
11+
jobs:
12+
yac-optional:
13+
name: YAC v3.9.3 (Ubuntu)
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
shell: bash -l {0}
18+
env:
19+
YAC_VERSION: v3.9.3
20+
YAXT_VERSION: v0.11.5
21+
OMPI_ALLOW_RUN_AS_ROOT: 1
22+
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
23+
steps:
24+
- name: checkout
25+
uses: actions/checkout@v4
26+
with:
27+
token: ${{ github.token }}
28+
29+
- name: conda_setup
30+
uses: conda-incubator/setup-miniconda@v3
31+
with:
32+
activate-environment: uxarray_build
33+
channel-priority: strict
34+
python-version: "3.11"
35+
channels: conda-forge
36+
environment-file: ci/environment.yml
37+
miniforge-variant: Miniforge3
38+
miniforge-version: latest
39+
40+
- name: Install build dependencies (apt)
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install -y \
44+
autoconf \
45+
automake \
46+
gawk \
47+
gfortran \
48+
libfyaml-dev \
49+
libnetcdf-dev \
50+
libopenmpi-dev \
51+
libtool \
52+
make \
53+
openmpi-bin \
54+
pkg-config
55+
56+
- name: Install Python build dependencies
57+
run: |
58+
python -m pip install --upgrade pip
59+
python -m pip install cython mpi4py wheel
60+
61+
- name: Build and install YAXT
62+
run: |
63+
set -euxo pipefail
64+
YAC_PREFIX="${GITHUB_WORKSPACE}/yac_prefix"
65+
echo "YAC_PREFIX=${YAC_PREFIX}" >> "${GITHUB_ENV}"
66+
git clone --depth 1 --branch "${YAXT_VERSION}" https://gitlab.dkrz.de/dkrz-sw/yaxt.git
67+
if [ ! -x yaxt/configure ]; then
68+
if [ -x yaxt/autogen.sh ]; then
69+
(cd yaxt && ./autogen.sh)
70+
else
71+
(cd yaxt && autoreconf -i)
72+
fi
73+
fi
74+
mkdir -p yaxt/build
75+
cd yaxt/build
76+
../configure --prefix="${YAC_PREFIX}" CC=mpicc FC=mpif90
77+
make -j2
78+
make install
79+
80+
- name: Build and install YAC
81+
run: |
82+
set -euxo pipefail
83+
git clone --depth 1 --branch "${YAC_VERSION}" https://gitlab.dkrz.de/dkrz-sw/yac.git
84+
if [ ! -x yac/configure ]; then
85+
if [ -x yac/autogen.sh ]; then
86+
(cd yac && ./autogen.sh)
87+
else
88+
(cd yac && autoreconf -i)
89+
fi
90+
fi
91+
mkdir -p yac/build
92+
cd yac/build
93+
../configure \
94+
--prefix="${YAC_PREFIX}" \
95+
--with-yaxt-root="${YAC_PREFIX}" \
96+
--with-netcdf-root="${CONDA_PREFIX}" \
97+
--with-fyaml-root=/usr \
98+
--enable-python-bindings \
99+
CC=mpicc \
100+
FC=mpif90
101+
make -j2
102+
make install
103+
104+
- name: Configure YAC runtime paths
105+
run: |
106+
set -euxo pipefail
107+
PY_VER="$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"
108+
echo "LD_LIBRARY_PATH=${YAC_PREFIX}/lib:${LD_LIBRARY_PATH:-}" >> "${GITHUB_ENV}"
109+
echo "PYTHONPATH=${YAC_PREFIX}/lib/python${PY_VER}/site-packages:${YAC_PREFIX}/lib/python${PY_VER}/dist-packages:${PYTHONPATH:-}" >> "${GITHUB_ENV}"
110+
111+
- name: Verify YAC Python bindings
112+
run: |
113+
python - <<'PY'
114+
import yac
115+
print("YAC version:", getattr(yac, "__version__", "unknown"))
116+
PY
117+
118+
- name: Install uxarray
119+
run: |
120+
python -m pip install . --no-deps
121+
122+
- name: Run tests (uxarray with YAC)
123+
run: |
124+
python -m pytest test/test_remap_yac.py

0 commit comments

Comments
 (0)