-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathsetup.py
51 lines (44 loc) · 1.39 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
import sys
from sysconfig import get_path
from setuptools import setup, find_packages, Extension
import numpy
if sys.platform in ("linux", "linux2"): # linux
extra_compile_args = ["-std=c++17", "-lstdc++"]
elif sys.platform == "darwin": # OS X
extra_compile_args = ["-std=c++17", "-lstdc++"]
elif sys.platform == "win32": # Windows
extra_compile_args = ["/O2", "/std:c++17"]
mod_isolation_forest = Extension(
"frds.algorithms.isolation_forest.iforest_ext",
include_dirs=[get_path("platinclude"), numpy.get_include()],
sources=[
"src/frds/algorithms/isolation_forest/iforest_module.cpp",
],
extra_compile_args=extra_compile_args,
language="c++",
)
mod_algo_utils = Extension(
"frds.algorithms.utils.utils_ext",
include_dirs=[get_path("platinclude"), numpy.get_include()],
sources=["src/frds/algorithms/utils/utils_module.cpp"],
extra_compile_args=extra_compile_args,
language="c++",
)
mod_measures = Extension(
"frds.measures.measures_ext",
include_dirs=[get_path("platinclude"), numpy.get_include()],
sources=["src/frds/measures/measures_module.cpp"],
extra_compile_args=extra_compile_args,
language="c++",
)
ext_modules = [
mod_isolation_forest,
mod_algo_utils,
mod_measures,
]
setup(
packages=find_packages(where="src"),
package_dir={"": "src"},
include_package_data=True,
ext_modules=ext_modules,
)