From 82644d15023d340b5d8ba1e650488b413ffac729 Mon Sep 17 00:00:00 2001 From: Enzo Busseti Date: Thu, 2 Nov 2023 10:21:22 +0400 Subject: [PATCH] debugging blas linking on windows via github ci --- .github/workflows/build.yml | 1 + meson.build | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a49fd1b..829b467 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -134,6 +134,7 @@ jobs: - name: Build and test windows wheels if: ${{env.DEPLOY == 'True' && startsWith(matrix.os, 'windows')}} run: | + python -c "import numpy as np; print('NUMPY BLAS INFOS'); print(np.show_config('dicts'))" python -m pip install build python -m build -Csetup-args="-Dlink_blas_statically=True" python -m pip install delvewheel diff --git a/meson.build b/meson.build index cf341d8..d29d6f4 100644 --- a/meson.build +++ b/meson.build @@ -14,6 +14,24 @@ if not blas_deps[0].found() cblas_dep = cc.find_library('cblas', static: get_option('link_blas_statically'), required : false) if cblas_dep.found() blas_deps += cblas_dep + else + # as a last fallback (used for building wheels in github CI) + # we link statically anaconda-installed openblas + incdir_blas = run_command(py,['-c', +'''import os +import numpy as np +print(np.show_config('dicts')['Build Dependencies']['blas']['include directory']) +'''], check: true).stdout().strip() + libdir_blas = run_command(py,['-c', +'''import os +import numpy as np +print(np.show_config('dicts')['Build Dependencies']['blas']['lib directory']) +'''], check: true).stdout().strip() + blas_windows_include = include_directories(incdir_blas) + blas_windows_dll = static_library(libdir_blas) + blas_deps += declare_dependency( + link_whole : [blas_windows_dll], + include_directories : blas_windows_include) endif endif