-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
77 lines (74 loc) · 2.51 KB
/
setup.py
File metadata and controls
77 lines (74 loc) · 2.51 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
"""
构建配置 - 用于编译 Cython 模块
"""
from setuptools import setup, Extension
from Cython.Build import cythonize
import numpy
extensions = [
Extension(
"src.market.orderbook.orderbook",
["src/market/orderbook/orderbook.pyx"],
include_dirs=[numpy.get_include()],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
language="c++",
extra_compile_args=["-O3", "-std=c++17"],
),
Extension(
"src.market.account.position",
["src/market/account/position.pyx"],
include_dirs=[numpy.get_include()],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
),
Extension(
"src.market.account.fast_account",
["src/market/account/fast_account.pyx"],
extra_compile_args=["-O3"],
),
Extension(
"src.market.matching.fast_matching",
["src/market/matching/fast_matching.pyx"],
include_dirs=[numpy.get_include()],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
language="c++",
extra_compile_args=["-O3", "-std=c++17"],
),
Extension(
"src.bio.agents._cython.fast_decide",
["src/bio/agents/_cython/fast_decide.pyx"],
include_dirs=[numpy.get_include()],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
),
Extension(
"src.bio.agents._cython.fast_observe",
["src/bio/agents/_cython/fast_observe.pyx"],
include_dirs=[numpy.get_include()],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
),
Extension(
"src.training._cython.batch_decide_openmp",
["src/training/_cython/batch_decide_openmp.pyx"],
include_dirs=[numpy.get_include()],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
extra_compile_args=["-fopenmp", "-O3", "-ffast-math"],
extra_link_args=["-fopenmp"],
),
Extension(
"src.training._cython.fast_execution",
["src/training/_cython/fast_execution.pyx"],
extra_compile_args=["-O3"],
),
Extension(
"src.training._cython.fast_tick_execution",
["src/training/_cython/fast_tick_execution.pyx"],
include_dirs=[numpy.get_include()],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
language="c++",
extra_compile_args=["-O3", "-std=c++17"],
),
]
setup(
ext_modules=cythonize(
extensions,
compiler_directives={"language_level": "3"},
),
)