Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 61 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: libintx CI

on: [push]

env:
CMAKE_BUILD_PARALLEL_LEVEL : 4
on:
pull_request:
push:
branches: [main]

defaults:
run:
Expand All @@ -16,31 +16,74 @@ jobs:
strategy:
fail-fast: false
matrix:
os : [ macos-15 ]
cxx : [ clang++ ]
build_type : [ Debug ]
os :
- ubuntu-latest
- ubuntu-24.04-arm

compiler :
- clang
- gcc

name: "${{ matrix.os }}: ${{ matrix.cxx }} ${{ matrix.build_type }}"
build_type :
# - Debug
- Release

simd:
- ON
- OFF

name: "${{ matrix.os }}: ${{ matrix.compiler }} ${{ matrix.build_type }} ${{matrix.simd == 'ON' && '(simd)' || ''}}"
runs-on: ${{ matrix.os }}
env:
CXX : ${{ matrix.cxx }}
CMAKE_CONFIG : >
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DLIBINTX_MAX_L=2
-DLIBINTX_SIMD=OFF

steps:
- uses: actions/checkout@v3
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.9

- uses: actions/checkout@v4

- name: Set compiler and sccache environment
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV

if [[ "${{ matrix.compiler }}" == "gcc" ]]; then
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
elif [[ "${{ matrix.compiler }}" == "clang" ]]; then
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
else
echo "Unsupported compiler: ${{ matrix.compiler }}"
exit 1
fi

- name: "Configure: ${{ env.CMAKE_CONFIG }}"
- name: Verify compiler
run: |
set -x;
cmake -B${{github.workspace}}/build $CMAKE_CONFIG
$CC --version
$CXX --version

- name: Install Build Dependencies
run: |
set -x;
sudo apt-get update && sudo apt-get install -y \
libopenblas-dev \
liblapacke-dev

- name: Configure
run: |
set -x;
cmake -S . -B ./build -G "Ninja Multi-Config" \
-DLIBINTX_MAX_L=2 \
-DLIBINTX_SIMD=${{matrix.simd}} \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}}


- name: Build
working-directory: ${{github.workspace}}/build
run: |
cmake --build . --target all all.tests
cmake --build . --target all all.tests --config ${{matrix.build_type}}

- name: Test
working-directory: ${{github.workspace}}/build
Expand Down
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ if (TARGET LAPACK::LAPACK)
unset(_lib)
endif()

find_package(LAPACKE QUIET)
if (NOT TARGET LAPACKE::LAPACKE)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LAPACKE_PC lapacke)
if (LAPACKE_PC_FOUND)
message(STATUS "Found LAPACKE via pkg-config")
set(LAPACKE_INCLUDE_DIRS ${LAPACKE_PC_INCLUDE_DIRS})
set(LAPACKE_LIBRARIES ${LAPACKE_PC_LIBRARIES})
else()
message(FATAL_ERROR "LAPACKE not found via find_package or pkg-config")
endif()
endif()

set(LIBINTX_CBLAS_H "" CACHE STRING "")
set(LIBINTX_LAPACKE_H "" CACHE STRING "")
mark_as_advanced(LIBINTX_CBLAS_H LIBINTX_LAPACKE_H)
Expand Down
2 changes: 1 addition & 1 deletion src/libintx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (LIBINTX_APPLE_ACCELERATE)
endif()

if (TARGET LAPACK::LAPACK)
target_link_libraries(libintx.blas LAPACK::LAPACK)
target_link_libraries(libintx.blas LAPACK::LAPACK ${LAPACKE_LIBRARIES})
endif()

install(
Expand Down
Loading