-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
52 lines (46 loc) · 1.77 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
from setuptools import setup
from setuptools.extension import Extension
from sys import platform
try:
import numpy as np
from Cython.Build import cythonize
except ImportError:
raise ImportError("Please install numpy and cython before building pyquad!")
link_args = ["-std=c99"]
if platform == "linux" or platform == "linux2":
link_args.append("-D LINUX_MACH=1")
src_files = ["pyquad/pyquad.pyx", "pyquad/integration/error.c",
"pyquad/integration/qk.c", "pyquad/integration/qk21.c",
"pyquad/integration/qk15.c", "pyquad/integration/qags.c",
"pyquad/integration/workspace.c", "pyquad/integration/cquad.c",
"pyquad/integration/cquad_const.c", "pyquad/integration/infnan.c",
"pyquad/integration/fdiv.c"
]
ext_modules=[Extension("pyquad",
src_files,
extra_compile_args=link_args,
extra_link_args=link_args,
include_dirs=[np.get_include()],
language='c')]
# Cythonize our modules
ext_modules = cythonize(ext_modules, compiler_directives={'language_level': 3})
setup(
name='pyquad',
version='0.7.0',
author="Ashley J Kelly",
license="LGPL-3.0",
author_email="[email protected]",
description="A python wrapper for the GSL integration routines",
url="https://github.com/AshKelly/pyquad",
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License (GPL)"
],
install_requires=['cython', 'numpy', 'numba'],
extras_require={
'test': ['pytest', 'scipy'],
},
ext_modules=ext_modules,
)