Skip to content

Commit

Permalink
improve python setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cortes committed Mar 19, 2023
1 parent c418a29 commit 16263a8
Show file tree
Hide file tree
Showing 6 changed files with 234 additions and 168 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pip install --no-use-pep517 hpfrec
```
brew install libomp
```
And then reinstall this package: `pip install --force-reinstall hpfrec`.
And then reinstall this package: `pip install --upgrade --no-deps --force-reinstall hpfrec`.

** *
**IMPORTANT:** the setup script will try to add compilation flag `-march=native`. This instructs the compiler to tune the package for the CPU in which it is being installed (by e.g. using AVX instructions if available), but the result might not be usable in other computers. If building a binary wheel of this package or putting it into a docker image which will be used in different machines, this can be overriden either by (a) defining an environment variable `DONT_SET_MARCH=1`, or by (b) manually supplying compilation `CFLAGS` as an environment variable with something related to architecture. For maximum compatibility (but slowest speed), it's possible to do something like this:
Expand Down
1 change: 1 addition & 0 deletions hpfrec/cython_double.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#cython: language_level=3
from scipy.linalg.cython_blas cimport ddot
import ctypes

Expand Down
1 change: 1 addition & 0 deletions hpfrec/cython_float.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#cython: language_level=3
import numpy as np
cimport numpy as np
from scipy.linalg.cython_blas cimport sdot
Expand Down
1 change: 1 addition & 0 deletions hpfrec/return0.pyx
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#cython: language_level=3
def get():
return 0
1 change: 1 addition & 0 deletions hpfrec/return1.pyx
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#cython: language_level=3
def get():
return 1

0 comments on commit 16263a8

Please sign in to comment.