-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
59 lines (55 loc) · 1.33 KB
/
setup.py
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
47
48
49
50
51
52
53
54
55
56
57
58
59
import sys
import numpy as np
from Cython.Build import cythonize
from setuptools import Extension, setup
if sys.platform == "win32":
allocator_libs = [] # type: ignore
extra_compile_args = ["/openmp", "/O2"]
extra_link_args = ["/openmp"]
elif sys.platform == "darwin":
allocator_libs = ["jemalloc"]
extra_compile_args = [
"-Xpreprocessor",
"-fopenmp",
"-O3",
"-ffast-math",
"--std=c++17",
]
extra_link_args = ["-lomp"]
else:
allocator_libs = ["jemalloc"]
extra_compile_args = [
"-fopenmp",
"-O3",
"-ffast-math",
"--std=c++17",
]
extra_link_args = ["-fopenmp"]
extension_args = dict(
include_dirs=[np.get_include()],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
language="c++",
)
ext_modules = [
Extension(
name="coverforest._giqs",
sources=["coverforest/_giqs.pyx"],
**extension_args,
),
]
setup(
ext_modules=cythonize(
ext_modules,
annotate=False,
compiler_directives={
"language_level": "3",
"boundscheck": False,
"wraparound": False,
"initializedcheck": False,
"nonecheck": False,
"cdivision": True,
"legacy_implicit_noexcept": True,
},
),
)