Skip to content

Commit

Permalink
Switch performance libs default for apple OS
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-hld committed Jan 15, 2024
1 parent 786991a commit fc5ce82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Running `pip install -e .` builds it automatically

By default, it assumes SAF in a subdirectory, which is obtained by `git submodule update --init --recursive `. You can simply adapt
the variable `saf_path` in `safpy_build.py` if needed.
There you also have access to change the performance library options.

If in trouble you can have a look at the CI steps [here](https://github.com/chris-hld/SAFpy/blob/master/.github/workflows/python-safpy.yml).

Expand Down
11 changes: 9 additions & 2 deletions safpy_build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os.path
import sys
from cffi import FFI
ffibuilder = FFI()

Expand All @@ -16,8 +17,14 @@
saf_performance_lib = []
extra_link_args = []

saf_performance_lib.extend(["openblas", "lapacke"])
#extra_link_args.extend(['-Wl,-framework', '-Wl,Accelerate'])
# Sensible default, please adjust if needed
if sys.platform == "darwin":
print("SAFPY using default Apple Accelerate")
extra_link_args.extend(['-Wl,-framework', '-Wl,Accelerate'])
else:
print("SAFPY using default OpenBLAS/LAPACKE")
saf_performance_lib.extend(["openblas", "lapacke"])


# cdef() expects a single string declaring the C types, functions and
# globals needed to use the shared object. It must be in valid C syntax.
Expand Down

0 comments on commit fc5ce82

Please sign in to comment.