forked from flintlib/python-flint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
51 lines (42 loc) · 1.46 KB
/
setup.py
File metadata and controls
51 lines (42 loc) · 1.46 KB
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
import sys
import os
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
#from numpy.distutils.system_info import default_include_dirs, default_lib_dirs
from distutils.sysconfig import get_config_vars
default_lib_dirs = ['/usr/local/lib', '/usr/lib']
(opt,) = get_config_vars('OPT')
os.environ['OPT'] = " ".join(flag for flag in opt.split() if flag != '-Wstrict-prototypes')
if sys.platform == 'win32':
libraries = ["flint", "mpir", "mpfr", "pthreads"]
default_lib_dirs += [
os.path.join(d, "manual-link") for d in default_lib_dirs
]
else:
#libraries = ["flint", "arb"]
libraries = ["flint"]
default_include_dirs = ['/usr/local/include/flint', '/usr/include/flint']
#default_include_dirs += [
# os.path.join(d, "flint") for d in default_include_dirs
#]
ext_modules = [
Extension(
"flint", ["src/pyflint.pyx"],
libraries=libraries,
library_dirs=default_lib_dirs,
include_dirs=default_include_dirs)
]
for e in ext_modules:
e.cython_directives = {"embedsignature": True}
setup(
name='python-flint',
cmdclass={'build_ext': build_ext},
ext_modules=ext_modules,
description='Bindings for FLINT',
version='0.0.1',
url='https://github.com/python-flint/python-flint',
author='Fredrik Johansson',
author_email='fredrik.johansson@gmail.com',
license='MIT',
classifiers=['Topic :: Scientific/Engineering :: Mathematics'])