forked from weihuayi/fealpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_linux_with_extent.py
70 lines (66 loc) · 1.97 KB
/
setup_linux_with_extent.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
import os
from setuptools import Extension, setup
class get_pybind_include:
"""Helper class to determine the pybind11 include path. The purpose of this class is
to postpone importing pybind11 until it is actually installed, so that the
``get_include()`` method can be invoked.
"""
def __init__(self, user=False):
self.user = user
def __str__(self):
import pybind11
return pybind11.get_include(self.user)
ext_modules = [
Extension(
"fealpy.extent.cgal",
[
"src/cgal/pybind11.cpp",
],
language="C++",
include_dirs=[
os.environ.get("EIGEN_INCLUDE_DIR", "/usr/include/eigen3/"),
get_pybind_include(),
get_pybind_include(user=True)
],
libraries=["stdc++", "gmp", "mpfr"],
),
Extension(
"fealpy.extent.detri2",
[
"src/detri2/pybind11.cpp",
"src/detri2/detri2.cpp",
"src/detri2/flips.cpp",
"src/detri2/pred3d.cpp",
"src/detri2/io.cpp",
"src/detri2/sort.cpp",
"src/detri2/delaunay.cpp",
"src/detri2/constrained.cpp",
"src/detri2/refine.cpp",
"src/detri2/voronoi.cpp",
"src/detri2/adapt.cpp",
"src/detri2/metric.cpp",
],
language="C++",
include_dirs=[
get_pybind_include(),
get_pybind_include(user=True)
],
libraries=["gmp", "gmpxx"],
)
]
if __name__ == "__main__":
setup(name='fealpy',
version='1.0',
description='FEALPy: Finite Element Analysis Library in Python',
url='http://github.com/weihuayi/fealpy',
author='Huayi Wei',
author_email='weihuayi@xtu.edu.cn',
license='GNU',
packages=['fealpy'],
install_requires=[
'numpy',
'scipy',
'matplotlib',
],
ext_modules = ext_modules
)