-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
46 lines (42 loc) · 1.29 KB
/
Copy pathsetup.py
File metadata and controls
46 lines (42 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import sys
import numpy as np
from Cython.Build import cythonize
from setuptools import Extension, setup
openmp_arg = "/openmp" if sys.platform.startswith("win") else "-fopenmp"
opt_args = (
["-O3", "-ffast-math", "-mtune=generic"]
if not sys.platform.startswith("win")
else ["/O2", "/fp:fast"]
)
ext_modules = [
Extension(
"hopfer.helpers.image_utils",
["src/hopfer/helpers/image_utils.pyx"],
extra_compile_args=[openmp_arg, *opt_args],
extra_link_args=[openmp_arg],
include_dirs=[np.get_include()],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
),
Extension(
"hopfer.core.algorithms.cython_ops.backend",
["src/hopfer/core/algorithms/cython_ops/cython_ops.pyx"],
extra_compile_args=[openmp_arg, *opt_args],
extra_link_args=[openmp_arg],
include_dirs=[np.get_include()],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
),
]
setup(
ext_modules=cythonize(
ext_modules,
annotate=True,
compiler_directives={
"boundscheck": False,
"wraparound": False,
"initializedcheck": False,
"cdivision": True,
"language_level": "3",
"nonecheck": False,
},
),
)