Skip to content

Commit 4c712ce

Browse files
committed
[CI] Compile Uno with SPRAL
1 parent 21482ad commit 4c712ce

12 files changed

Lines changed: 143 additions & 48 deletions

.github/C/CMakeLists.txt

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
1919
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wmaybe-uninitialized")
2020
endif()
2121

22-
find_library(UNO REQUIRED)
23-
add_executable(tests_hs015 tests_hs015.c)
22+
# external dependencies
23+
set(LIBRARIES "")
24+
# additional libraries to link against
25+
set(AUXILIARY_LIBRARIES "" CACHE STRING "Additional libraries to link against")
2426

25-
# link the math library and Uno
26-
target_link_libraries(tests_hs015 PUBLIC m ${UNO})
27+
# Uno
28+
find_library(UNO REQUIRED)
29+
list(APPEND LIBRARIES m ${UNO}) # math library and Uno
2730

2831
# LAPACK
2932
# convert relative paths of LAPACK to absolute paths
@@ -33,10 +36,10 @@ if(LAPACK_LIBRARIES)
3336
get_filename_component(absolute_path "${relative_path}" ABSOLUTE)
3437
list(APPEND ABSOLUTE_LAPACK_LIBRARIES "${absolute_path}")
3538
endforeach()
36-
target_link_libraries(tests_hs015 PRIVATE ${ABSOLUTE_LAPACK_LIBRARIES})
39+
list(APPEND LIBRARIES ${ABSOLUTE_LAPACK_LIBRARIES})
3740
else()
3841
find_package(LAPACK REQUIRED)
39-
target_link_libraries(tests_hs015 PRIVATE LAPACK::LAPACK)
42+
list(APPEND LIBRARIES LAPACK::LAPACK)
4043
endif()
4144

4245
# BLAS
@@ -47,8 +50,22 @@ if(BLAS_LIBRARIES)
4750
get_filename_component(absolute_path "${relative_path}" ABSOLUTE)
4851
list(APPEND ABSOLUTE_BLAS_LIBRARIES "${absolute_path}")
4952
endforeach()
50-
target_link_libraries(tests_hs015 PRIVATE ${ABSOLUTE_BLAS_LIBRARIES})
53+
list(APPEND LIBRARIES ${ABSOLUTE_BLAS_LIBRARIES})
5154
else()
5255
find_package(BLAS REQUIRED)
53-
target_link_libraries(tests_hs015 PRIVATE BLAS::BLAS)
56+
list(APPEND LIBRARIES BLAS::BLAS)
5457
endif()
58+
59+
# add the auxiliary libraries last
60+
if(AUXILIARY_LIBRARIES)
61+
set(ABSOLUTE_AUXILIARY_LIBRARIES)
62+
foreach(relative_path IN LISTS AUXILIARY_LIBRARIES)
63+
get_filename_component(absolute_path "${relative_path}" ABSOLUTE)
64+
list(APPEND ABSOLUTE_AUXILIARY_LIBRARIES "${absolute_path}")
65+
endforeach()
66+
list(APPEND LIBRARIES ${ABSOLUTE_AUXILIARY_LIBRARIES})
67+
endif()
68+
69+
# tests
70+
add_executable(tests_hs015 tests_hs015.c)
71+
target_link_libraries(tests_hs015 PUBLIC ${LIBRARIES})

.github/workflows/C-test-example.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,24 @@ jobs:
4242
shell: bash
4343
run: bash dependencies/scripts/download_dependencies.sh
4444

45+
- name: Set the environment variables for OpenMP
46+
shell: bash
47+
run: |
48+
echo "OMP_CANCELLATION=TRUE" >> "$GITHUB_ENV"
49+
echo "OMP_PROC_BIND=TRUE" >> "$GITHUB_ENV"
50+
4551
- name: Configure Uno CMake
4652
shell: bash
4753
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
4854
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
4955
run: |
5056
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
5157
-DBQPD=${{github.workspace}}/dependencies/lib/libbqpd.a \
58+
-DHIGHS=${{github.workspace}}/dependencies/lib/libhighs.a \
59+
-DSPRAL=${{github.workspace}}/dependencies/lib/libspral.a \
5260
-DLAPACK_LIBRARIES=${{github.workspace}}/dependencies/lib/liblapack.a \
53-
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libblas.a;${{github.workspace}}/dependencies/lib/libcblas.a" \
61+
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libcblas.a;${{github.workspace}}/dependencies/lib/libblas.a" \
62+
-DAUXILIARY_LIBRARIES="${{github.workspace}}/dependencies/lib/libhwloc.so" \
5463
-DBUILD_STATIC_LIBS=OFF \
5564
-DBUILD_SHARED_LIBS=ON .
5665
@@ -70,12 +79,13 @@ jobs:
7079
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
7180
-DUNO=/usr/local/lib/libuno.so \
7281
-DLAPACK_LIBRARIES=${{github.workspace}}/dependencies/lib/liblapack.a \
73-
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libblas.a;${{github.workspace}}/dependencies/lib/libcblas.a" .
82+
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libblas.a" \
83+
-DAUXILIARY_LIBRARIES="${{github.workspace}}/dependencies/lib/libhwloc.so" .
7484
7585
- name: Build example
7686
working-directory: ${{github.workspace}}/interfaces/C/example
7787
run: cmake --build ${{github.workspace}}/interfaces/C/example/build --config ${{env.BUILD_TYPE}}
7888

7989
- name: Run example
8090
working-directory: ${{github.workspace}}/interfaces/C/example/build
81-
run: ./example_hs015
91+
run: ./example_hs015

.github/workflows/C-tests-linux.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,24 @@ jobs:
4444
shell: bash
4545
run: bash dependencies/scripts/download_dependencies.sh
4646

47+
- name: Set the environment variables for OpenMP
48+
shell: bash
49+
run: |
50+
echo "OMP_CANCELLATION=TRUE" >> "$GITHUB_ENV"
51+
echo "OMP_PROC_BIND=TRUE" >> "$GITHUB_ENV"
52+
4753
- name: Configure Uno CMake
4854
shell: bash
4955
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
5056
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
5157
run: |
5258
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
5359
-DBQPD=${{github.workspace}}/dependencies/lib/libbqpd.a \
60+
-DHIGHS=${{github.workspace}}/dependencies/lib/libhighs.a \
61+
-DSPRAL=${{github.workspace}}/dependencies/lib/libspral.a \
5462
-DLAPACK_LIBRARIES=${{github.workspace}}/dependencies/lib/liblapack.a \
5563
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libblas.a;${{github.workspace}}/dependencies/lib/libcblas.a" \
64+
-DAUXILIARY_LIBRARIES="${{github.workspace}}/dependencies/lib/libhwloc.so" \
5665
-DBUILD_STATIC_LIBS=OFF \
5766
-DBUILD_SHARED_LIBS=ON .
5867
@@ -72,7 +81,8 @@ jobs:
7281
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
7382
-DUNO=/usr/local/lib/libuno.so \
7483
-DLAPACK_LIBRARIES=${{github.workspace}}/dependencies/lib/liblapack.a \
75-
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libblas.a;${{github.workspace}}/dependencies/lib/libcblas.a" .
84+
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libblas.a" \
85+
-DAUXILIARY_LIBRARIES="${{github.workspace}}/dependencies/lib/libhwloc.so".
7686
7787
- name: Build example
7888
working-directory: ${{github.workspace}}/.github/C

.github/workflows/Fortran-tests-linux.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ jobs:
3838
shell: bash
3939
run: bash dependencies/scripts/download_dependencies.sh
4040

41+
- name: Set the environment variables for OpenMP
42+
shell: bash
43+
run: |
44+
echo "OMP_CANCELLATION=TRUE" >> "$GITHUB_ENV"
45+
echo "OMP_PROC_BIND=TRUE" >> "$GITHUB_ENV"
46+
4147
- name: Configure Uno CMake
4248
shell: bash
4349
run: |
@@ -50,8 +56,9 @@ jobs:
5056
-DMUMPS_PORD_LIBRARY=${{github.workspace}}/dependencies/lib/libpord.a \
5157
-DMUMPS_MPISEQ_LIBRARY=${{github.workspace}}/dependencies/lib/libmpiseq.a \
5258
-DHIGHS=${{github.workspace}}/dependencies/lib/libhighs.a \
59+
-DSPRAL=${{github.workspace}}/dependencies/lib/libspral.a \
5360
-DMETIS_LIBRARY=${{github.workspace}}/dependencies/lib/libmetis.a \
54-
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libblas.a;${{github.workspace}}/dependencies/lib/libcblas.a" \
61+
-DBLAS_LIBRARIES=${{github.workspace}}/dependencies/lib/libblas.a \
5562
-DLAPACK_LIBRARIES=${{github.workspace}}/dependencies/lib/liblapack.a \
5663
-DBUILD_STATIC_LIBS=ON \
5764
-DBUILD_SHARED_LIBS=OFF .
@@ -61,7 +68,13 @@ jobs:
6168

6269
- name: Compile Fortran tests
6370
working-directory: ${{github.workspace}}/interfaces/Fortran
64-
run: gfortran example_uno.f90 -o example_uno -L../../build -luno -L${{github.workspace}}/dependencies/lib -lhighs -ldmumps -lmumps_common -lmpiseq -lpord -lmetis -lbqpd -llapack -lcblas -lblas -lstdc++
71+
run: |
72+
gfortran example_uno.f90 -o example_uno \
73+
-L../../build -luno \
74+
-L${{github.workspace}}/dependencies/lib \
75+
-Wl,-rpath,${{github.workspace}}/dependencies/lib \
76+
-lhighs -ldmumps -lmumps_common -lmpiseq -lpord -lmetis \
77+
-lbqpd -lspral -lhwloc -llapack -lcblas -lblas -lgomp -lstdc++
6578
6679
- name: Run Fortran tests
6780
working-directory: ${{github.workspace}}/interfaces/Fortran

.github/workflows/build-python-wheels.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@ jobs:
246246
- name: Install unopy from TestPyPI
247247
run: pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ unopy
248248

249+
- name: Set the environment variables for OpenMP
250+
shell: bash
251+
run: |
252+
echo "OMP_CANCELLATION=TRUE" >> "$GITHUB_ENV"
253+
echo "OMP_PROC_BIND=TRUE" >> "$GITHUB_ENV"
254+
249255
- name: Run example
250256
working-directory: ${{github.workspace}}/interfaces/Python/example
251257
run: python example_hs015.py
@@ -272,6 +278,12 @@ jobs:
272278
- name: Install unopy from PyPI
273279
run: pip install unopy
274280

281+
- name: Set the environment variables for OpenMP
282+
shell: bash
283+
run: |
284+
echo "OMP_CANCELLATION=TRUE" >> "$GITHUB_ENV"
285+
echo "OMP_PROC_BIND=TRUE" >> "$GITHUB_ENV"
286+
275287
- name: Run example
276288
working-directory: ${{github.workspace}}/interfaces/Python/example
277-
run: python example_hs015.py
289+
run: python example_hs015.py

.github/workflows/build.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ jobs:
183183
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libcblas.a;${{github.workspace}}/dependencies/lib/libblas.a" \
184184
-DLAPACK_LIBRARIES=${{github.workspace}}/dependencies/lib/liblapack.a \
185185
-DHIGHS=${{github.workspace}}/dependencies/lib/libhighs.a \
186+
-DSPRAL=${{github.workspace}}/dependencies/lib/libspral.a \
187+
-DAUXILIARY_LIBRARIES="${{github.workspace}}/dependencies/lib/libhwloc.so" \
186188
-DBUILD_STATIC_LIBS=ON \
187189
-DBUILD_SHARED_LIBS=ON
188190
@@ -212,6 +214,8 @@ jobs:
212214
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libcblas.a;${{github.workspace}}/dependencies/lib/libblas.a" \
213215
-DLAPACK_LIBRARIES=${{github.workspace}}/dependencies/lib/liblapack.a \
214216
-DHIGHS=${{github.workspace}}/dependencies/lib/libhighs.a \
217+
-DSPRAL=${{github.workspace}}/dependencies/lib/libspral.a \
218+
-DAUXILIARY_LIBRARIES="${{github.workspace}}/dependencies/lib/libhwloc.dylib" \
215219
-DBUILD_STATIC_LIBS=ON \
216220
-DBUILD_SHARED_LIBS=ON
217221
@@ -234,7 +238,8 @@ jobs:
234238
-DBLAS_LIBRARIES="${{github.workspace}}\dependencies\lib\libcblas.a;${{github.workspace}}\dependencies\lib\libblas.a" ^
235239
-DLAPACK_LIBRARIES=${{github.workspace}}\dependencies\lib\liblapack.a ^
236240
-DHIGHS=${{github.workspace}}\dependencies\lib\libhighs.a ^
237-
-DAUXILIARY_LIBRARIES=${{github.workspace}}\dependencies\lib\libstdc++.a ^
241+
-DSPRAL=${{github.workspace}}\dependencies\lib\libspral.a ^
242+
-DAUXILIARY_LIBRARIES="${{github.workspace}}\dependencies\lib\libhwloc.a;${{github.workspace}}\dependencies\lib\libstdc++.a" ^
238243
-DBUILD_STATIC_LIBS=ON ^
239244
-DBUILD_SHARED_LIBS=ON .
240245
@@ -256,8 +261,9 @@ jobs:
256261
-DMUMPS_COMMON_LIBRARY=${{github.workspace}}\dependencies\lib\libmumps_common.a ^
257262
-DMUMPS_PORD_LIBRARY=${{github.workspace}}\dependencies\lib\libpord.a ^
258263
-DMUMPS_MPISEQ_LIBRARY=${{github.workspace}}\dependencies\lib\libmpiseq.a ^
259-
-DBLAS_LIBRARIES="${{github.workspace}}\dependencies\lib\libcblas.lib;${{github.workspace}}\dependencies\lib\libblas.lib" ^
264+
-DBLAS_LIBRARIES="${{github.workspace}}\dependencies\lib\libblas.lib" ^
260265
-DLAPACK_LIBRARIES=${{github.workspace}}\dependencies\lib\liblapack.lib ^
266+
-DSPRAL=${{github.workspace}}\dependencies\lib\libspral.a ^
261267
-DBUILD_STATIC_LIBS=ON ^
262268
-DBUILD_SHARED_LIBS=OFF .
263269

.github/workflows/julia-tests-ubuntu.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ jobs:
4343
- uses: julia-actions/cache@v2
4444

4545
- name: Set the environment variables for OpenMP
46+
shell: bash
4647
run: |
47-
echo "OMP_CANCELLATION=TRUE" >> $GITHUB_ENV
48-
echo "OMP_PROC_BIND=TRUE" >> $GITHUB_ENV
48+
echo "OMP_CANCELLATION=TRUE" >> "$GITHUB_ENV"
49+
echo "OMP_PROC_BIND=TRUE" >> "$GITHUB_ENV"
4950
5051
- name: Set the environment variables for BinaryBuilder
5152
run: |
@@ -62,7 +63,7 @@ jobs:
6263
- name: Compile Uno_jll.jl
6364
run: |
6465
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
65-
julia --color=yes .github/julia/build_tarballs_yggdrasil.jl x86_64-linux-gnu-cxx11 --verbose --deploy="local"
66+
julia --color=yes .github/julia/build_tarballs_yggdrasil.jl x86_64-linux-gnu-libgfortran5-cxx11 --verbose --deploy="local"
6667
6768
# Now install a newer version of Julia to actually test Uno_jll.jl.
6869
# We choose v1.10 because it is the current Long-Term Support (LTS).

.github/workflows/julia-tests-unosolver.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ jobs:
4141
- uses: julia-actions/cache@v2
4242

4343
- name: Set the environment variables for OpenMP
44+
shell: bash
4445
run: |
45-
echo "OMP_CANCELLATION=TRUE" >> $GITHUB_ENV
46-
echo "OMP_PROC_BIND=TRUE" >> $GITHUB_ENV
46+
echo "OMP_CANCELLATION=TRUE" >> "$GITHUB_ENV"
47+
echo "OMP_PROC_BIND=TRUE" >> "$GITHUB_ENV"
4748
4849
- name: Set the environment variables for BinaryBuilder
4950
run: |
@@ -60,7 +61,7 @@ jobs:
6061
- name: Compile Uno_jll.jl
6162
run: |
6263
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
63-
julia --color=yes .github/julia/build_tarballs_yggdrasil.jl x86_64-linux-gnu-cxx11 --verbose --deploy="local"
64+
julia --color=yes .github/julia/build_tarballs_yggdrasil.jl x86_64-linux-gnu-libgfortran5-cxx11 --verbose --deploy="local"
6465
# Now install a newer version of Julia to actually test Uno_jll.jl.
6566
# We choose v1.10 because it is the current Long-Term Support (LTS).
6667
- uses: julia-actions/setup-julia@v2

.github/workflows/unit-tests.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ jobs:
104104
mingw-w64-x86_64-make
105105
mingw-w64-x86_64-metis
106106
107+
# ------------------- OpenMP -------------------
108+
- name: Set the environment variables for OpenMP
109+
shell: bash
110+
run: |
111+
echo "OMP_CANCELLATION=TRUE" >> "$GITHUB_ENV"
112+
echo "OMP_PROC_BIND=TRUE" >> "$GITHUB_ENV"
113+
107114
# =========================================================
108115
# DEPENDENCIES
109116
# =========================================================
@@ -132,6 +139,7 @@ jobs:
132139
-DMUMPS_COMMON_LIBRARY=${{github.workspace}}/dependencies/lib/libmumps_common.a \
133140
-DMUMPS_PORD_LIBRARY=${{github.workspace}}/dependencies/lib/libpord.a \
134141
-DMUMPS_MPISEQ_LIBRARY=${{github.workspace}}/dependencies/lib/libmpiseq.a \
142+
-DSPRAL=${{github.workspace}}/dependencies/lib/libspral.a \
135143
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libcblas.a;${{github.workspace}}/dependencies/lib/libblas.a" \
136144
-DLAPACK_LIBRARIES=${{github.workspace}}/dependencies/lib/liblapack.a \
137145
-DHIGHS=${{github.workspace}}/dependencies/lib/libhighs.a \
@@ -162,6 +170,7 @@ jobs:
162170
-DMUMPS_COMMON_LIBRARY=${{github.workspace}}/dependencies/lib/libmumps_common.a \
163171
-DMUMPS_PORD_LIBRARY=${{github.workspace}}/dependencies/lib/libpord.a \
164172
-DMUMPS_MPISEQ_LIBRARY=${{github.workspace}}/dependencies/lib/libmpiseq.a \
173+
-DSPRAL=${{github.workspace}}/dependencies/lib/libspral.a \
165174
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libcblas.a;${{github.workspace}}/dependencies/lib/libblas.a" \
166175
-DLAPACK_LIBRARIES=${{github.workspace}}/dependencies/lib/liblapack.a \
167176
-DHIGHS=${{github.workspace}}/dependencies/lib/libhighs.a \
@@ -187,6 +196,7 @@ jobs:
187196
-DMUMPS_COMMON_LIBRARY=${GITHUB_WORKSPACE}/dependencies/lib/libmumps_common.a \
188197
-DMUMPS_PORD_LIBRARY=${GITHUB_WORKSPACE}/dependencies/lib/libpord.a \
189198
-DMUMPS_MPISEQ_LIBRARY=${GITHUB_WORKSPACE}/dependencies/lib/libmpiseq.a \
199+
-DSPRAL=${{github.workspace}}/dependencies/lib/libspral.a \
190200
-DBLAS_LIBRARIES="${GITHUB_WORKSPACE}/dependencies/lib/libcblas.a;${GITHUB_WORKSPACE}/dependencies/lib/libblas.a" \
191201
-DLAPACK_LIBRARIES=${GITHUB_WORKSPACE}/dependencies/lib/liblapack.a \
192202
-DHIGHS=${GITHUB_WORKSPACE}/dependencies/lib/libhighs.a \

.github/workflows/unopy-test-example.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ jobs:
5353
- name: Compile and install unopy
5454
run: pip install . -v
5555

56+
- name: Set the environment variables for OpenMP
57+
shell: bash
58+
run: |
59+
echo "OMP_CANCELLATION=TRUE" >> "$GITHUB_ENV"
60+
echo "OMP_PROC_BIND=TRUE" >> "$GITHUB_ENV"
61+
5662
- name: Run example
5763
working-directory: ${{github.workspace}}/interfaces/Python/example
58-
run: python example_hs015.py
64+
run: python example_hs015.py

0 commit comments

Comments
 (0)