summaryrefslogtreecommitdiffstats
path: root/setup.py
blob: 97e25060c463e13c0b499dc5b7e1179c165a7ebb (plain)
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
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import numpy

all_extensions = Extension(
    "*",
    ["pyisda/*.pyx"],
    include_dirs=["c_layer", numpy.get_include()],
    libraries=["cds", "farmhash", "lz4"],
    language="c++",
    extra_compile_args=["-fopenmp"],
    extra_link_args=["-fopenmp", "-Wl,--strip-all"],
)

c_extension = Extension(
    "pyisda.optim",
    include_dirs=["c_layer", numpy.get_include()],
    sources=["pyisda/optim.pyx", "c_layer/cdsbootstrap.c"],
    libraries=["cds"],
    language="c++",
)

all_extensions = cythonize(
    [c_extension, all_extensions],
    nthreads=4,
    compiler_directives={"embedsignature": True,
        "language_level": 3,
        "c_string_type": "unicode",
        "c_string_encoding": "ascii"},
)

setup(
    name="pyisda",
    version="0.3",
    author="Guillaume Horel",
    ext_modules=all_extensions,
    packages=["pyisda"],
)