Skip to content

JOSS paper

JOSS paper #1400

Workflow file for this run

name: Build
on:
push:
branches: [ "main" ]
paths-ignore:
- '*.md'
- 'LICENSE'
- '*.cff'
- '*.yml'
- '*.yaml'
- 'docs/**'
pull_request:
branches: [ "main" ]
paths-ignore:
- '*.md'
- 'LICENSE'
- '*.cff'
- '*.yml'
- '*.yaml'
- 'docs/**'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# ---------- LINUX ----------
- os: ubuntu-latest
toolchain: gcc
build_type: Debug
shell: bash
- os: ubuntu-latest
toolchain: intel
build_type: Debug
shell: bash
- os: ubuntu-24.04-arm
toolchain: gcc
build_type: Debug
shell: bash
# ---------- MACOS ----------
- os: macos-15
toolchain: gcc
build_type: Debug
shell: bash
- os: macos-15-intel
toolchain: gcc
build_type: Debug
shell: bash
# ---------- WINDOWS MINGW ----------
- os: windows-latest
toolchain: mingw
build_type: Debug
shell: msys2 {0}
# -------- Windows MSVC --------
- os: windows-latest
toolchain: msvc
build_type: Debug
shell: cmd
library: static
- os: windows-latest
toolchain: msvc
build_type: Debug
shell: cmd
library: shared
env:
BUILD_TYPE: ${{ matrix.build_type }}
UNO_TOOLCHAIN: ${{ matrix.toolchain }}
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- uses: actions/checkout@v4
# =========================================================
# TOOLCHAIN SETUP
# =========================================================
# ----- Ubuntu + Intel compilers -----
- name: Install compiler (Intel)
if: matrix.toolchain == 'intel'
uses: fortran-lang/setup-fortran@main
with:
compiler: intel
version: '2025.0'
# ----- macOS -----
- name: Install libomp (macOS)
if: startsWith(matrix.os, 'macos')
run: |
brew install libomp
LIBGFORTRAN_FOLDER=$(dirname "$(gfortran-15 -print-file-name=libgfortran.dylib)")
echo "LIBGFORTRAN_FOLDER=$LIBGFORTRAN_FOLDER" >> $GITHUB_ENV
echo "OPENMP_LIB=$(brew --prefix libomp)/lib/libomp.dylib" >> $GITHUB_ENV
# ----- MSVC -----
- name: MSVC environment
if: matrix.toolchain == 'msvc'
uses: ilammy/msvc-dev-cmd@v1
- name: Intel Fortran
if: matrix.toolchain == 'msvc'
uses: fortran-lang/setup-fortran@main
with:
compiler: intel
version: '2025.0'
# ----- MinGW -----
- name: Setup MSYS2
if: matrix.toolchain == 'mingw'
uses: msys2/setup-msys2@v2
with:
path-type: inherit
msystem: MINGW64
update: true
install: |
mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-cmake
mingw-w64-x86_64-make
# =========================================================
# DEPENDENCIES
# =========================================================
- name: Download dependencies (not MinGW)
if: matrix.toolchain != 'mingw'
run: bash dependencies/scripts/download_dependencies.sh
- name: Download dependencies (MinGW)
if: matrix.toolchain == 'mingw'
run: bash dependencies/scripts/download_dependencies.sh
env:
CC: C:/mingw64/bin/gcc.exe
CXX: C:/mingw64/bin/g++.exe
CMAKE_C_COMPILER: C:/mingw64/bin/gcc.exe
CMAKE_CXX_COMPILER: C:/mingw64/bin/g++.exe
# =========================================================
# MSVC: Download BLAS/LAPACK
# =========================================================
- name: Download precompiled LAPACK (MSVC)
if: matrix.toolchain == 'msvc'
shell: cmd
run: |
curl -L -o lapack-msvc-Debug.zip https://gist.github.com/cvanaret/cfc71ec5a63294d44d51e82ba4291f8a/raw/116a2a9e098f4e44c7a767a38ff617becc64469b/lapack-msvc-Debug.zip
tar -xf lapack-msvc-Debug.zip -C ${{github.workspace}}\dependencies
# - name: Build LAPACK (MSVC)
# if: matrix.toolchain == 'msvc'
# shell: cmd
# run: |
# git clone https://github.com/Reference-LAPACK/lapack.git
# cd lapack
# mkdir build
# cd build
# cmake -G "NMake Makefiles" .. ^
# -DCBLAS=ON ^
# -DLAPACKE=OFF ^
# -DCMAKE_INSTALL_PREFIX=${{github.workspace}}\dependencies ^
# -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^
# -DCMAKE_C_COMPILER=cl ^
# -DCMAKE_CXX_COMPILER=cl ^
# -DCMAKE_Fortran_COMPILER=ifx ^
# -DBUILD_SHARED_LIBS=OFF ^
# -DTEST_FORTRAN_COMPILER=OFF
# nmake
# nmake install
#
# - name: Upload LAPACK artifact (MSVC)
# if: matrix.toolchain == 'msvc' && matrix.library == 'static'
# uses: actions/upload-artifact@v4
# with:
# name: lapack-msvc-${{env.BUILD_TYPE}}
# path: ${{github.workspace}}\dependencies
# retention-days: 30
# =========================================================
# CONFIGURE
# =========================================================
- name: Configure (Linux + GCC)
if: startsWith(matrix.os, 'ubuntu') && matrix.toolchain == 'gcc'
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_FORTRAN_COMPILER=gfortran \
-DMUMPS_INCLUDE_DIR=${{github.workspace}}/dependencies/include \
-DMETIS_INCLUDE_DIR=${{github.workspace}}/dependencies/include \
-DHIGHS_INCLUDE_DIR=${{github.workspace}}/dependencies/include/highs \
-DBQPD=${{github.workspace}}/dependencies/lib/libbqpd.a \
-DMETIS_LIBRARY=${{github.workspace}}/dependencies/lib/libmetis.a \
-DMUMPS_LIBRARY=${{github.workspace}}/dependencies/lib/libdmumps.a \
-DMUMPS_COMMON_LIBRARY=${{github.workspace}}/dependencies/lib/libmumps_common.a \
-DMUMPS_PORD_LIBRARY=${{github.workspace}}/dependencies/lib/libpord.a \
-DMUMPS_MPISEQ_LIBRARY=${{github.workspace}}/dependencies/lib/libmpiseq.a \
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libcblas.a;${{github.workspace}}/dependencies/lib/libblas.a" \
-DLAPACK_LIBRARIES=${{github.workspace}}/dependencies/lib/liblapack.a \
-DHIGHS="${{github.workspace}}/dependencies/lib/libhighs.a;${{github.workspace}}/dependencies/lib/libhighs_extras.a" \
-DBUILD_STATIC_LIBS=ON \
-DBUILD_SHARED_LIBS=ON
- name: Configure (Linux + Intel)
if: startsWith(matrix.os, 'ubuntu') && matrix.toolchain == 'intel'
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_C_COMPILER=icx \
-DCMAKE_CXX_COMPILER=icpx \
-DCMAKE_FORTRAN_COMPILER=ifx \
-DMUMPS_INCLUDE_DIR=${{github.workspace}}/dependencies/include \
-DMETIS_INCLUDE_DIR=${{github.workspace}}/dependencies/include \
-DHIGHS_INCLUDE_DIR=${{github.workspace}}/dependencies/include/highs \
-DBQPD=${{github.workspace}}/dependencies/lib/libbqpd.a \
-DMETIS_LIBRARY=${{github.workspace}}/dependencies/lib/libmetis.a \
-DMUMPS_LIBRARY=${{github.workspace}}/dependencies/lib/libdmumps.a \
-DMUMPS_COMMON_LIBRARY=${{github.workspace}}/dependencies/lib/libmumps_common.a \
-DMUMPS_PORD_LIBRARY=${{github.workspace}}/dependencies/lib/libpord.a \
-DMUMPS_MPISEQ_LIBRARY=${{github.workspace}}/dependencies/lib/libmpiseq.a \
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libcblas.a;${{github.workspace}}/dependencies/lib/libblas.a" \
-DLAPACK_LIBRARIES=${{github.workspace}}/dependencies/lib/liblapack.a \
-DHIGHS="${{github.workspace}}/dependencies/lib/libhighs.a;${{github.workspace}}/dependencies/lib/libhighs_extras.a" \
-DBUILD_STATIC_LIBS=ON \
-DBUILD_SHARED_LIBS=ON
- name: Configure (Mac)
if: startsWith(matrix.os, 'macos')
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_Fortran_COMPILER=gfortran-15 \
-DCMAKE_EXE_LINKER_FLAGS="-L${{env.LIBGFORTRAN_FOLDER}}" \
-DCMAKE_SHARED_LINKER_FLAGS="-L${{env.LIBGFORTRAN_FOLDER}}" \
-DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp" \
-DOpenMP_C_LIB_NAMES="omp" \
-DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp" \
-DOpenMP_CXX_LIB_NAMES="omp" \
-DOpenMP_omp_LIBRARY=${{ env.OPENMP_LIB }} \
-DMUMPS_INCLUDE_DIR=${{github.workspace}}/dependencies/include \
-DMETIS_INCLUDE_DIR=${{github.workspace}}/dependencies/include \
-DHIGHS_INCLUDE_DIR=${{github.workspace}}/dependencies/include/highs \
-DBQPD=${{github.workspace}}/dependencies/lib/libbqpd.a \
-DMETIS_LIBRARY=${{github.workspace}}/dependencies/lib/libmetis.a \
-DMUMPS_LIBRARY=${{github.workspace}}/dependencies/lib/libdmumps.a \
-DMUMPS_COMMON_LIBRARY=${{github.workspace}}/dependencies/lib/libmumps_common.a \
-DMUMPS_PORD_LIBRARY=${{github.workspace}}/dependencies/lib/libpord.a \
-DMUMPS_MPISEQ_LIBRARY=${{github.workspace}}/dependencies/lib/libmpiseq.a \
-DBLAS_LIBRARIES="${{github.workspace}}/dependencies/lib/libcblas.a;${{github.workspace}}/dependencies/lib/libblas.a" \
-DLAPACK_LIBRARIES=${{github.workspace}}/dependencies/lib/liblapack.a \
-DHIGHS="${{github.workspace}}/dependencies/lib/libhighs.a;${{github.workspace}}/dependencies/lib/libhighs_extras.a" \
-DBUILD_STATIC_LIBS=ON \
-DBUILD_SHARED_LIBS=ON
# ----- MinGW -----
- name: Configure (MinGW)
if: matrix.toolchain == 'mingw'
shell: cmd
run: |
cmake -G "MinGW Makefiles" ^
-B build ^
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^
-DMUMPS_INCLUDE_DIR=${{github.workspace}}\dependencies\include ^
-DMETIS_INCLUDE_DIR=${{github.workspace}}\dependencies\include ^
-DHIGHS_INCLUDE_DIR=${{github.workspace}}\dependencies\include\highs ^
-DBQPD=${{github.workspace}}\dependencies\lib\libbqpd.a ^
-DMETIS_LIBRARY=${{github.workspace}}\dependencies\bin\libmetis.dll ^
-DMUMPS_LIBRARY=${{github.workspace}}\dependencies\lib\libdmumps.a ^
-DMUMPS_COMMON_LIBRARY=${{github.workspace}}\dependencies\lib\libmumps_common.a ^
-DMUMPS_PORD_LIBRARY=${{github.workspace}}\dependencies\lib\libpord.a ^
-DMUMPS_MPISEQ_LIBRARY=${{github.workspace}}\dependencies\lib\libmpiseq.a ^
-DBLAS_LIBRARIES="${{github.workspace}}\dependencies\lib\libcblas.a;${{github.workspace}}\dependencies\lib\libblas.a" ^
-DLAPACK_LIBRARIES=${{github.workspace}}\dependencies\lib\liblapack.a ^
-DHIGHS="${{github.workspace}}\dependencies\lib\libhighs.a;${{github.workspace}}\dependencies\lib\libhighs_extras.a" ^
-DBUILD_STATIC_LIBS=ON ^
-DBUILD_SHARED_LIBS=ON .
# ----- MSVC -----
- name: Configure (MSVC static)
if: matrix.toolchain == 'msvc' && matrix.library == 'static'
shell: cmd
run: |
cmake -G "NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^
-DCMAKE_C_COMPILER=cl ^
-DCMAKE_CXX_COMPILER=cl ^
-DCMAKE_Fortran_COMPILER=ifx ^
-DMUMPS_INCLUDE_DIR=${{github.workspace}}\dependencies\include ^
-DMETIS_INCLUDE_DIR=${{github.workspace}}\dependencies\include ^
-DBQPD=${{github.workspace}}\dependencies\lib\libbqpd.a ^
-DMETIS_LIBRARY=${{github.workspace}}\dependencies\lib\libmetis.a ^
-DMUMPS_LIBRARY=${{github.workspace}}\dependencies\lib\libdmumps.a ^
-DMUMPS_COMMON_LIBRARY=${{github.workspace}}\dependencies\lib\libmumps_common.a ^
-DMUMPS_PORD_LIBRARY=${{github.workspace}}\dependencies\lib\libpord.a ^
-DMUMPS_MPISEQ_LIBRARY=${{github.workspace}}\dependencies\lib\libmpiseq.a ^
-DBLAS_LIBRARIES="${{github.workspace}}\dependencies\lib\libcblas.lib;${{github.workspace}}\dependencies\lib\libblas.lib" ^
-DLAPACK_LIBRARIES=${{github.workspace}}\dependencies\lib\liblapack.lib ^
-DBUILD_STATIC_LIBS=ON ^
-DBUILD_SHARED_LIBS=OFF .
- name: Configure (MSVC shared)
if: matrix.toolchain == 'msvc' && matrix.library == 'shared'
shell: cmd
run: |
cmake -G "NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^
-DCMAKE_C_COMPILER=cl ^
-DCMAKE_CXX_COMPILER=cl ^
-DCMAKE_Fortran_COMPILER=ifx ^
-DBLAS_LIBRARIES="${{github.workspace}}\dependencies\lib\libcblas.lib;${{github.workspace}}\dependencies\lib\libblas.lib" ^
-DLAPACK_LIBRARIES=${{github.workspace}}\dependencies\lib\liblapack.lib ^
-DBUILD_STATIC_LIBS=OFF ^
-DBUILD_SHARED_LIBS=ON .
# =========================================================
# BUILD
# =========================================================
- name: Build (not MSVC)
if: matrix.toolchain != 'msvc'
run: cmake --build build --config ${{env.BUILD_TYPE}} --parallel
- name: Build (MSVC)
if: matrix.toolchain == 'msvc'
run: nmake
# Compile-check both HSL modes: linked (OFF) and IPOPT-style dlopen runtime loading (ON).
# No HSL library is needed — OFF builds without HSL, ON compiles the loader + MA27/MA57.
hsl-runtime-loading:
name: Compile Uno (HSL_RUNTIME_LOADING=${{ matrix.mode }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mode: [ON, OFF]
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake gfortran libblas-dev liblapack-dev g++-mingw-w64-x86-64
# Shared only: a static build just archives objects without linking, so it would not
# catch an unresolved LIBHSL_isfunctional / MA27/MA57 symbol. Only shared links.
- name: Configure and build (native Linux, shared)
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DHSL_RUNTIME_LOADING=${{ matrix.mode }} \
-DBUILD_STATIC_LIBS=OFF \
-DBUILD_SHARED_LIBS=ON
cmake --build build --parallel
# A native Linux build never compiles the loader's Windows branch (LoadLibraryA/
# GetProcAddress). Syntax-check it with MinGW so ON stays buildable on Windows.
- name: Compile-check the Windows dlopen branch (MinGW)
if: matrix.mode == 'ON'
run: |
x86_64-w64-mingw32-g++ -std=c++17 -DHSL_RUNTIME_LOADING -Iuno -fsyntax-only \
uno/ingredients/subproblem_solvers/HSL/HSLLoader.cpp