Skip to content

Add solve based on OpenBLAS #710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Use OpenBLAS in Linux/MINGW CI
  • Loading branch information
zoziha committed May 6, 2023
commit 2aedbcd34786c555c41b819f3502af2c2b3b59c3
33 changes: 33 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ jobs:
brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true
brew link gcc@${GCC_V}

- name: Install OpenBLAS Linux
if: contains( matrix.os, 'ubuntu')
run: |
sudo apt-get install pkg-config
sudo apt-get install libopenblas-dev

- name: Configure with CMake
if: ${{ contains(matrix.build, 'cmake') }}
run: >-
Expand All @@ -71,14 +77,32 @@ jobs:
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
-S . -B ${{ env.BUILD_DIR }}

- name: Configure with CMake and OpenBLAS
if: ${{ contains(matrix.build, 'cmake') && contains( matrix.os, 'ubuntu') }}
run: >-
cmake -Wdev
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_MAXIMUM_RANK:String=4
-DBUILD_OPENBLAS=ON
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
-S . -B build_with_openblas

- name: Build and compile
if: ${{ contains(matrix.build, 'cmake') }}
run: cmake --build ${{ env.BUILD_DIR }} --parallel

- name: Build and compile with OpenBLAS
if: ${{ contains(matrix.build, 'cmake') && contains( matrix.os, 'ubuntu') }}
run: cmake --build build_with_openblas --parallel

- name: catch build fail
run: cmake --build ${{ env.BUILD_DIR }} --verbose --parallel 1
if: ${{ failure() && contains(matrix.build, 'cmake') }}

- name: catch build fail with OpenBLAS
run: cmake --build build_with_openblas --verbose --parallel 1
if: ${{ failure() && contains(matrix.build, 'cmake') && contains( matrix.os, 'ubuntu') }}

- name: test
if: ${{ contains(matrix.build, 'cmake') }}
run: >-
Expand All @@ -88,6 +112,15 @@ jobs:
--output-on-failure
--no-tests=error

- name: test with OpenBLAS
if: ${{ contains(matrix.build, 'cmake') && contains( matrix.os, 'ubuntu') }}
run: >-
ctest
--test-dir build_with_openblas
--parallel
--output-on-failure
--no-tests=error

- name: Install project
if: ${{ contains(matrix.build, 'cmake') }}
run: cmake --install ${{ env.BUILD_DIR }}
Expand Down
35 changes: 34 additions & 1 deletion .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
mingw-w64-${{ matrix.arch }}-python-setuptools
mingw-w64-${{ matrix.arch }}-cmake
mingw-w64-${{ matrix.arch }}-ninja
mingw-w64-${{ matrix.arch }}-pkg-config
mingw-w64-${{ matrix.arch }}-openblas

- name: Setup msys POSIX environment
uses: msys2/setup-msys2@v2
Expand All @@ -57,7 +59,8 @@ jobs:
- name: Install fypp
run: pip install fypp

- run: >-
- name: CMake configuration
run: >-
cmake
-Wdev
-B build
Expand Down Expand Up @@ -88,3 +91,33 @@ jobs:

- name: Install project
run: cmake --install build

- name: CMake configuration with OpenBLAS
if: contains(matrix.msystem, 'MINGW')
run: >-
cmake
-Wdev
-B build_with_openblas
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_Fortran_FLAGS_DEBUG="-Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all -fbacktrace"
-DCMAKE_MAXIMUM_RANK:String=4
-DBUILD_OPENBLAS=ON
-DCMAKE_INSTALL_PREFIX=$PWD/_dist

- name: CMake build with OpenBLAS
if: contains(matrix.msystem, 'MINGW')
run: cmake --build build_with_openblas --parallel

- name: catch build fail with OpenBLAS
if: failure() && contains(matrix.msystem, 'MINGW')
run: cmake --build build_with_openblas --verbose --parallel 1

- name: CTest with OpenBLAS
if: contains(matrix.msystem, 'MINGW')
run: ctest --test-dir build_with_openblas --output-on-failure --parallel -V -LE quadruple_precision

- uses: actions/upload-artifact@v1
if: failure() && contains(matrix.msystem, 'MINGW')
with:
name: WindowsCMakeTestlog
path: build_with_openblas/Testing/Temporary/LastTest.log
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ list(
"-DPROJECT_VERSION_PATCH=${PROJECT_VERSION_PATCH}"
)

if(NOT DEFINED BUILD_OPENBLAS)
set(BUILD_OPENBLAS OFF CACHE BOOL "Use routines based on OpenBLAS")
endif()
option(BUILD_OPENBLAS "Use routines based on OpenBLAS" OFF)
if(BUILD_OPENBLAS)
find_package(PkgConfig REQUIRED)
pkg_check_modules(OPENBLAS REQUIRED openblas)
Expand Down