-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_setuptools.py
33 lines (30 loc) · 936 Bytes
/
build_setuptools.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
import os
try:
from Cython.Build import cythonize
except ImportError:
def build(setup_kwargs):
pass
else:
# from setuptools import Extension
# from setuptools.dist import Distribution
from distutils.command.build_ext import build_ext
import numpy
def build(setup_kwargs):
# The file you want to compile
extensions = [
"tacview_client/cython_funs.pyx"
]
# gcc arguments hack: enable optimizations
os.environ['CFLAGS'] = '-O3'
# Build
setup_kwargs.update({
'ext_modules': cythonize(
extensions,
language_level=3,
compiler_directives={'linetrace': True},
),
'extra_compile_args': ['-fopenmp'],
'extra_link_args':['-fopenmp'],
'include_dirs': [numpy.get_include()],
'cmdclass': {'build_ext': build_ext}
})