forked from radiocosmology/driftscan
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
37 lines (31 loc) · 824 Bytes
/
Copy pathsetup.py
File metadata and controls
37 lines (31 loc) · 824 Bytes
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
"""Build cython extensions.
The full project config can be found in `pyproject.toml`. `setup.py` is still
required to build cython extensions.
"""
import os
import re
import sysconfig
import numpy
from Cython.Build import cythonize
from setuptools import setup
from setuptools.extension import Extension
# Enable OpenMP support if available
if re.search("gcc", sysconfig.get_config_var("CC")) is None:
print("Not using OpenMP")
omp_args = []
else:
omp_args = ["-fopenmp"]
# Cython module for fast operations
extensions = [
Extension(
"drift.util._fast_tools",
["drift/util/_fast_tools.pyx"],
include_dirs=[numpy.get_include()],
extra_compile_args=omp_args,
extra_link_args=omp_args,
),
]
setup(
name="driftscan",
ext_modules=cythonize(extensions),
)