forked from capytaine/capytaine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
128 lines (115 loc) · 3.86 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/usr/bin/env python
# coding: utf-8
import os
from setuptools import dist
dist.Distribution().fetch_build_eggs(['numpy', 'charset-normalizer'])
from numpy.distutils.core import Extension, setup
########################
# Fortran extensions #
########################
def libDelhommeau_src(precision):
return [
"capytaine/green_functions/libDelhommeau/src/{}.f90".format(precision),
"capytaine/green_functions/libDelhommeau/src/constants.f90",
"capytaine/green_functions/libDelhommeau/src/Delhommeau_integrals.f90",
"capytaine/green_functions/libDelhommeau/src/old_Prony_decomposition.f90",
"capytaine/green_functions/libDelhommeau/src/Green_Rankine.f90",
"capytaine/green_functions/libDelhommeau/src/Green_wave.f90",
"capytaine/green_functions/libDelhommeau/src/matrices.f90",
]
extensions_names_and_extra_arguments = [
("capytaine.green_functions.libs.Delhommeau", []),
("capytaine.green_functions.libs.XieDelhommeau", ["-DXIE_CORRECTION"]),
]
extensions_modules = [
Extension(
name=name + "_" + precision,
sources=libDelhommeau_src(precision),
extra_f90_compile_args=['-fopenmp', '-cpp'] + extra_args,
extra_link_args=['-fopenmp'],
# # Uncomment the following lines to get more verbose output from f2py.
# define_macros=[
# ('F2PY_REPORT_ATEXIT', 1),
# ('F2PY_REPORT_ON_ARRAY_COPY', 1),
# ],
)
for (name, extra_args) in extensions_names_and_extra_arguments
for precision in ["float32", "float64"]
]
########################################################
# Read version number and other info in __about__.py #
########################################################
base_dir = os.path.dirname(__file__)
src_dir = os.path.join(base_dir, "capytaine")
about = {}
with open(os.path.join(src_dir, "__about__.py")) as f:
exec(f.read(), about)
##########
# Main #
##########
if __name__ == "__main__":
setup(name=about["__title__"],
version=about["__version__"],
description=about["__description__"],
author=about["__author__"],
license=about["__license__"],
url=about["__uri__"],
packages=[
'capytaine',
'capytaine.meshes',
'capytaine.meshes.predefined',
'capytaine.matrices',
'capytaine.bodies',
'capytaine.bodies.predefined',
'capytaine.bem',
'capytaine.green_functions',
'capytaine.post_pro',
'capytaine.ui',
'capytaine.ui.vtk',
'capytaine.io',
'capytaine.tools',
],
install_requires=[
'numpy',
'scipy',
'pandas>=1.3',
'xarray',
],
extras_require={
'develop': [
'pytest',
'hypothesis',
'ipython>=7.14',
'matplotlib',
'vtk',
'meshio',
'pygmsh',
'gmsh',
'h5py',
'quadpy',
'sphinx',
'sphinxcontrib-proof',
'sphinxcontrib-mermaid',
],
'ci': [
'pytest',
'hypothesis',
],
'extra': [
'ipython>=7.14',
'matplotlib',
'vtk',
'meshio',
'pygmsh',
'gmsh',
'quadpy',
'bemio @ git+https://github.com/michaelcdevin/bemio.git@master-python3#egg=bemio',
]
},
entry_points={
'console_scripts': [
'capytaine=capytaine.ui.cli:main',
],
},
ext_modules=extensions_modules,
)