From 036684204e01a28bd8056a8c63c91948f3c39006 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Sun, 21 May 2023 17:07:31 +0200 Subject: [PATCH] Github Actions Windows builds with tests (#472) * Set CMake CMP0074 policy * Attempt to use pre-compiled OpenBLAS on Windows CI * Fix an issue and add some debugging * Improve FindCBLAS for OpenBLAS on Windows --- .github/workflows/build_and_test.yml | 10 ++++++++-- CMakeLists.txt | 3 +++ cmake/Modules/FindCBLAS.cmake | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 2d74ed24..e1f59a0e 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -75,13 +75,19 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 - name: Install OpenBLAS - run: vcpkg.exe --triplet=${{ matrix.config.arch }}-windows install openblas + run: | + mkdir openblas + cd openblas + C:\msys64\usr\bin\wget.exe https://github.com/xianyi/OpenBLAS/releases/download/v0.3.23/OpenBLAS-0.3.23-x64.zip + 7z x OpenBLAS-0.3.23-x64.zip + pwd + ls - name: Install OpenCL run: vcpkg.exe --triplet=${{ matrix.config.arch }}-windows install opencl - name: Run CMake - run: cmake -S . -B build -DTESTS=ON -DCLIENTS=ON -DSAMPLES=ON -DOPENCL_ROOT=C:/vcpkg/packages/opencl_x64-windows -DCBLAS_ROOT=C:/vcpkg/packages/openblas_x64-windows + run: cmake -S . -B build -DTESTS=ON -DCLIENTS=ON -DSAMPLES=ON -DOPENCL_ROOT=C:\vcpkg\packages\opencl_x64-windows -DCBLAS_ROOT=${{ github.workspace }}\openblas - name: Compile the code run: cmake --build build diff --git a/CMakeLists.txt b/CMakeLists.txt index 169e6852..8e60bf22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,9 @@ set(clblast_VERSION_PATCH 3) set(clblast_VERSION "${clblast_VERSION_MAJOR}.${clblast_VERSION_MINOR}.${clblast_VERSION_PATCH}") set(clblast_SOVERSION ${clblast_VERSION_MAJOR}) +# Policies +cmake_policy(SET CMP0074 NEW) # to make -DCBLAS_ROOT= work with newer CMake versions as well + # Options and their default values option(BUILD_SHARED_LIBS "Build a shared (ON) or static library (OFF)" ON) option(SAMPLES "Enable compilation of the examples" OFF) diff --git a/cmake/Modules/FindCBLAS.cmake b/cmake/Modules/FindCBLAS.cmake index fa97ce9f..ee6419e6 100644 --- a/cmake/Modules/FindCBLAS.cmake +++ b/cmake/Modules/FindCBLAS.cmake @@ -48,11 +48,11 @@ mark_as_advanced(CBLAS_INCLUDE_DIRS) # Finds the library find_library(CBLAS_LIBRARIES - NAMES cblas blas blis openblas accelerate + NAMES cblas blas blis openblas libopenblas accelerate HINTS ${CBLAS_HINTS} PATH_SUFFIXES - lib lib64 lib/x86_64 lib/x64 lib/x86 lib/Win32 lib/import lib64/import - openblas/lib blis/lib lib/atlas-base + lib lib64 bin lib/x86_64 lib/x64 lib/x86 lib/Win32 lib/import lib64/import + openblas/bin openblas/lib blis/lib lib/atlas-base PATHS ${CBLAS_PATHS} DOC "Netlib BLAS library" )