@@ -10,6 +10,9 @@ name: Test of package installation & execution
1010jobs :
1111 build_cxx :
1212 runs-on : ${{ matrix.os }}
13+ defaults :
14+ run :
15+ shell : bash -el {0}
1316 strategy :
1417 matrix :
1518 sundials-version : [latest]
@@ -18,25 +21,50 @@ jobs:
1821 with-asan : [false, true]
1922 with-elf : [false]
2023 with-valgrind : [false, true]
24+ with-mpi : [false]
2125 include :
2226 - sundials-version : " 5.7.0"
2327 os : ubuntu-latest
2428 with-coverage : false
2529 with-asan : false
2630 with-elf : false
2731 with-valgrind : false
32+ with-mpi : false
2833 - sundials-version : " 6.7.0"
2934 os : ubuntu-latest
3035 with-coverage : false
3136 with-asan : false
3237 with-elf : false
3338 with-valgrind : false
39+ with-mpi : false
3440 - sundials-version : " 7.1.1"
3541 os : ubuntu-latest
3642 with-coverage : false
3743 with-asan : false
3844 with-elf : false
3945 with-valgrind : false
46+ with-mpi : false
47+ - sundials-version : latest
48+ os : ubuntu-latest
49+ with-coverage : false
50+ with-asan : false
51+ with-elf : false
52+ with-valgrind : false
53+ with-mpi : true
54+ - sundials-version : " 6.7.0"
55+ os : ubuntu-latest
56+ with-coverage : false
57+ with-asan : false
58+ with-elf : false
59+ with-valgrind : false
60+ with-mpi : true
61+ - sundials-version : " 7.1.1"
62+ os : ubuntu-latest
63+ with-coverage : false
64+ with-asan : false
65+ with-elf : false
66+ with-valgrind : false
67+ with-mpi : true
4068 exclude :
4169 - os : windows-latest
4270 with-asan : true
@@ -71,65 +99,113 @@ jobs:
7199 - name : Set up MSVC Compiler on windows
72100 uses : ilammy/msvc-dev-cmd@v1
73101 if : matrix.os == 'windows-latest'
74- - name : Set up miniconda test environment
102+ - name : Set up miniconda test environment (W/O MPI)
103+ if : matrix.with-mpi == false
75104 uses : conda-incubator/setup-miniconda@v3
76105 with :
77106 activate-environment : ephoto
78107 environment-file : environment.yml
79108 auto-update-conda : true
80109 channels : conda-forge
81110 channel-priority : strict
82- # miniforge-variant: Mambaforge
83111 miniforge-version : latest
84112 use-mamba : true
85113 mamba-version : " 1.5.10"
114+ conda-remove-defaults : true
115+ - name : Set up miniconda test environment (W/ MPI)
116+ if : matrix.with-mpi == true
117+ uses : conda-incubator/setup-miniconda@v3
118+ with :
119+ activate-environment : ephoto
120+ environment-file : environment_mpi.yml
121+ auto-update-conda : true
122+ channels : conda-forge
123+ channel-priority : strict
124+ miniforge-version : latest
125+ use-mamba : true
126+ mamba-version : " 1.5.10"
127+ conda-remove-defaults : true
86128 - name : Set USERPROFILE
87129 if : matrix.os == 'windows-latest'
88- shell : bash -el {0}
89130 run : |
90131 echo "USERPROFILE=${{ github.workspace }}" >> "$GITHUB_ENV"
91- - name : Install specific version of Sundials
92- if : matrix.sundials-version != 'latest'
93- shell : bash -l {0}
132+ - name : Install specific version of Sundials via conda
133+ if : matrix.sundials-version != 'latest' && matrix.with-mpi == false
94134 run : |
95135 mamba install sundials==${{ matrix.sundials-version }} -y
96136 - name : Check mamba installation
97- shell : bash -el {0}
98137 run : |
99138 mamba info
100139 mamba list
101140 - name : Install doxgen on unix systems
102141 if : matrix.os != 'windows-latest'
103- shell : bash -l {0}
104142 run : |
105143 mamba install doxygen>=1.9.2 graphviz -y
106144 - name : Install compilers using conda on Linux/Mac
107145 if : matrix.os != 'windows-latest' && matrix.with-valgrind != true
108- shell : bash -l {0}
109146 run : |
110147 mamba install c-compiler cxx-compiler
111148 - name : Install valgrind on unix systems (and required debug symbols)
112149 if : matrix.os != 'windows-latest' && matrix.with-valgrind == true
113- shell : bash -l {0}
114150 run : |
115151 sudo apt-get update
116152 sudo apt-get install libc6-dbg
117153 mamba install valgrind
154+
155+ # ##################################
156+ # INSTALL SUNDIALS W/ MPI
157+ # ##################################
158+ - name : CMake flags for building Sundials W/ MPI
159+ shell : bash -l {0}
160+ if : matrix.with-mpi == true
161+ run : |
162+ CMAKE_BUILD_TYPE_TEST="RelWithDebInfo"
163+ echo "CMAKE_BUILD_TYPE_TEST=RelWithDebInfo" >> "$GITHUB_ENV"
164+ echo "CMAKE_ARGS=-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DENABLE_MPI:BOOL=ON -DEXAMPLES_ENABLE_C:BOOL=OFF -DEXAMPLES_ENABLE_CXX:BOOL=OFF" >> "$GITHUB_ENV"
165+ - name : Clone Sundials for build W/ MPI
166+ if : matrix.with-mpi == true
167+ run : |
168+ git clone https://github.com/LLNL/sundials.git
169+ - name : Check out specific version of Sundials for build W/ MPI
170+ if : matrix.sundials-version != 'latest' && matrix.with-mpi == true
171+ run : |
172+ cd sundials
173+ git checkout tags/v${{ matrix.sundials-version }} -b tagged
174+ - name : Configure Sundials W/ MPI
175+ if : matrix.with-mpi == true
176+ run : |
177+ cd sundials
178+ mkdir build
179+ cd build
180+ cmake .. ${{ env.CMAKE_ARGS }}
181+ - name : Build Sundials W/ MPI in parallel (CONDA, UNIX)
182+ if : matrix.with-mpi == true && matrix.os != 'windows-latest'
183+ run : |
184+ cd sundials/build
185+ cmake --build . --config ${{ env.CMAKE_BUILD_TYPE_TEST }} -- -j 4
186+ - name : Build Sundials W/ MPI in serial (CONDA, WINDOWS)
187+ if : matrix.with-mpi == true && matrix.os == 'windows-latest'
188+ run : |
189+ cd sundials/build
190+ cmake --build . --config ${{ env.CMAKE_BUILD_TYPE_TEST }}
191+ - name : Install Sundials W/ MPI
192+ if : matrix.with-mpi == true
193+ run : |
194+ cd sundials/build
195+ cmake --install . --prefix /home/runner/miniconda3/envs/ephoto
118196
119197 # ##################################
120198 # PIP INSTALL THINGS
121199 # ##################################
122200 - name : Install packages not current on conda-forge (gcovr)
123201 if : matrix.with-coverage == true
124- shell : bash -l {0}
125202 run : |
126203 pip install gcovr
127204
128205 # ##################################
129206 # SET CONFIG FLAGS
130207 # ##################################
131208 - name : Global config flags
132- shell : bash -l {0}
133209 run : |
134210 CMAKE_BUILD_TYPE_TEST="Debug"
135211 echo "CMAKE_BUILD_TYPE_TEST=Debug" >> "$GITHUB_ENV"
@@ -138,29 +214,24 @@ jobs:
138214 echo "TEST_FLAGS=-C ${CMAKE_BUILD_TYPE_TEST} --output-on-failure -VV" >> "$GITHUB_ENV"
139215 - name : Coverage config flags
140216 if : matrix.with-coverage == true && matrix.os != 'windows-latest'
141- shell : bash -l {0}
142217 run : |
143218 echo "CMAKE_ARGS_TEST=${{ env.CMAKE_ARGS_TEST }} -DTEST_COVERAGE=ON" >> "$GITHUB_ENV"
144219 - name : ASAN config flags
145220 if : matrix.with-asan == true
146- shell : bash -l {0}
147221 run : |
148222 echo "CMAKE_ARGS=${{ env.CMAKE_ARGS }} -DWITH_ASAN=ON" >> "$GITHUB_ENV"
149223 echo "ASAN_OPTIONS=detect_odr_violation=0:detect_container_overflow=0" >> $GITHUB_ENV
150224 echo "TEST_FLAGS=${{ env.TEST_FLAGS }} -E valgrind*" >> "$GITHUB_ENV"
151225 - name : ASAN dynamic library
152226 if : matrix.with-asan == true && matrix.os == 'macos-latest'
153- shell : bash -l {0}
154227 run : |
155228 echo "DYLD_INSERT_LIBRARIES=$(clang -print-file-name=libclang_rt.asan_osx_dynamic.dylib)" >> "$GITHUB_ENV"
156229 - name : ELF config flags
157230 if : matrix.with-elf == true
158- shell : bash -l {0}
159231 run : |
160232 echo "CMAKE_ARGS_TEST=${{ env.CMAKE_ARGS_TEST }} -DTEST_ELF=ON" >> "$GITHUB_ENV"
161233 - name : Valgrind off config flags
162234 if : matrix.with-valgrind == true
163- shell : bash -l {0}
164235 run : |
165236 echo "CMAKE_ARGS_TEST=${{ env.CMAKE_ARGS_TEST }} -DTEST_VALGRIND=ON" >> "$GITHUB_ENV"
166237
@@ -169,7 +240,6 @@ jobs:
169240 # ##################################
170241 - name : Conda library paths on Windows
171242 if : matrix.os == 'windows-latest'
172- shell : bash -l {0}
173243 run : |
174244 # This isn't necessary, but it speeds up the build
175245 LIB_DIRECTORY="${CONDA_PREFIX}/Library/lib"
@@ -183,7 +253,6 @@ jobs:
183253 # Configure
184254 # ##################################
185255 - name : Configure (CONDA)
186- shell : bash -l {0}
187256 run : |
188257 mkdir build
189258 cd build
@@ -195,13 +264,11 @@ jobs:
195264 # ##################################
196265 - name : Build C++ & C in parallel (CONDA, UNIX)
197266 if : matrix.os != 'windows-latest'
198- shell : bash -l {0}
199267 run : |
200268 cd build
201269 cmake --build . --config ${{ env.CMAKE_BUILD_TYPE_TEST }} -- -j 4
202270 - name : Build C++ & C in serial (CONDA, WINDOWS)
203271 if : matrix.os == 'windows-latest'
204- shell : bash -l {0}
205272 run : |
206273 cd build
207274 cmake --build . --config ${{ env.CMAKE_BUILD_TYPE_TEST }}
@@ -211,7 +278,6 @@ jobs:
211278 # ##################################
212279 - name : Test C++
213280 if : matrix.with-coverage != true
214- shell : bash -l {0}
215281 run : |
216282 mamba list
217283 echo "PATH=$PATH"
@@ -220,34 +286,29 @@ jobs:
220286 ctest ${{ env.TEST_FLAGS }}
221287 - name : Test C++ (COVERAGE)
222288 if : matrix.with-coverage && matrix.os != 'windows-latest'
223- shell : bash -l {0}
224289 run : |
225290 mamba list
226291 echo "PATH=$PATH"
227292 cd build
228293 make coverage
229294 - name : Preserve coverage information
230295 if : matrix.with-coverage && matrix.os != 'windows-latest'
231- shell : bash -l {0}
232296 run : |
233297 cp -r build/coverage coverage
234298
235299 # ##################################
236300 # Build Python
237301 # ##################################
238302 # - name: Set CMAKE_ARGS for Python build
239- # shell: bash -l {0}
240303 # run: |
241304 # echo "OLD_CMAKE_ARGS=${{ env.CMAKE_ARGS }}" >> "$GITHUB_ENV"
242305 # echo "CMAKE_ARGS=${{ env.CMAKE_ARGS }} -DBUILD_PYTHON=ON" >> "$GITHUB_ENV"
243306 # - name: Build Python (CONDA)
244- # shell: bash -l {0}
245307 # run: |
246308 # cd build
247309 # which cmake
248310 # cmake .. ${{ env.CMAKE_ARGS }} ${{ env.CMAKE_ARGS_TEST }}
249311 # - name: Unset CMAKE_ARGS for Python build
250- # shell: bash -l {0}
251312 # run: |
252313 # echo "CMAKE_ARGS=${{ env.OLD_CMAKE_ARGS }}" >> "$GITHUB_ENV"
253314
@@ -256,7 +317,6 @@ jobs:
256317 # ##################################
257318 # - name: Test Python Interfaces (CONDA)
258319 # if: matrix.with-elf == false && matrix.with-valgrind == false
259- # shell: bash -l {0}
260320 # run: |
261321 # pytest -sv tests/python
262322
@@ -265,7 +325,6 @@ jobs:
265325 # ##################################
266326 - name : Build docs
267327 if : matrix.os != 'windows-latest'
268- shell : bash -l {0}
269328 run : |
270329 python scripts/devtasks.py docs --rebuild
271330
0 commit comments