Skip to content

[WIP] Refactor sparse drivers #285

[WIP] Refactor sparse drivers

[WIP] Refactor sparse drivers #285

Workflow file for this run

name: Build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
build_type: [Debug, Release]
c_compiler: [gcc, clang]
cpp_compiler: [g++, clang++]
build_shared_libs: [true, false]
include:
# macOS: only use clang/clang++
- os: macos-latest
build_type: Debug
c_compiler: clang
cpp_compiler: clang++
build_shared_libs: true
- os: macos-latest
build_type: Release
c_compiler: clang
cpp_compiler: clang++
build_shared_libs: true
- os: macos-latest
build_type: Debug
c_compiler: clang
cpp_compiler: clang++
build_shared_libs: false
- os: macos-latest
build_type: Release
c_compiler: clang
cpp_compiler: clang++
build_shared_libs: false
# Windows: only use MSVC
- os: windows-latest
build_type: Debug
c_compiler: msvc
cpp_compiler: msvc
build_shared_libs: true
- os: windows-latest
build_type: Release
c_compiler: msvc
cpp_compiler: msvc
build_shared_libs: true
- os: windows-latest
build_type: Debug
c_compiler: msvc
cpp_compiler: msvc
build_shared_libs: false
- os: windows-latest
build_type: Release
c_compiler: msvc
cpp_compiler: msvc
build_shared_libs: false
steps:
- uses: actions/checkout@v4
# set up OpenMp for ColPack
- name: Install OpenMP (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install libomp-dev
- name: Install libomp (macOS)
if: startsWith(matrix.os, 'macos')
run: |
brew install libomp
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure and build ADOL-C (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DENABLE_DOCEXA=1
-DENABLE_ADDEXA=1
-DENABLE_SPARSE=1
-DBUILD_SHARED_LIBS=${{ matrix.build_shared_libs }}
-S ${{ github.workspace }}
- name: Configure and build ADOL-C (MacOs)
if: startsWith(matrix.os, 'macos')
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DOpenMP_C_FLAGS="-Xclang -fopenmp -I/opt/homebrew/opt/libomp/include"
-DOpenMP_C_LIB_NAMES="omp"
-DOpenMP_CXX_FLAGS="-Xclang -fopenmp -I/opt/homebrew/opt/libomp/include"
-DOpenMP_CXX_LIB_NAMES="omp"
-DOpenMP_omp_LIBRARY="/opt/homebrew/opt/libomp/lib/libomp.dylib"
-DENABLE_DOCEXA=1
-DENABLE_ADDEXA=1
-DENABLE_SPARSE=1
-DBUILD_SHARED_LIBS=${{ matrix.build_shared_libs }}
-S ${{ github.workspace }}
# we don't use sparse drivers on windows!
- name: Configure and build ADOL-C (Windows)
if: startsWith(matrix.os, 'windows')
shell: powershell
run:
# Setup Visual Studio build environment
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DENABLE_DOCEXA=1
-DENABLE_ADDEXA=1
-DBUILD_SHARED_LIBS=${{ matrix.build_shared_libs }}
-S ${{ github.workspace }}
- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}