forked from daleroberts/hdstats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
70 lines (60 loc) · 1.9 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
60
61
62
63
64
65
66
67
68
69
70
"""
hdstats: High-dimensional statistics.
"""
import pathlib
import sys
from setuptools import setup, find_packages, Extension
try:
import numpy as np
include_dirs = [np.get_include()]
except ImportError:
include_dirs = []
# macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
macros = []
if sys.platform == 'darwin':
# Needs openmp lib installed: brew install libomp
cc_flags = ["-I/usr/local/include", "-Xpreprocessor", "-fopenmp"]
ld_flags = ["-L/usr/local/lib", "-lomp"]
else:
cc_flags = ['-fopenmp']
ld_flags = ['-fopenmp']
build_cfg = dict(
include_dirs=include_dirs,
extra_compile_args=cc_flags,
extra_link_args=ld_flags,
define_macros=macros,
)
print(build_cfg)
extensions = [
Extension('hdstats.geomedian', ['hdstats/geomedian.pyx'], **build_cfg),
Extension('hdstats.geomad', ['hdstats/geomad.pyx'], **build_cfg),
Extension('hdstats.ts', ['hdstats/ts.pyx'], **build_cfg),
Extension('hdstats.dtw', ['hdstats/dtw.pyx'], **build_cfg),
]
tests_require = [
"pytest",
"joblib",
]
README = (pathlib.Path(__file__).parent / "README.md").read_text()
setup(
name="hdstats",
packages=find_packages(".", exclude=['tests']),
include_package_data=True,
package_data={'': ['hdstats/*.pyx', 'hdstats/*.pyx', 'hdstats/*.h', 'hdstats/*.c']},
setup_requires=["Cython>=0.23", "numpy", "scipy"],
install_requires=["numpy", "scipy"],
tests_require=tests_require,
extras_require={
'test': tests_require,
},
version="0.2.1",
description="Multivariate / high-dimensional statistics and time series algorithms for spatial-temporal stacks",
long_description=README,
long_description_content_type="text/markdown",
url="http://github.com/daleroberts/hdstats",
author="Dale Roberts",
author_email="dale.o.roberts@gmail.com",
license="BSD-3-Clause License",
zip_safe=False,
ext_modules=extensions
)