-
Notifications
You must be signed in to change notification settings - Fork 17
/
setup.py
59 lines (53 loc) · 2.39 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
53
54
55
56
57
58
59
import os
from setuptools import setup, Extension
import numpy
def find_version(path):
import re
# path shall be a plain ascii text file.
s = open(path, 'rt').read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
s, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Version not found")
extensions = [
Extension("pmesh._domain", ["pmesh/_domain.pyx"], include_dirs=["./", numpy.get_include()]),
Extension("pmesh._window", ["pmesh/_window.pyx", "pmesh/_window_imp.c"],
depends=["pmesh/_window_imp.h",
"pmesh/_window_tuned_pcs.h",
"pmesh/_window_tuned_tsc.h",
"pmesh/_window_tuned_cic.h",
"pmesh/_window_tuned_nnb.h",
"pmesh/_window_generics.h",
"pmesh/_window_wavelets.h",
"pmesh/_window_lanczos.h",
"pmesh/_window_acg.h"],
libraries = ['m'],
include_dirs=["./", numpy.get_include()]),
Extension("pmesh._invariant", ["pmesh/_invariant.pyx"],
depends=["pmesh/_invariant_imp.c",
],
libraries = ['m'],
include_dirs=["pmesh", numpy.get_include()]),
Extension("pmesh._whitenoise", ["pmesh/gsl/ranlxd.c", "pmesh/gsl/missing.c", "pmesh/gsl/rng.c", "pmesh/_whitenoise_imp.c", "pmesh/_whitenoise.pyx"],
depends=["pmesh/gsl/config.h", "pmesh/gsl/gsl_errno.h",
"pmesh/gsl/gsl_inline.h", "pmesh/gsl/gsl_rng.h",
"pmesh/gsl/gsl_types.h",
"pmesh/_whitenoise_imp.h", "pmesh/_whitenoise_generics.h"
],
libraries = ['m'],
include_dirs=["pmesh/gsl", "pmesh", numpy.get_include()]),
]
from Cython.Build import cythonize
extensions = cythonize(extensions)
setup(
name="pmesh", version=find_version("pmesh/version.py"),
author="Yu Feng",
description="Particle Mesh in Python",
package_dir = {'pmesh': 'pmesh'},
packages= ['pmesh', 'pmesh.tests'],
install_requires=['cython', 'numpy', 'mpi4py', 'mpsort', 'pfft-python'],
license='GPL3',
ext_modules = extensions,
extras_require={'full': ['abopt'], 'abopt': ['abopt']}
)