Skip to content

Commit

Permalink
added platform specific build flags in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Luca van den Busch committed Feb 1, 2024
1 parent ee4fee8 commit 663156d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
ls -l dist
- name: Publish package
uses: pypa/[email protected]
uses: pypa/[email protected].11
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import platform
import numpy as np
from setuptools import Extension, setup

if platform.system() == "Windows":
platform_flags = ["/Ox", "/fp:fast"]
else:
platform_flags = ["-O3", "-ffast-math", "-march=native"]

balltree = Extension(
name="balltree.balltree",
sources=[
Expand All @@ -17,9 +23,7 @@
include_dirs=["include", np.get_include()],
extra_compile_args=[
"-Wall",
"-O3",
"-ffast-math",
"-march=native",
*platform_flags,
"-DSET_PYERR_STRING", # required to propagate C errors to python
],
)
Expand Down

0 comments on commit 663156d

Please sign in to comment.