forked from pmla/polyhedral-template-matching
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
38 lines (31 loc) · 1.13 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
#!/usr/bin/env python
# NOTE: This setup.py script requires that Python is compiled with a
# C++ compiler, and that this compiler supports C++11. This is only
# occationally the case!
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
from glob import glob
import os
c_src_files = glob('*.c') + glob('svdpolar/*.c')
cpp_src_files = []
for f in ['main.c', 'selftest.c']:
c_src_files.remove(f)
extra_compile_args = ['-std=c99']
name = 'ptmmodule'
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(os.path.join(numpy.get_include(), 'numpy'))
setup(name=name,
version='1.0',
ext_modules=[Extension(name,
c_src_files+cpp_src_files,
extra_compile_args=extra_compile_args,
)
],
setup_requires=['numpy'],
cmdclass={'build_ext':build_ext},
)