Skip to content

Add precompile header support #34

Add precompile header support

Add precompile header support #34

Workflow file for this run

# Compile and build binaries
#
# For updated Intel OneAPI URLs, see:
# https://github.com/oneapi-src/oneapi-ci/blob/master/.github/workflows/build_all.yml
name: Build binaries (Linux, Mac, Windows)
on:
workflow_dispatch:
push:
env:
WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/2cbb02eb-dd4c-4058-a4ac-2e38729a8409/intel-oneapi-base-toolkit-2025.1.2.7_offline.exe
LINUX_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ac050ae7-da93-4108-823d-4334de3f4ee8/intel-oneapi-base-toolkit-2025.1.2.9_offline.sh
jobs:
#------------------------------------------------
build_linux_dyn_openblas:
name: Linux build (openblas)
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
PKGS: >
libxerces-c-dev xsdcxx libboost-system-dev libboost-filesystem-dev libboost-timer-dev
libboost-thread-dev libboost-program-options-dev libopenblas-dev liblapacke-dev
steps:
- name: Install dependencies
shell: bash
run: |
sudo apt-get install -y ${{ env.PKGS }}
- name: Check branch name
shell: bash
run: echo ${{ env.BRANCH_NAME }}
- uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
- name: Build with CMake
run: |
cmake dynadjust
make -j2
ls
#------------------------------------------------
build_linux_dyn_mkl:
name: Linux build (mkl)
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
PKGS: >
libxerces-c-dev xsdcxx libboost-system-dev libboost-filesystem-dev libboost-timer-dev
libboost-thread-dev libboost-program-options-dev
steps:
- name: Generate cache triggers
shell: bash
run: |
echo ONEAPI_HASH=$(echo "${LINUX_BASEKIT_URL}" | md5sum | cut -f 1 -d" ") >> $GITHUB_ENV
- name: Install dependencies
shell: bash
run: |
sudo apt-get install -y ${{ env.PKGS }}
- name: Cache Intel OneAPI
id: cache-oneapi
uses: actions/cache@v4
with:
path: /opt/intel
key: intel-oneapi-linux-${{ env.ONEAPI_HASH }}
- name: Install Intel OneAPI
if: steps.cache-oneapi.outputs.cache-hit != 'true'
run: |
curl -L $LINUX_BASEKIT_URL -o install.sh
sudo sh install.sh -a --action install --components intel.oneapi.lin.mkl.devel --eula=accept -s
- name: Check branch name
shell: bash
run: echo ${{ env.BRANCH_NAME }}
- uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
- name: Build with CMake
run: |
source /opt/intel/oneapi/setvars.sh
cmake dynadjust
make -j2
#------------------------------------------------
build_linux_static_openblas:
name: Linux build (openblas / static)
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
PKGS: >
xsdcxx libboost-system-dev libboost-filesystem-dev libboost-timer-dev
libboost-thread-dev libboost-program-options-dev libopenblas-dev liblapacke-dev
steps:
- name: Install dependencies
shell: bash
run: sudo apt-get install -y ${{ env.PKGS }}
- name: Check branch name
shell: bash
run: echo ${{ env.BRANCH_NAME }}
- uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
- name: Build static xerces
run: |
XERCES_VERSION=3.2.4
curl -L -O https://archive.apache.org/dist/xerces/c/3/sources/xerces-c-${XERCES_VERSION}.tar.bz2
bzip2 -dc xerces-c-${XERCES_VERSION}.tar.bz2 | tar xvf -
cd xerces-c-${XERCES_VERSION}
PKG_CONFIG="pkg-config --static" ./configure --without-curl --without-icu --enable-static --disable-shared
make -j2
sudo make install
- name: Build with CMake
run: |
cmake -DBUILD_STATIC=ON dynadjust
make -j2
- name: Prepare artifacts
run: |
for f in ./static/*; do strip $f; done
mkdir -p ./zip/dynadjust-linux-static
mv ./static/* ./zip/dynadjust-linux-static
- uses: actions/upload-artifact@v4
with:
name: dynadjust-linux-openblas-static
path: ./zip/
#------------------------------------------------
build_mac_dyn:
name: Mac build (accelerate)
runs-on: macos-15
steps:
- name: Install dependencies
shell: bash
run: brew install boost xerces-c xsd
- name: Check branch name
shell: bash
run: echo ${{ env.BRANCH_NAME }}
- uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
- name: Build with CMake
run: |
cmake dynadjust
make -j2 VERBOSE=1
ls
#------------------------------------------------
build_mac_static:
name: Mac build (accelerate / static)
runs-on: macos-15
steps:
- name: Install dependencies
shell: bash
run: brew install boost xerces-c xsd
- name: Check branch name
shell: bash
run: echo ${{ env.BRANCH_NAME }}
- uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
- name: Build with CMake
run: |
cmake -DBUILD_STATIC=ON dynadjust
make -j2 VERBOSE=1
ls
- uses: actions/upload-artifact@v4
with:
name: dynadjust-macos-static
path: ./static/
#------------------------------------------------
build_windows_dyn_mkl:
name: Windows build (mkl)
runs-on: windows-latest
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
VCPKG_PACKAGES: boost-geometry boost-process boost-iostreams boost-spirit boost-system boost-filesystem boost-timer boost-thread boost-program-options boost-interprocess xerces-c vcpkg-tool-ninja
VCPKG_INSTALLATION_ROOT: "C:/vcpkg"
VCPKG_BINARY_SOURCES: "clear"
steps:
- name: Generate cache triggers
shell: bash
run: |
echo VCPKG_HASH=$(echo "${VCPKG_PACKAGES}" | sed "s/ /_/g" | md5sum | cut -f 1 -d" ") >> $GITHUB_ENV
echo ONEAPI_HASH=$(echo "${WINDOWS_BASEKIT_URL}" | md5sum | cut -f 1 -d" ") >> $GITHUB_ENV
- name: Cache vcpkg
id: cache-vcpkg
uses: actions/cache@v4
with:
path: ${{ env.VCPKG_INSTALLATION_ROOT }}/installed
key: vcpkg-${{ runner.os }}-${{ env.VCPKG_HASH }}
- name: Cache Intel OneAPI
id: cache-oneapi
uses: actions/cache@v4
with:
path: C:\Program Files (x86)\Intel\oneAPI
key: intel-oneapi-${{ env.ONEAPI_HASH }}
- name: Install vcpkg prerequisites
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
shell: powershell
run: |
vcpkg.exe --triplet=x64-windows install ${{ env.VCPKG_PACKAGES }}
Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/.git
Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/buildtrees
Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/downloads
Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/.github
Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/docs
- name: List installed packages
shell: powershell
run: vcpkg.exe list
- name: Install Intel OneAPI
if: steps.cache-oneapi.outputs.cache-hit != 'true'
shell: powershell
run: |
Write-Host "Installing Intel OneAPI..."
$url = $env:WINDOWS_BASEKIT_URL
$components = "intel.oneapi.win.mkl.devel"
$tempExe = Join-Path $env:TEMP "webimage.exe"
Write-Host "Downloading installer from $url..."
curl.exe -L $url -o $tempExe
Write-Host "Extracting installer..."
$installerArgs = "-s -x -f webimage_extracted --log extract.log"
$proc = Start-Process -FilePath $tempExe -ArgumentList $installerArgs -NoNewWindow -Wait -PassThru
Remove-Item $tempExe -Force
$bootstrapperPath = Join-Path -Path (Join-Path $PWD "webimage_extracted") "bootstrapper.exe"
Write-Host "Listing available components..."
$procBootstrap = Start-Process -FilePath $bootstrapperPath -ArgumentList "--list-components" -NoNewWindow -Wait -PassThru -RedirectStandardOutput components
get-content components
Write-Host "Running bootstrapper..."
$bootstrapArgs = "-s --action install --components=$components --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=."
$procBootstrap = Start-Process -FilePath $bootstrapperPath -ArgumentList $bootstrapArgs -NoNewWindow -Wait -PassThru
Remove-Item -Recurse -Force "webimage_extracted"
- name: Check branch name
shell: bash
run: echo ${{ env.BRANCH_NAME }}
- uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
path: "./src"
- name: Download and install xsd
working-directory: "./src"
shell: bash
run: |
curl.exe -L -O https://www.codesynthesis.com/download/xsd/4.2/libxsd-4.2.0.tar.gz
tar zxvf libxsd-4.2.0.tar.gz
- name: Build with CMake
working-directory: "./src"
shell: cmd
run: |
vcpkg.exe integrate install
call "C:\Program Files (x86)\Intel\oneAPI\compiler\2025.1\env\vars.bat"
call "C:\Program Files (x86)\Intel\oneAPI\mkl\2025.1\env\vars.bat"
set XSDROOT=%cd%\libxsd-4.2.0
set VPKG_INCLUDE=${{ env.VCPKG_INSTALLATION_ROOT }}\installed\x64-windows\include
set INCLUDE=%XSDROOT%;%VPKG_INCLUDE%;%INCLUDE%
set UseEnv=true
cmake -DUSE_MKL=ON ^
-DVCPKG_MANIFEST_MODE=OFF ^
-DCMAKE_TOOLCHAIN_FILE"=${{ env.VCPKG_INSTALLATION_ROOT }}/scripts/buildsystems/vcpkg.cmake" ^
-G "Visual Studio 17 2022" -A x64 dynadjust
cmake --build %cd% --config Release --parallel 2
- name: Collate artifacts
shell: bash
run: |
# collating artifacts
mkdir -p release
mkdir -p release/DynAdjust-Windows
echo "Copying files into release folder"
cp -f ./src/x64/Release/*.dll ./release/DynAdjust-Windows/
cp -f ./src/x64/Release/*.exe ./release/DynAdjust-Windows/
- uses: actions/upload-artifact@v4
with:
name: dynadjust-windows-mkl
path: ./release/
#------------------------------------------------
build_windows_dyn_openblas:
name: Windows build (openblas)
runs-on: windows-latest
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
VCPKG_PACKAGES: boost-geometry boost-process boost-iostreams boost-spirit boost-system boost-filesystem boost-timer boost-thread boost-program-options boost-interprocess xerces-c vcpkg-tool-ninja openblas lapack-reference
VCPKG_INSTALLATION_ROOT: "C:/vcpkg"
VCPKG_BINARY_SOURCES: "clear"
steps:
- name: Generate cache triggers
shell: bash
run: |
echo VCPKG_HASH=$(echo "${VCPKG_PACKAGES}" | sed "s/ /_/g" | md5sum | cut -f 1 -d" ") >> $GITHUB_ENV
- name: Cache vcpkg
id: cache-vcpkg
uses: actions/cache@v4
with:
path: ${{ env.VCPKG_INSTALLATION_ROOT }}/installed
key: vcpkg-${{ runner.os }}-openblas-${{ env.VCPKG_HASH }}
- name: Install vcpkg prerequisites
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
shell: powershell
run: |
vcpkg.exe --triplet=x64-windows install ${{ env.VCPKG_PACKAGES }}
Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/.git
Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/buildtrees
Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/downloads
Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/.github
Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/docs
- name: List installed packages
shell: powershell
run: vcpkg.exe list
- name: Check branch name
shell: bash
run: echo ${{ env.BRANCH_NAME }}
- uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
path: "./src"
- name: Download and install xsd
working-directory: "./src"
shell: bash
run: |
curl.exe -L -O https://www.codesynthesis.com/download/xsd/4.2/libxsd-4.2.0.tar.gz
tar zxvf libxsd-4.2.0.tar.gz
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build with CMake
working-directory: "./src"
shell: cmd
run: |
vcpkg.exe integrate install
setx WindowsTargetPlatformVersion 10.0.22621.0
set XSDROOT=%cd%\libxsd-4.2.0
cmake -DUSE_MKL=OFF ^
-DVCPKG_MANIFEST_MODE=OFF ^
-DCMAKE_TOOLCHAIN_FILE"=${{ env.VCPKG_INSTALLATION_ROOT }}/scripts/buildsystems/vcpkg.cmake" ^
-G "Visual Studio 17 2022" -A x64 dynadjust
cmake --build %cd% --config Release --parallel 2
- name: Collate artifacts
shell: bash
run: |
# collating artifacts
mkdir -p release
mkdir -p release/DynAdjust-Windows
echo "Copying files into release folder"
cp -f ./src/x64/Release/*.dll ./release/DynAdjust-Windows/
cp -f ./src/x64/Release/*.exe ./release/DynAdjust-Windows/
- uses: actions/upload-artifact@v4
with:
name: dynadjust-windows-openblas
path: ./release/
#------------------------------------------------
# build_windows_dyn_openblas_mkl_installed:
# name: Test USE_MKL=on/off on Windows
# runs-on: windows-latest
# env:
# BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
# VCPKG_PACKAGES: boost-geometry boost-process boost-iostreams boost-spirit boost-system boost-filesystem boost-timer boost-thread boost-program-options boost-interprocess xerces-c vcpkg-tool-ninja openblas lapack-reference
# VCPKG_INSTALLATION_ROOT: "C:/vcpkg"
# VCPKG_BINARY_SOURCES: "clear"
#
# steps:
#
# - name: Generate cache triggers
# shell: bash
# run: |
# echo VCPKG_HASH=$(echo "${VCPKG_PACKAGES}" | sed "s/ /_/g" | md5sum | cut -f 1 -d" ") >> $GITHUB_ENV
# echo ONEAPI_HASH=$(echo "${WINDOWS_BASEKIT_URL}" | md5sum | cut -f 1 -d" ") >> $GITHUB_ENV
#
# - name: Cache vcpkg
# id: cache-vcpkg
# uses: actions/cache@v4
# with:
# path: ${{ env.VCPKG_INSTALLATION_ROOT }}/installed
# key: vcpkg-${{ runner.os }}-openblas-${{ env.VCPKG_HASH }}
#
# - name: Cache Intel OneAPI
# id: cache-oneapi
# uses: actions/cache@v4
# with:
# path: C:\Program Files (x86)\Intel\oneAPI
# key: intel-oneapi-${{ env.ONEAPI_HASH }}
#
# - name: Install vcpkg prerequisites
# if: steps.cache-vcpkg.outputs.cache-hit != 'true'
# shell: powershell
# run: |
# vcpkg.exe --triplet=x64-windows install ${{ env.VCPKG_PACKAGES }}
# Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/.git
# Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/buildtrees
# Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/downloads
# Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/.github
# Remove-Item -Recurse -Force ${{ env.VCPKG_INSTALLATION_ROOT }}/docs
#
# - name: List installed packages
# shell: powershell
# run: vcpkg.exe list
#
# - name: Install Intel OneAPI
# if: steps.cache-oneapi.outputs.cache-hit != 'true'
# shell: powershell
# run: |
# Write-Host "Installing Intel OneAPI..."
# $url = $env:WINDOWS_BASEKIT_URL
# $components = "intel.oneapi.win.mkl.devel"
# $tempExe = Join-Path $env:TEMP "webimage.exe"
#
# Write-Host "Downloading installer from $url..."
# curl.exe -L $url -o $tempExe
#
# Write-Host "Extracting installer..."
# $installerArgs = "-s -x -f webimage_extracted --log extract.log"
# $proc = Start-Process -FilePath $tempExe -ArgumentList $installerArgs -NoNewWindow -Wait -PassThru
# Remove-Item $tempExe -Force
#
# $bootstrapperPath = Join-Path -Path (Join-Path $PWD "webimage_extracted") "bootstrapper.exe"
#
# Write-Host "Listing available components..."
# $procBootstrap = Start-Process -FilePath $bootstrapperPath -ArgumentList "--list-components" -NoNewWindow -Wait -PassThru -RedirectStandardOutput components
# get-content components
#
# Write-Host "Running bootstrapper..."
# $bootstrapArgs = "-s --action install --components=$components --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=."
# $procBootstrap = Start-Process -FilePath $bootstrapperPath -ArgumentList $bootstrapArgs -NoNewWindow -Wait -PassThru
# Remove-Item -Recurse -Force "webimage_extracted"
#
# - name: Check branch name
# shell: bash
# run: echo ${{ env.BRANCH_NAME }}
#
# - uses: actions/checkout@v4
# with:
# ref: ${{ env.BRANCH_NAME }}
# path: "./src"
#
# - name: Download and install xsd
# working-directory: "./src"
# shell: bash
# run: |
# curl.exe -L -O https://www.codesynthesis.com/download/xsd/4.2/libxsd-4.2.0.tar.gz
# tar zxvf libxsd-4.2.0.tar.gz
#
# - name: Print BLAS and LAPACK function names
# shell: cmd
# run: |
# vcpkg.exe integrate install
# call "C:\Program Files (x86)\Intel\oneAPI\compiler\2025.1\env\vars.bat"
# call "C:\Program Files (x86)\Intel\oneAPI\mkl\2025.1\env\vars.bat"
# dumpbin /EXPORTS C:/vcpkg/installed/x64-windows/debug/lib/openblas.lib
# dumpbin /EXPORTS C:/vcpkg/installed/x64-windows/debug/lib/lapack.lib
#
# - name: Build with OpenBLAS
# working-directory: "./src"
# shell: cmd
# run: |
# vcpkg.exe integrate install
# tree /f "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/"
# set XSDROOT=%cd%\libxsd-4.2.0
# set VPKG_INCLUDE=${{ env.VCPKG_INSTALLATION_ROOT }}\installed\x64-windows\include
# set INCLUDE=%XSDROOT%;%VPKG_INCLUDE%;%INCLUDE%
# set UseEnv=true
# mkdir openblas
# cmake -DUSE_MKL=OFF -DCMAKE_TOOLCHAIN_FILE"=${{ env.VCPKG_INSTALLATION_ROOT }}/scripts/buildsystems/vcpkg.cmake" -G "Visual Studio 17 2022" -A x64 -S dynadjust -B openblas
# cmake --build openblas --config Release --parallel 2
#
# - name: Build with MKL
# working-directory: "./src"
# shell: cmd
# run: |
# vcpkg.exe integrate install
# call "C:\Program Files (x86)\Intel\oneAPI\compiler\2025.1\env\vars.bat"
# call "C:\Program Files (x86)\Intel\oneAPI\mkl\2025.1\env\vars.bat"
# set XSDROOT=%cd%\libxsd-4.2.0
# set VPKG_INCLUDE=${{ env.VCPKG_INSTALLATION_ROOT }}\installed\x64-windows\include
# set INCLUDE=%XSDROOT%;%VPKG_INCLUDE%;%INCLUDE%
# set UseEnv=true
# mkdir mkl
# cmake -DUSE_MKL=ON -DCMAKE_TOOLCHAIN_FILE"=${{ env.VCPKG_INSTALLATION_ROOT }}/scripts/buildsystems/vcpkg.cmake" -G "Visual Studio 17 2022" -A x64 -S dynadjust -B mkl --find-debug
# cmake --build mkl --config Release --parallel 2
#