Skip to content

macOS: allow to use Accelerate framework instead of OpenBLAS #40397

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

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions build/pkgs/cvxopt/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ cvxopt_output() {
# configure cvxopt by variables
# Note that *_INC_DIR variables have to be non-empty.
# Compilers don't like "-I ".
export CVXOPT_BLAS_LIB="$(cvxopt_output l blas)"
export CVXOPT_BLAS_LIB_DIR="$(pkg-config --variable=libdir blas)"
export CVXOPT_LAPACK_LIB="$(cvxopt_output l lapack)"
# export CVXOPT_BLAS_LIB="$(cvxopt_output l blas)"
# export CVXOPT_BLAS_LIB_DIR="$(pkg-config --variable=libdir blas)"
# export CVXOPT_LAPACK_LIB="$(cvxopt_output l lapack)"

if test "x$SAGE_SUITESPARSE_PREFIX" != "x"; then
export CVXOPT_SUITESPARSE_LIB_DIR="${SAGE_SUITESPARSE_PREFIX}"
Expand Down
1 change: 1 addition & 0 deletions build/pkgs/fflas_ffpack/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export LINBOX_BLAS='-framework Accelerate'
cd src

if [ "$LINBOX_BLAS" != "" ]; then
Expand Down
1 change: 1 addition & 0 deletions build/pkgs/linbox/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export LINBOX_BLAS='-framework Accelerate'
cd src/

###############################################################################
Expand Down
3 changes: 3 additions & 0 deletions build/pkgs/openblas/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
SAGE_SPKG_CONFIGURE([openblas], [dnl CHECK
AC_CHECK_HEADER([Accelerate/Accelerate.h], [dnl macOS
], [
SAGE_SPKG_DEPCHECK([gfortran], [dnl
SAVE_LIBS="$LIBS"
SAVE_CFLAGS="$CFLAGS"
Expand Down Expand Up @@ -128,4 +130,5 @@ SAGE_SPKG_CONFIGURE([openblas], [dnl CHECK
LIBS="$SAVE_LIBS"
CFLAGS="$SAVE_CFLAGS"
])
])
])
6 changes: 1 addition & 5 deletions build/pkgs/scipy/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@ export CXX=$(echo "$CXX" | sed 's/-std=[a-z0-9+]*//g')

cd src/

# mesonpy enforces the build-system requirements, including the strict version pins of numpy
# even when --no-isolation (--no-build-isolation) is in used. We patch it out.
sed -i.bak '/build-system/,/project/s/^ *"numpy.*/ "numpy",/' pyproject.toml

sdh_pip_install --no-build-isolation .
sdh_pip_install --no-build-isolation . -Csetup-args=-Dblas=accelerate
6 changes: 6 additions & 0 deletions build/platform/macos/pkgconfig/blas.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Name: blas
Description: Apple blas
Version: 42.0
URL: https://apple.com
Cflags:
Libs: -framework Accelerate
6 changes: 6 additions & 0 deletions build/platform/macos/pkgconfig/cblas.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Name: blas
Description: Apple blas
Version: 42.0
URL: https://apple.com
Cflags:
Libs: -framework Accelerate
6 changes: 6 additions & 0 deletions build/platform/macos/pkgconfig/lapack.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Name: blas
Description: Apple blas
Version: 42.0
URL: https://apple.com
Cflags:
Libs: -framework Accelerate
6 changes: 6 additions & 0 deletions build/platform/macos/pkgconfig/openblas.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Name: blas
Description: Apple blas
Version: 42.0
URL: https://apple.com
Cflags:
Libs: -framework Accelerate
Loading