-
Notifications
You must be signed in to change notification settings - Fork 15
/
setup.py
54 lines (43 loc) · 1.14 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
# -*- coding: utf-8 -#-
# Copyright (2021) Cardiff University ([email protected])
"""Build configuration for sbank
"""
import os
from setuptools import setup, Extension
import numpy
from Cython.Build import cythonize
__author__ = "Duncan Macleod <[email protected]>"
# define cython options
cython_compile_args = [
"-O3",
"-w",
"-ffast-math",
"-ffinite-math-only",
"-std=c99",
]
cython_directives = {
"embedsignature": True,
"language_level": 3,
}
# enable coverage for cython
if int(os.getenv("CYTHON_LINETRACE", "0")):
cython_directives["linetrace"] = True
cython_compile_args.append("-DCYTHON_TRACE")
# define compiled extensions
exts = [
Extension(
"sbank.overlap_cpu",
["sbank/overlap_cpu.pyx"],
include_dirs=[numpy.get_include()],
language="c",
libraries=["lal"],
extra_compile_args=cython_compile_args,
extra_link_args=[],
),
]
# -- build the thing
# this function only manually specifies things that aren't
# supported by setup.cfg (as of setuptools-30.3.0)
setup(
ext_modules=cythonize(exts, compiler_directives=cython_directives),
)