Skip to content

Commit

Permalink
add link option
Browse files Browse the repository at this point in the history
  • Loading branch information
fgregg committed Dec 16, 2023
1 parent 92b0ddb commit 41600e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 36 deletions.
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
requires = ["setuptools",
"wheel",
"cython",
"numpy==1.14.0; python_version=='3.6' and platform_system=='Windows' and (platform_machine=='x86' or platform_machine=='AMD64') and platform_python_implementation=='CPython'",
"numpy==1.14.0; python_version=='3.5' and platform_system=='Windows' and (platform_machine=='x86' or platform_machine=='AMD64') and platform_python_implementation=='CPython'",
"oldest_supported_numpy; platform_system!='Windows' or (python_version!='3.5' and python_version!='3.6') or (platform_machine!='x86' and platform_machine!='AMD64') or platform_python_implementation!='CPython'"]
"oldest_supported_numpy"]
42 changes: 9 additions & 33 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from os.path import join, abspath
from os.path import abspath, join

from Cython.Build import cythonize
import numpy
from setuptools import Extension, setup

Expand All @@ -8,53 +9,28 @@
# Add path for npymath libraries:
lib_path = [abspath(join(numpy.get_include(), "..", "lib"))]

try:
from Cython.Build import cythonize

use_cython = True
except ImportError:
use_cython = False

if use_cython:
ext_modules = cythonize(
[
Extension(
"pyhacrf.algorithms",
["pyhacrf/algorithms.pyx"],
extra_compile_args=["-ffast-math", "-O4"],
include_dirs=[inc_path],
library_dirs=lib_path,
libraries=["npymath"],
define_macros=defs,
),
Extension(
"pyhacrf.adjacent",
["pyhacrf/adjacent.pyx"],
include_dirs=[numpy.get_include()],
extra_link_args=["-lm"],
extra_compile_args=["-ffast-math", "-O4"],
),
]
)
else:
ext_modules = [
ext_modules = cythonize(
[
Extension(
"pyhacrf.algorithms",
["pyhacrf/algorithms.c"],
["pyhacrf/algorithms.pyx"],
extra_compile_args=["-ffast-math", "-O4"],
include_dirs=[inc_path],
library_dirs=lib_path,
libraries=["npymath"],
extra_link_args=["-lm"],
define_macros=defs,
),
Extension(
"pyhacrf.adjacent",
["pyhacrf/adjacent.c"],
extra_link_args=["-lm"],
["pyhacrf/adjacent.pyx"],
include_dirs=[numpy.get_include()],
extra_link_args=["-lm"],
extra_compile_args=["-ffast-math", "-O4"],
),
]
)


def readme():
Expand Down

0 comments on commit 41600e6

Please sign in to comment.