Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
barne856 committed Jul 23, 2024
1 parent 2cd1839 commit b3a604f
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
strategy:
matrix:
compiler: [g++-12, clang++-17]
stdlib: [libstdc++, libc++]
blas_backend: [OpenBLAS, MKL]

steps:
- uses: actions/checkout@v4
Expand All @@ -30,18 +32,22 @@ jobs:
else
sudo apt-get install -y ${{ matrix.compiler }} gfortran gcc
fi
if [[ "${{ matrix.blas_backend }}" == "OpenBLAS" ]]; then
sudo apt-get install -y libopenblas-dev
else
sudo apt-get install -y intel-mkl
fi
- name: Configure CMake
env:
CXX: ${{ matrix.compiler }}
run: |
if [[ "${{ matrix.compiler }}" == clang++* ]]; then
if [[ "${{ matrix.compiler }}" == clang++* ]] && [[ "${{ matrix.stdlib }}" == "libc++" ]]; then
CLANG_VERSION=$(echo "${{ matrix.compiler }}" | sed 's/clang++-//')
export CXXFLAGS="-stdlib=libc++"
cmake -B ${{github.workspace}}/build -G Ninja -DSQUINT_BUILD_TESTS=ON -DCMAKE_CXX_FLAGS="$CXXFLAGS"
else
cmake -B ${{github.workspace}}/build -G Ninja -DSQUINT_BUILD_TESTS=ON
export CXXFLAGS="-stdlib=libc++ -nostdinc++ -I/usr/lib/llvm-$CLANG_VERSION/include/c++/v1"
export LDFLAGS="-L/usr/lib/llvm-$CLANG_VERSION/lib"
fi
cmake -B ${{github.workspace}}/build -G Ninja -DSQUINT_BUILD_TESTS=ON -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_CXX_FLAGS="$CXXFLAGS" -DBLAS_BACKEND=${{ matrix.blas_backend }}
- name: Build
run: cmake --build ${{github.workspace}}/build
Expand All @@ -53,10 +59,15 @@ jobs:
build-and-test-windows:
name: Build and Test (Windows)
runs-on: windows-latest
strategy:
matrix:
compiler: [clang++]
stdlib: [libstdc++, libc++]
blas_backend: [OpenBLAS, MKL]
defaults:
run:
shell: pwsh

steps:
- uses: actions/checkout@v4

Expand All @@ -76,13 +87,26 @@ jobs:
channels: conda-forge

- name: Install MKL
if: matrix.blas_backend == 'MKL'
run: |
conda install -c https://software.repos.intel.com/python/conda/ -c conda-forge mkl mkl-devel
- name: Install OpenBLAS dependencies
if: matrix.blas_backend == 'OpenBLAS'
run: |
conda install -c conda-forge openblas
choco install mingw
- name: Configure CMake
run: |
$env:PATH = "$env:CONDA\Scripts;$env:PATH"
cmake -B ${{github.workspace}}/build -G Ninja -DSQUINT_BUILD_TESTS=ON -DBLAS_BACKEND=MKL -DCMAKE_CXX_COMPILER=clang++
if (${{ matrix.stdlib }} -eq 'libc++') {
$CLANG_VERSION = ${{ matrix.compiler }} -replace 'clang\+\+', ''
$env:CXXFLAGS = "-stdlib=libc++ -nostdinc++ -I${env:CONDA}\\Library\\lib\\clang\\$CLANG_VERSION\\include\\c++\\v1"
$env:LDFLAGS = "-L${env:CONDA}\\Library\\lib"
}
$env:FC = "gfortran"
cmake -B ${{github.workspace}}/build -G Ninja -DSQUINT_BUILD_TESTS=ON -DBLAS_BACKEND=${{ matrix.blas_backend }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS="$env:CXXFLAGS" -DCMAKE_Fortran_COMPILER=$env:FC
- name: Build
run: |
Expand Down Expand Up @@ -113,7 +137,8 @@ jobs:
env:
CXX: clang++-17
run: |
export CXXFLAGS="-stdlib=libc++"
export CXXFLAGS="-stdlib=libc++ -nostdinc++ -I/usr/lib/llvm-17/include/c++/v1"
export LDFLAGS="-L/usr/lib/llvm-17/lib"
cmake -B ${{github.workspace}}/build -G Ninja -DSQUINT_BUILD_TESTS=ON -DCMAKE_CXX_FLAGS="$CXXFLAGS" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Build
Expand All @@ -130,4 +155,3 @@ jobs:
if [ $? -ne 0 ]; then
echo "Clang-Tidy found issues. Please fix them before merging."
exit 1
fi

0 comments on commit b3a604f

Please sign in to comment.