-
Notifications
You must be signed in to change notification settings - Fork 37
/
setup.py
77 lines (63 loc) · 2.47 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env python
#-----------------------------------------------------------------------------
# Copyright (C) 2012 Bradley Froehle
# Distributed under the terms of the GNU General Public License. You should
# have received a copy of the license along with this program. If not,
# see <http://www.gnu.org/licenses/>.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import os
import numpy as np
from numpy.distutils import system_info
from distutils.core import setup
from distutils.extension import Extension
# Read version from distmesh/__init__.py
with open(os.path.join('distmesh', '__init__.py')) as f:
line = f.readline()
while not line.startswith('__version__'):
line = f.readline()
exec(line, globals())
# Build list of cython extensions
ext_modules = [
Extension(
'distmesh._distance_functions',
sources=[os.path.join('distmesh', '_distance_functions.c')],
depends=[os.path.join('distmesh', 'src', 'distance_functions.c')],
include_dirs=[np.get_include()],
),
]
# distmesh._distance_functions needs LAPACK
lapack_info = system_info.get_info('lapack_opt', 0)
# See ('https://github.com/nipy/nipy/blob/'
# '91fddffbae25a5ca3a5b35db2a7c605b8db9014d/nipy/labs/setup.py#L44')
if 'libraries' not in lapack_info:
lapack_info = system_info.get_info('lapack', 0)
ext_modules[0].libraries.extend(lapack_info['libraries'])
ext_modules[0].library_dirs.extend(lapack_info['library_dirs'])
if 'include_dirs' in lapack_info:
ext_modules[0].include_dirs.extend(lapack_info['include_dirs'])
install_requires = [
'matplotlib>=1.2',
]
long_description = open('README.rst').read()
setup(name='PyDistMesh',
version=__version__,
description="A Simple Mesh Generator in Python",
long_description=long_description,
classifiers=[
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
'Operating System :: POSIX :: Linux',
'Topic :: Scientific/Engineering :: Mathematics',
],
keywords='meshing',
author='Bradley Froehle',
author_email='brad.froehle@gmail.com',
url='https://github.com/bfroehle/pydistmesh',
install_requires=install_requires,
license='GPL',
packages=['distmesh'],
ext_modules=ext_modules,
)