diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fce6520 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,87 @@ +name: QuadBLAS Testing + +on: + push: + branches: [ ci ] + pull_request: + workflow_dispatch: + +jobs: + test-ubuntu: + name: Test Ubuntu + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake build-essential libomp-dev + + - name: Build SLEEF + run: | + git clone --branch 3.8 --depth 1 https://github.com/shibatch/sleef.git + cd sleef + cmake -S . -B build -DSLEEF_BUILD_QUAD=ON -DSLEEF_BUILD_SHARED_LIBS=ON + cmake --build build --parallel $(nproc) + sudo cmake --install build --prefix /usr/local + + - name: Build QuadBLAS + env: + SLEEF_ROOT: /usr/local + run: | + mkdir build && cd build + cmake .. + make -j$(nproc) + + - name: Run tests + run: | + cd build + ./quadblas_test + + test-macos: + name: Test macOS ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-13, macos-14] + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + brew install cmake libomp + + - name: Install SLEEF + env: + MACOSX_DEPLOYMENT_TARGET: "11.0" + run: | + git clone --branch 3.8 --depth 1 https://github.com/shibatch/sleef.git + cd sleef + cmake -S . -B build \ + -DSLEEF_BUILD_QUAD=ON \ + -DSLEEF_BUILD_SHARED_LIBS=ON \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \ + -DCMAKE_INSTALL_RPATH="@loader_path/../lib" \ + -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON + cmake --build build --clean-first -j + sudo cmake --install build --prefix /usr/local + + - name: Build QuadBLAS + env: + SLEEF_ROOT: /usr/local + DYLD_LIBRARY_PATH: "/usr/local/lib:$DYLD_LIBRARY_PATH" + run: | + mkdir build && cd build + cmake .. + make -j$(sysctl -n hw.ncpu) + + - name: Run tests + env: + DYLD_LIBRARY_PATH: "/usr/local/lib:$DYLD_LIBRARY_PATH" + run: | + cd build + ./quadblas_test \ No newline at end of file diff --git a/include/quadblas/core/platform.hpp b/include/quadblas/core/platform.hpp index d12ab00..5ba2409 100644 --- a/include/quadblas/core/platform.hpp +++ b/include/quadblas/core/platform.hpp @@ -18,4 +18,9 @@ // SLEEF includes #include +// Compatibility for SLEEF_QUAD_C macro +#ifndef SLEEF_QUAD_C + #define SLEEF_QUAD_C(x) Sleef_cast_from_doubleq1(x) +#endif + #endif // QUADBLAS_CORE_PLATFORM_HPP \ No newline at end of file