PyFishPack 0.1.0__cp39-cp39-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- PyFishPack/__init__.py +105 -0
- PyFishPack/__pycache__/__init__.cpython-39.pyc +0 -0
- PyFishPack/__pycache__/apps.cpython-39.pyc +0 -0
- PyFishPack/_dummy.c +23 -0
- PyFishPack/_dummy.cp39-win_amd64.pyd +0 -0
- PyFishPack/apps.py +3640 -0
- PyFishPack/fishpack.cp39-win_amd64.dll.a +0 -0
- PyFishPack/fishpack.cp39-win_amd64.pyd +0 -0
- PyFishPack/meson.build +213 -0
- PyFishPack/src/archive/f77/Makefile +19 -0
- PyFishPack/src/archive/f77/blktri.f +1404 -0
- PyFishPack/src/archive/f77/cblktri.f +1414 -0
- PyFishPack/src/archive/f77/cmgnbn.f +1592 -0
- PyFishPack/src/archive/f77/comf.f +186 -0
- PyFishPack/src/archive/f77/fftpack.f +2968 -0
- PyFishPack/src/archive/f77/genbun.f +1335 -0
- PyFishPack/src/archive/f77/gnbnaux.f +314 -0
- PyFishPack/src/archive/f77/hstcrt.f +443 -0
- PyFishPack/src/archive/f77/hstcsp.f +683 -0
- PyFishPack/src/archive/f77/hstcyl.f +485 -0
- PyFishPack/src/archive/f77/hstplr.f +538 -0
- PyFishPack/src/archive/f77/hstssp.f +634 -0
- PyFishPack/src/archive/f77/hw3crt.f +687 -0
- PyFishPack/src/archive/f77/hwscrt.f +512 -0
- PyFishPack/src/archive/f77/hwscsp.f +728 -0
- PyFishPack/src/archive/f77/hwscyl.f +538 -0
- PyFishPack/src/archive/f77/hwsplr.f +602 -0
- PyFishPack/src/archive/f77/hwsssp.f +780 -0
- PyFishPack/src/archive/f77/pois3d.f +550 -0
- PyFishPack/src/archive/f77/poistg.f +875 -0
- PyFishPack/src/archive/f77/sepaux.f +361 -0
- PyFishPack/src/archive/f77/sepeli.f +1029 -0
- PyFishPack/src/archive/f77/sepx4.f +958 -0
- PyFishPack/src/centered_axisymmetric_spherical_solver.f90 +1002 -0
- PyFishPack/src/centered_cartesian_helmholtz_solver_3d.f90 +819 -0
- PyFishPack/src/centered_cartesian_solver.f90 +583 -0
- PyFishPack/src/centered_cylindrical_solver.f90 +634 -0
- PyFishPack/src/centered_helmholtz_solvers.f90 +156 -0
- PyFishPack/src/centered_polar_solver.f90 +746 -0
- PyFishPack/src/centered_real_linear_systems_solver.f90 +280 -0
- PyFishPack/src/centered_spherical_solver.f90 +928 -0
- PyFishPack/src/complex_block_tridiagonal_linear_systems_solver.f90 +1947 -0
- PyFishPack/src/complex_linear_systems_solver.f90 +1787 -0
- PyFishPack/src/fftpack_c_api.f90 +86 -0
- PyFishPack/src/fishpack.f90 +191 -0
- PyFishPack/src/fishpack.pyf +504 -0
- PyFishPack/src/fishpack_c_api.f90 +365 -0
- PyFishPack/src/fishpack_original.pyf +2119 -0
- PyFishPack/src/fishpack_precision.f90 +53 -0
- PyFishPack/src/general_linear_systems_solver_3d.f90 +296 -0
- PyFishPack/src/iterative_solvers.f90 +969 -0
- PyFishPack/src/main.f90 +10 -0
- PyFishPack/src/pyfishpack_module.c +1302 -0
- PyFishPack/src/real_block_tridiagonal_linear_systems_solver.f90 +319 -0
- PyFishPack/src/sepeli.f90 +1454 -0
- PyFishPack/src/sepx4.f90 +1338 -0
- PyFishPack/src/staggered_axisymmetric_spherical_solver.f90 +908 -0
- PyFishPack/src/staggered_cartesian_solver.f90 +553 -0
- PyFishPack/src/staggered_cylindrical_solver.f90 +630 -0
- PyFishPack/src/staggered_helmholtz_solvers.f90 +172 -0
- PyFishPack/src/staggered_polar_solver.f90 +651 -0
- PyFishPack/src/staggered_real_linear_systems_solver.f90 +258 -0
- PyFishPack/src/staggered_spherical_solver.f90 +758 -0
- PyFishPack/src/three_dimensional_solvers.f90 +602 -0
- PyFishPack/src/type_CenteredCyclicReductionUtility.f90 +1714 -0
- PyFishPack/src/type_CyclicReductionUtility.f90 +472 -0
- PyFishPack/src/type_FishpackWorkspace.f90 +290 -0
- PyFishPack/src/type_GeneralizedCyclicReductionUtility.f90 +1980 -0
- PyFishPack/src/type_PeriodicFastFourierTransform.f90 +3789 -0
- PyFishPack/src/type_SepAux.f90 +586 -0
- PyFishPack/src/type_StaggeredCyclicReductionUtility.f90 +893 -0
- pyfishpack-0.1.0.dist-info/DELVEWHEEL +2 -0
- pyfishpack-0.1.0.dist-info/METADATA +81 -0
- pyfishpack-0.1.0.dist-info/RECORD +82 -0
- pyfishpack-0.1.0.dist-info/WHEEL +5 -0
- pyfishpack-0.1.0.dist-info/licenses/LICENSE +21 -0
- pyfishpack-0.1.0.dist-info/top_level.txt +1 -0
- pyfishpack.libs/.load-order-pyfishpack-0.1.0 +4 -0
- pyfishpack.libs/libgcc_s_seh-1-25d59ccffa1a9009644065b069829e07.dll +0 -0
- pyfishpack.libs/libgfortran-5-08f2195cfa0d823e13371c5c3186a82a.dll +0 -0
- pyfishpack.libs/libquadmath-0-c5abb9113f1ee64b87a889958e4b7418.dll +0 -0
- pyfishpack.libs/libwinpthread-1-83908d14abfafb8b3bfa38cf51ecee56.dll +0 -0
|
Binary file
|
|
Binary file
|
PyFishPack/meson.build
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# PyFishPack - Python extension backed by modern Fortran and a C wrapper.
|
|
2
|
+
project(
|
|
3
|
+
'pyfishpack',
|
|
4
|
+
'c',
|
|
5
|
+
'fortran',
|
|
6
|
+
version: '0.1.0',
|
|
7
|
+
default_options: ['warning_level=2', 'buildtype=release', 'b_lto=true'],
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
py_mod = import('python')
|
|
11
|
+
py = py_mod.find_installation(pure: false)
|
|
12
|
+
py_dep = py.dependency()
|
|
13
|
+
build_py = find_program('build_python', required: false)
|
|
14
|
+
if not build_py.found()
|
|
15
|
+
build_py = py
|
|
16
|
+
endif
|
|
17
|
+
|
|
18
|
+
py.install_sources(
|
|
19
|
+
['__init__.py', 'apps.py'],
|
|
20
|
+
subdir: 'PyFishPack',
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
incdir_numpy_cmd = run_command(
|
|
24
|
+
build_py,
|
|
25
|
+
['-c', '''
|
|
26
|
+
import numpy
|
|
27
|
+
import os
|
|
28
|
+
|
|
29
|
+
paths = [
|
|
30
|
+
numpy.get_include(),
|
|
31
|
+
os.path.join(numpy.__path__[0], "core", "include"),
|
|
32
|
+
os.path.join(numpy.__path__[0], "_core", "include"),
|
|
33
|
+
]
|
|
34
|
+
for path in paths:
|
|
35
|
+
if os.path.exists(os.path.join(path, "numpy", "npy_os.h")):
|
|
36
|
+
print(path)
|
|
37
|
+
break
|
|
38
|
+
else:
|
|
39
|
+
print(numpy.get_include())
|
|
40
|
+
'''],
|
|
41
|
+
check: true,
|
|
42
|
+
)
|
|
43
|
+
incdir_numpy = incdir_numpy_cmd.stdout().strip()
|
|
44
|
+
message('NumPy include directory: ' + incdir_numpy)
|
|
45
|
+
|
|
46
|
+
host_system = host_machine.system()
|
|
47
|
+
host_cpu = host_machine.cpu_family()
|
|
48
|
+
message('Host system: ' + host_system)
|
|
49
|
+
message('Host CPU family: ' + host_cpu)
|
|
50
|
+
|
|
51
|
+
fortran_compiler = meson.get_compiler('fortran')
|
|
52
|
+
c_compiler = meson.get_compiler('c')
|
|
53
|
+
is_gcc_toolchain = fortran_compiler.get_id() == 'gcc' and c_compiler.get_id() == 'gcc'
|
|
54
|
+
|
|
55
|
+
openmp_dependencies = []
|
|
56
|
+
openmp_fortran_args = []
|
|
57
|
+
openmp_c_args = []
|
|
58
|
+
openmp_link_args = []
|
|
59
|
+
if is_gcc_toolchain
|
|
60
|
+
openmp_dep = dependency('openmp', required: false)
|
|
61
|
+
if openmp_dep.found()
|
|
62
|
+
openmp_dependencies += openmp_dep
|
|
63
|
+
openmp_fortran_args += ['-fopenmp']
|
|
64
|
+
openmp_c_args += ['-fopenmp']
|
|
65
|
+
openmp_link_args += ['-fopenmp']
|
|
66
|
+
message('Using OpenMP dependency for parallel processing')
|
|
67
|
+
endif
|
|
68
|
+
elif host_system != 'windows'
|
|
69
|
+
openmp_dep = dependency('openmp', required: false)
|
|
70
|
+
if openmp_dep.found()
|
|
71
|
+
openmp_dependencies += openmp_dep
|
|
72
|
+
message('Using OpenMP dependency for parallel processing')
|
|
73
|
+
endif
|
|
74
|
+
endif
|
|
75
|
+
|
|
76
|
+
fortran_args = [
|
|
77
|
+
'-O3',
|
|
78
|
+
'-fPIC',
|
|
79
|
+
'-funroll-loops',
|
|
80
|
+
'-finline-functions',
|
|
81
|
+
'-ftree-vectorize',
|
|
82
|
+
'-ffinite-math-only',
|
|
83
|
+
'-ffree-line-length-none',
|
|
84
|
+
'-fno-common',
|
|
85
|
+
'-ftree-loop-im',
|
|
86
|
+
'-ftree-loop-distribution',
|
|
87
|
+
'-falign-functions=32',
|
|
88
|
+
'-falign-loops=32',
|
|
89
|
+
'-fimplicit-none',
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
c_args = [
|
|
93
|
+
'-DNPY_NO_DEPRECATED_API=NPY_1_20_API_VERSION',
|
|
94
|
+
'-fPIC',
|
|
95
|
+
'-fno-trapping-math',
|
|
96
|
+
'-falign-functions=32',
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
if host_system == 'darwin' and host_cpu == 'aarch64'
|
|
100
|
+
message('Configuring for Apple Silicon (arm64)')
|
|
101
|
+
fortran_args += ['-march=armv8-a', '-mtune=apple-m1']
|
|
102
|
+
c_args += ['-march=armv8-a', '-mtune=apple-m1']
|
|
103
|
+
else
|
|
104
|
+
message('Configuring for x86-64 architecture')
|
|
105
|
+
fortran_args += ['-march=x86-64', '-mtune=generic']
|
|
106
|
+
c_args += ['-march=x86-64', '-mtune=generic', '-O3', '-funroll-loops', '-finline-functions', '-ftree-vectorize']
|
|
107
|
+
endif
|
|
108
|
+
|
|
109
|
+
fortran_args += openmp_fortran_args
|
|
110
|
+
c_args += openmp_c_args
|
|
111
|
+
|
|
112
|
+
message('Fortran args: ' + ' '.join(fortran_args))
|
|
113
|
+
message('C args: ' + ' '.join(c_args))
|
|
114
|
+
|
|
115
|
+
inc_np = include_directories(incdir_numpy)
|
|
116
|
+
dependencies = [py_dep] + openmp_dependencies
|
|
117
|
+
package_install_dir = get_option('python.purelibdir') / 'PyFishPack'
|
|
118
|
+
|
|
119
|
+
modern_fortran_sources = [
|
|
120
|
+
'src/fishpack_precision.f90',
|
|
121
|
+
'src/type_FishpackWorkspace.f90',
|
|
122
|
+
'src/type_GeneralizedCyclicReductionUtility.f90',
|
|
123
|
+
'src/type_CyclicReductionUtility.f90',
|
|
124
|
+
'src/type_PeriodicFastFourierTransform.f90',
|
|
125
|
+
'src/type_SepAux.f90',
|
|
126
|
+
'src/type_CenteredCyclicReductionUtility.f90',
|
|
127
|
+
'src/type_StaggeredCyclicReductionUtility.f90',
|
|
128
|
+
'src/real_block_tridiagonal_linear_systems_solver.f90',
|
|
129
|
+
'src/complex_block_tridiagonal_linear_systems_solver.f90',
|
|
130
|
+
'src/complex_linear_systems_solver.f90',
|
|
131
|
+
'src/three_dimensional_solvers.f90',
|
|
132
|
+
'src/general_linear_systems_solver_3d.f90',
|
|
133
|
+
'src/centered_cartesian_helmholtz_solver_3d.f90',
|
|
134
|
+
'src/staggered_real_linear_systems_solver.f90',
|
|
135
|
+
'src/centered_real_linear_systems_solver.f90',
|
|
136
|
+
'src/staggered_cartesian_solver.f90',
|
|
137
|
+
'src/staggered_polar_solver.f90',
|
|
138
|
+
'src/staggered_cylindrical_solver.f90',
|
|
139
|
+
'src/staggered_spherical_solver.f90',
|
|
140
|
+
'src/staggered_axisymmetric_spherical_solver.f90',
|
|
141
|
+
'src/staggered_helmholtz_solvers.f90',
|
|
142
|
+
'src/centered_cartesian_solver.f90',
|
|
143
|
+
'src/centered_polar_solver.f90',
|
|
144
|
+
'src/centered_cylindrical_solver.f90',
|
|
145
|
+
'src/centered_spherical_solver.f90',
|
|
146
|
+
'src/centered_axisymmetric_spherical_solver.f90',
|
|
147
|
+
'src/centered_helmholtz_solvers.f90',
|
|
148
|
+
'src/sepeli.f90',
|
|
149
|
+
'src/sepx4.f90',
|
|
150
|
+
'src/iterative_solvers.f90',
|
|
151
|
+
'src/fftpack_c_api.f90',
|
|
152
|
+
'src/fishpack_c_api.f90',
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
fishpack_ext = py.extension_module(
|
|
156
|
+
'fishpack',
|
|
157
|
+
['src/pyfishpack_module.c'] + modern_fortran_sources,
|
|
158
|
+
include_directories: inc_np,
|
|
159
|
+
dependencies: dependencies,
|
|
160
|
+
fortran_args: fortran_args,
|
|
161
|
+
c_args: c_args,
|
|
162
|
+
link_args: openmp_link_args,
|
|
163
|
+
install: true,
|
|
164
|
+
install_dir: package_install_dir,
|
|
165
|
+
build_by_default: true,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
custom_target(
|
|
169
|
+
'copy_to_source_for_inplace',
|
|
170
|
+
input: fishpack_ext,
|
|
171
|
+
output: 'inplace_copy_marker.txt',
|
|
172
|
+
command: [
|
|
173
|
+
py,
|
|
174
|
+
'-c',
|
|
175
|
+
'''
|
|
176
|
+
import shutil
|
|
177
|
+
import sys
|
|
178
|
+
from pathlib import Path
|
|
179
|
+
|
|
180
|
+
current_dir = Path.cwd()
|
|
181
|
+
module_dir = current_dir.parent
|
|
182
|
+
patterns = ["fishpack*.so", "fishpack*.pyd", "fishpack*.dylib"]
|
|
183
|
+
|
|
184
|
+
for stale_pattern in patterns:
|
|
185
|
+
for stale_file in module_dir.glob(stale_pattern):
|
|
186
|
+
try:
|
|
187
|
+
stale_file.unlink()
|
|
188
|
+
print(f"Removed stale source artifact {stale_file.name}")
|
|
189
|
+
except Exception as exc:
|
|
190
|
+
print(f"Failed to remove stale source artifact {stale_file.name}: {exc}")
|
|
191
|
+
|
|
192
|
+
copied = False
|
|
193
|
+
for pattern in patterns:
|
|
194
|
+
for built_file in current_dir.rglob(pattern):
|
|
195
|
+
target = module_dir / built_file.name
|
|
196
|
+
if not target.exists() or built_file.stat().st_mtime > target.stat().st_mtime:
|
|
197
|
+
shutil.copy2(str(built_file), str(target))
|
|
198
|
+
print(f"Copied {built_file.name} to source")
|
|
199
|
+
copied = True
|
|
200
|
+
|
|
201
|
+
if not copied:
|
|
202
|
+
print("No fishpack extension artifact needed copying")
|
|
203
|
+
|
|
204
|
+
with open(sys.argv[1], "w", encoding="utf-8") as handle:
|
|
205
|
+
handle.write("PyFishPack extension copied\\n")
|
|
206
|
+
''',
|
|
207
|
+
'@OUTPUT@',
|
|
208
|
+
],
|
|
209
|
+
build_by_default: true,
|
|
210
|
+
console: true,
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
message('PyFishPack configured with modern Fortran backend and NumPy C API wrapper')
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
include ../make.inc
|
|
3
|
+
|
|
4
|
+
SRC=blktri.f cblktri.f cmgnbn.f comf.f fftpack.f genbun.f gnbnaux.f \
|
|
5
|
+
hstcrt.f hstcsp.f hstcyl.f hstplr.f hstssp.f hw3crt.f hwscrt.f \
|
|
6
|
+
hwscsp.f hwscyl.f hwsplr.f hwsssp.f pois3d.f poistg.f sepaux.f \
|
|
7
|
+
sepeli.f sepx4.f
|
|
8
|
+
|
|
9
|
+
OBJ=$(subst .f,.o,$(SRC))
|
|
10
|
+
OBJS=$(addprefix ../objs/,$(OBJ))
|
|
11
|
+
|
|
12
|
+
$(LIB) : $(OBJS)
|
|
13
|
+
$(AR) -rv $@ $?
|
|
14
|
+
|
|
15
|
+
../objs/%.o : %.f
|
|
16
|
+
$(F90) -c $< -o $@
|
|
17
|
+
|
|
18
|
+
clean:
|
|
19
|
+
rm -f $(LIB) $(OBJS)
|