-
-
Notifications
You must be signed in to change notification settings - Fork 186
135 lines (125 loc) · 4.46 KB
/
spack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Spack build
on:
# Uncomment the below 'push' to trigger on push
# push:
# branches:
# - "**"
schedule:
# '*' is a special character in YAML, so string must be quoted
- cron: "0 2 * * THU"
workflow_dispatch:
inputs:
spack_repo:
description: "Spack repository to test"
default: "spack/spack"
type: string
spack_ref:
description: "Spack repository branch/tag to test"
default: "develop"
type: string
dolfinx_version:
description: "DOLFINx release branch/tag to test"
default: "0.9.0"
type: string
jobs:
build:
runs-on: ubuntu-latest
container: ubuntu:24.04
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe # Newer OpenMPI
OMPI_MCA_rmaps_base_oversubscribe: true # Older OpenMPI
DOLFINX_RELEASE_VERSION: "${{ github.event_name != 'workflow_dispatch' && '0.9.0' || github.event.inputs.dolfinx_version }}"
steps:
- name: Get Spack
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v4
with:
path: ./spack
repository: spack/spack
- name: Get Spack
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
path: ./spack
repository: ${{ github.event.inputs.spack_repo }}
ref: ${{ github.event.inputs.spack_ref }}
- name: Install Spack requirements
run: |
apt-get -y update
apt-get install -y bzip2 curl file git gzip make patch python3-minimal tar unzip xz-utils
apt-get install -y g++ gfortran # compilers
- name: Build DOLFINx (C++) development version via Spack
run: |
. ./spack/share/spack/setup-env.sh
spack env create cpp-main
spack env activate cpp-main
spack add fenics-dolfinx@main+adios2
spack install
- name: Get DOLFINx code (to access test files)
uses: actions/checkout@v4
with:
path: ./dolfinx-main
- name: Run a C++ test (development version)
run: |
. ./spack/share/spack/setup-env.sh
spack env create cpp-main-test
spack env activate cpp-main-test
spack add fenics-dolfinx@main+adios2 cmake py-fenics-ffcx@main
spack install
cd dolfinx-main/cpp/
cd demo/poisson
cmake .
export VERBOSE=1
make -j 4
mpirun -np 2 ./demo_poisson
- name: Build DOLFINx (C++) release version via Spack
run: |
. ./spack/share/spack/setup-env.sh
spack env create cpp-release
spack env activate cpp-release
spack add fenics-dolfinx@${DOLFINX_RELEASE_VERSION}+adios2
spack install
- name: Get DOLFINx release code (to access test files)
uses: actions/checkout@v4
with:
ref: v${{ env.DOLFINX_RELEASE_VERSION }}
path: ./dolfinx-release
- name: Run a C++ test (release version)
run: |
. ./spack/share/spack/setup-env.sh
spack env create cpp-release-test
spack env activate cpp-release-test
spack add fenics-dolfinx@${DOLFINX_RELEASE_VERSION}+adios2 cmake py-fenics-ffcx
spack install
cd dolfinx-release/cpp/
cd demo/poisson
cmake .
export VERBOSE=1
make -j 4
mpirun -np 2 ./demo_poisson
- name: Build DOLFINx (Python, development)
run: |
. ./spack/share/spack/setup-env.sh
spack env create py-main
spack env activate py-main
spack add py-fenics-dolfinx@main
spack install
- name: Run DOLFINx (Python, development) test
run: |
. ./spack/share/spack/setup-env.sh
spack env activate py-main
mpirun -np 2 python3 ./dolfinx-main/python/demo/demo_elasticity.py
- name: Build DOLFINx (Python, release version)
run: |
. ./spack/share/spack/setup-env.sh
spack env create py-release
spack env activate py-release
spack add py-fenics-dolfinx@${DOLFINX_RELEASE_VERSION}
spack install -j 4
- name: Run DOLFINx (Python, release) test
run: |
. ./spack/share/spack/setup-env.sh
spack env activate py-release
mpirun -np 2 python3 ./dolfinx-release/python/demo/demo_elasticity.py