Skip to content

Development happens here #507

Development happens here

Development happens here #507

Workflow file for this run

name: build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "*" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-15, macos-15-intel, windows-latest]
build_type: [Release]
build_shared_libs: [OFF, ON]
extra_synth: [ON, OFF]
exclude:
# Windows build uses MSYS2 MinGW and skips the heavy ML deps
# (armadillo/ensmallen/mlpack/EvalMaxSAT) that EXTRA_SYNTH needs.
- os: windows-latest
extra_synth: ON
# Windows only builds statically: the shared build scatters DLLs
# across _deps subdirs so arjun.exe can't find them at runtime.
- os: windows-latest
build_shared_libs: ON
steps:
- name: Set up MSYS2
if: contains(matrix.os, 'windows')
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-gmp
mingw-w64-x86_64-mpfr
mingw-w64-x86_64-zlib
mingw-w64-x86_64-pkgconf
make
- uses: actions/setup-python@v5
if: "!contains(matrix.os, 'windows')"
with:
python-version: '3.10'
- name: Install python dependencies
if: "!contains(matrix.os, 'windows')"
run: |
pip install numpy lit
- name: Install gmp for Mac
if: contains(matrix.os, 'macos')
run: |
wget https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz
tar xf gmp-6.3.0.tar.xz
cd gmp-6.3.0
./configure --enable-static --enable-cxx --enable-shared --with-pic
make -j8
sudo make install
cd ..
- name: Install zlib for Mac dynamic
if: contains(matrix.os, 'macos') && matrix.build_shared_libs == 'ON'
run: |
wget https://zlib.net/fossils/zlib-1.3.1.tar.gz
tar xzvf zlib-1.3.1.tar.gz
cd zlib-1.3.1
./configure
make -j8
sudo make install
cd ..
- name: Install zlib for Mac static
if: contains(matrix.os, 'macos') && matrix.build_shared_libs == 'OFF'
run: |
wget https://zlib.net/fossils/zlib-1.3.1.tar.gz
tar xzvf zlib-1.3.1.tar.gz
cd zlib-1.3.1
./configure --static
make -j8
sudo make install
cd ..
- name: Install mpfr for Mac
if: contains(matrix.os, 'macos')
run: |
wget https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.1.tar.xz
tar xf mpfr-4.2.1.tar.xz
cd mpfr-4.2.1
./configure --enable-static --enable-cxx --enable-shared
make -j8
sudo make install
cd ..
- name: Install dependencies for Linux
if: contains(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -yq help2man libgmp-dev libmpfr-dev perl
- name: Setup ccache
if: "!contains(matrix.os, 'windows')"
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.build_shared_libs }}-${{ matrix.extra_synth }}
max-size: 500M
- name: Checkout & build cereal
if: matrix.extra_synth == 'ON'
run: |
wget https://github.com/USCiLab/cereal/archive/v1.3.2.tar.gz
tar xvf v1.3.2.tar.gz
# Fix cereal compilation on clang 19+; see
# https://github.com/USCiLab/cereal/pull/835
if sed --version >/dev/null 2>&1; then
# GNU sed (Linux)
sed -i 's|::template apply|::apply|' cereal-1.3.2/include/cereal/types/tuple.hpp
else
# BSD sed (macOS)
sed -i '' 's|::template apply|::apply|' cereal-1.3.2/include/cereal/types/tuple.hpp
fi
cd cereal-1.3.2
mkdir build
cd build
cmake -DJUST_INSTALL_CEREAL=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
make -j6
sudo make install
cd ..
- name: Checkout armadillo dynamic
if: matrix.extra_synth == 'ON' && matrix.build_shared_libs == 'ON'
run: |
wget https://sourceforge.net/projects/arma/files/armadillo-14.0.2.tar.xz
tar xvf armadillo-14.0.2.tar.xz
cd armadillo-14.0.2/
mkdir build && cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
make -j6
sudo make install
cd ../..
- name: Checkout armadillo static
if: matrix.extra_synth == 'ON' && matrix.build_shared_libs == 'OFF'
run: |
wget https://sourceforge.net/projects/arma/files/armadillo-14.0.2.tar.xz
tar xvf armadillo-14.0.2.tar.xz
cd armadillo-14.0.2/
mkdir build && cd build
cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
make -j6
sudo make install
cd ../..
- name: Checkout & build ensmallen
if: matrix.extra_synth == 'ON'
run: |
wget https://github.com/mlpack/ensmallen/archive/refs/tags/2.22.2.tar.gz
- name: Build ensmallen
if: matrix.extra_synth == 'ON'
run: |
tar xvf 2.22.2.tar.gz
cd ensmallen-2.22.2
mkdir build
cd build
cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
cmake --build . --config ${{matrix.build_type}} -v
sudo cmake --install . --config ${{matrix.build_type}} -v
cd ../..
- name: Checkout mlpack
if: matrix.extra_synth == 'ON'
uses: actions/checkout@v4
with:
repository: mlpack/mlpack
ref: 4.6.2
path: mlpack
- name: Build mlpack
if: matrix.extra_synth == 'ON'
run: |
cd mlpack
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_CLI_EXECUTABLES=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
cmake --build . --config ${{matrix.build_type}} -v
sudo make install
cd ../..
- uses: actions/checkout@v4
with:
path: project
submodules: 'true'
- name: Build project (non-Windows)
if: "!contains(matrix.os, 'windows')"
run: |
cd project
mkdir -p build && cd build
cmake \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_SHARED_LIBS=${{ matrix.build_shared_libs }} \
-DEXTRA_SYNTH=${{ matrix.extra_synth }} \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-S ..
cmake --build . --config ${{matrix.build_type}} -v
- name: Build project (Windows)
if: contains(matrix.os, 'windows')
shell: msys2 {0}
run: |
cd project
mkdir -p build && cd build
cmake \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_SHARED_LIBS=${{ matrix.build_shared_libs }} \
-DEXTRA_SYNTH=${{ matrix.extra_synth }} \
-G Ninja \
-S ..
cmake --build . --config ${{matrix.build_type}} -v
- name: Test
if: "!contains(matrix.os, 'windows')"
run: ctest -C ${{matrix.build_type}} --verbose
- name: run it to check it executes (non-Windows)
if: "!contains(matrix.os, 'windows')"
run: |
echo "Running version command"
./project/build/arjun --version
echo $?
echo "Running help command"
./project/build/arjun --help
echo $?
- name: run it to check it executes (Windows)
if: contains(matrix.os, 'windows')
shell: msys2 {0}
run: |
EXE=./project/build/arjun.exe
echo "Running: $EXE --version"
$EXE --version
echo $?
echo "Running: $EXE --help"
$EXE --help
echo $?
- name: Upload Artifact - Linux
if: contains(matrix.os, 'ubuntu') && matrix.build_shared_libs == 'OFF' && !contains(matrix.os, 'arm') && matrix.extra_synth == 'ON'
uses: actions/upload-artifact@v4
with:
name: arjun-linux-amd64
path: |
project/build/arjun
project/build/test-synth
project/build/lib/*
project/build/include/*
- name: Upload Artifact - Linux arm
if: contains(matrix.os, 'ubuntu') && matrix.build_shared_libs == 'OFF' && contains(matrix.os, 'arm') && matrix.extra_synth == 'ON'
uses: actions/upload-artifact@v4
with:
name: arjun-linux-arm64
path: |
project/build/arjun
project/build/test-synth
project/build/lib/*
project/build/include/*
- name: Upload Artifact - Mac arm
if: matrix.os == 'macos-15' && matrix.build_shared_libs == 'OFF' && matrix.extra_synth == 'ON'
uses: actions/upload-artifact@v4
with:
name: arjun-mac-arm64
path: |
project/build/arjun
project/build/test-synth
project/build/lib/*
project/build/include/*
- name: Upload Artifact - Mac x86
if: matrix.os == 'macos-15-intel' && matrix.build_shared_libs == 'OFF' && matrix.extra_synth == 'ON'
uses: actions/upload-artifact@v4
with:
name: arjun-mac-x86_64
path: |
project/build/arjun
project/build/test-synth
project/build/lib/*
project/build/include/*
- name: Upload Artifact - Windows
if: matrix.os == 'windows-latest' && matrix.build_shared_libs == 'OFF'
uses: actions/upload-artifact@v4
with:
name: arjun-windows-x86_64
path: |
project/build/arjun.exe
project/build/test-synth.exe
project/build/lib/*
project/build/include/*