Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
1241 lines (1201 loc) · 64.5 KB
/
Copy pathsetup.py
File metadata and controls
1241 lines (1201 loc) · 64.5 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import sys, os
import platform
import subprocess
import setuptools
from distutils import sysconfig
cfg_vars = sysconfig.get_config_vars()
for key, value in cfg_vars.items():
if type(value) == str:
cfg_vars[key] = cfg_vars[key].replace("-Wstrict-prototypes", "")
cfg_vars[key] = cfg_vars[key].replace("-Wall", "-w")
# Some conda-forge Python builds (confirmed: the environment-dev.yml-pinned
# python=3.12.5 osx-64 build) bake '-Wl,-rpath,<dir>' into their own
# sysconfig LDSHARED/LDCXXSHARED *twice* already -- i.e. every C/C++
# extension this interpreter links inherits a duplicate rpath before
# anything in this setup.py adds a single flag of its own. On current
# macOS, dyld refuses to even open a .so with a literal duplicate LC_RPATH
# load command ("dlopen(...): tried: ... (duplicate LC_RPATH ...)"), so
# every extension built with such an interpreter fails to import. Separately,
# the conda-forge `compilers` package's own activation script sets $LDFLAGS
# to the *same* '-Wl,-rpath,<dir>' -- and setuptools appends $LDFLAGS to
# every link command in addition to LDSHARED/LDCXXSHARED, so even after
# collapsing LDSHARED's own internal duplicate down to one copy, that one
# copy plus LDFLAGS's copy still add up to two identical LC_RPATH entries.
# dyld's duplicate check is on the *final linked binary*, not the source of
# each flag, so both angles have to be deduped together: collapse repeats
# within LDSHARED/LDCXXSHARED themselves, then drop any rpath token from
# them that's already present in $LDFLAGS (leaving LDFLAGS's copy as the
# single source of truth). Patched here, in the same place this file
# already patches other sysconfig quirks above, rather than in every
# individual Extension(). Python 3.12 removed distutils from the stdlib, so
# setuptools' build_ext actually customizes the compiler via the *stdlib*
# `sysconfig` module's own config cache, not `distutils.sysconfig`'s (they
# are two distinct dicts on this setuptools/Python combination, confirmed
# by identity check) -- patch both so this holds regardless of which one
# the installed setuptools version ends up reading from.
def _dedup_rpath_tokens(flags):
ldflags_env = os.environ.get('LDFLAGS', '')
seen = set()
out = []
for tok in flags.split():
if tok.startswith('-Wl,-rpath,'):
if tok in seen or tok in ldflags_env:
continue
seen.add(tok)
out.append(tok)
return ' '.join(out)
import sysconfig as _stdlib_sysconfig
for _cfg_vars in (cfg_vars, _stdlib_sysconfig.get_config_vars()):
for key in ('LDSHARED', 'LDCXXSHARED'):
if isinstance(_cfg_vars.get(key), str):
_cfg_vars[key] = _dedup_rpath_tokens(_cfg_vars[key])
# '-partition=none' is a *mangled* '-flto-partition=none'. conda-forge's
# python recipe strips its own build-time LTO flags back out of the installed
# _sysconfigdata, and a substring removal of '-flto' turns
# '-flto-partition=none' into '-partition=none' -- which no gcc/g++ accepts
# ("unrecognized command-line option '-partition=none'; did you mean
# '-flto-partition=none'?"). The token sits in the interpreter's own
# sysconfig CFLAGS, so every extension this interpreter builds inherits it
# and the whole wheel build dies at the first compile, before any of
# proteus's own sources are even parsed.
#
# This is per python *build*, not per version, which is why the same source
# builds locally and fails in CI: linux-64 python 3.13.15 from
# python-split_1786366211553 has the LTO flags cleanly removed (blank gaps in
# CFLAGS where they were), while 3.13.15 from python-split_1788361500653 --
# the build the sdist.yml "linux-64 / py3.13 (locked)" leg resolves, since
# the environment files pin the version but not the build string -- carries
# the mangled token. Dropping it is safe rather than a workaround for a flag
# we want: the '-flto' it was an option to is already gone, and the
# '-fuse-linker-plugin'/'-ffat-lto-objects' left beside it are valid options
# that are inert without it.
#
# Patched over *both* config dicts for the same reason the rpath dedup above
# is: depending on the setuptools version the compiler is customized from the
# stdlib `sysconfig` cache rather than `distutils.sysconfig`'s, and pip's
# build isolation installs its own newer setuptools regardless of what the
# conda environment pins -- the failing CI compile lines still carry the
# leading '-Wall' that the distutils-only rewrite at the top of this file
# replaces with '-w', which is direct evidence that under an isolated build
# it is the stdlib dict, not that one, that reaches the compiler.
for _cfg_vars in (cfg_vars, _stdlib_sysconfig.get_config_vars()):
for key, value in _cfg_vars.items():
if isinstance(value, str) and '-partition=none' in value:
_cfg_vars[key] = value.replace('-partition=none', '')
# setuptools appends the *environment's* CFLAGS/CXXFLAGS/CPPFLAGS/LDFLAGS to
# each compile and link line on top of whatever sysconfig supplies, so scrub
# those too in case an activation script re-exports the same broken flags.
for _env_var in ('CFLAGS', 'CXXFLAGS', 'CPPFLAGS', 'LDFLAGS'):
if '-partition=none' in os.environ.get(_env_var, ''):
os.environ[_env_var] = os.environ[_env_var].replace('-partition=none', '')
from distutils.core import setup
from Cython.Build import cythonize
from Cython.Distutils.extension import Extension
from Cython.Distutils import build_ext
class custom_build_ext(build_ext):
def build_extension(self, ext):
# Four sources are listed by two extensions each: mesh.cpp and
# meshio.cpp (cmeshTools, cpartitioning), postprocessing.c
# (cfemIntegrals, cpostprocessing) and
# SubsurfaceTransportCoefficients.cpp (cSubsurfaceTransportCoefficients,
# cTwophaseDarcyCoefficients). setuptools derives each object path from
# the source path under a single self.build_temp, so both members of a
# pair compile to the *same* .o -- and since build_extensions sets
# self.parallel, setuptools builds extensions concurrently in a
# ThreadPoolExecutor over os.cpu_count() threads. Two threads then write
# one object file at once.
#
# This fails two ways, both silent. The linker can read a half-written
# object, yielding a .so missing every symbol from that source -- the
# build succeeds and the failure surfaces only at import ("undefined
# symbol: regularMeshNodes2D"). Or both compiles complete and whichever
# lands last is linked into both extensions, which is worse here because
# the pairs do not use the same flags: cpartitioning adds -std=c++20
# where cmeshTools does not, and cfemIntegrals defines PROTEUS_SUPERLU_H
# where cpostprocessing does not.
#
# Give every extension its own object directory. Mutating
# self.build_temp in place would itself race, so hand build_extension a
# shallow copy of this command carrying a private build_temp; the
# compiler is passed output_dir explicitly, so the copy is enough.
# imported here, not at module scope: the only `os` in this file's
# namespace arrives incidentally via `from proteus.config import *`.
import copy as _copy, os as _osmod
private = _copy.copy(self)
private.build_temp = _osmod.path.join(self.build_temp, '_ext',
ext.name.replace('.', '_'))
_osmod.makedirs(private.build_temp, exist_ok=True)
return build_ext.build_extension(private, ext)
def build_extensions(self):
self.parallel=True
# OpenMPI's/MPICH's mpi.h transparently pulls in its legacy C++
# bindings (the `MPI::` namespace, removed from the MPI standard
# since 3.0) the moment mpi.h is included from a C++ translation
# unit. Several extensions (cmeshTools.pyx/cpartitioning.pyx/
# RANS2P.cpp and others) pull mpi.h in this way via generated
# Cython code that `cimport`s mpi4py.MPI, which #includes mpi.h
# before any of proteus's own headers get a chance to guard
# against this -- and per-extension `extra_compile_args` wiring is
# inconsistent across this file's ~100 Extension() entries (some
# include PROTEUS_EXTRA_COMPILE_ARGS, several of the mprans.c*
# extensions don't), so a couple of these silently slipped through
# a first attempt at fixing this per-extension. Some of the
# bindings' methods aren't fully header-inline, so merely including
# the header -- without proteus's own source ever writing `MPI::`
# anywhere -- silently requires linking a separate libmpi_cxx that
# these extensions never ask for. Confirmed via a real build
# against Ubuntu's system OpenMPI package: cpartitioning and
# mprans.cRANS2P both failed to import with "undefined symbol:
# _ZN3MPI8Datatype4FreeEv". Setting this here, on the compiler
# instance itself right before any extension is actually compiled
# (same idea as the -fPIE handling below, applied globally rather
# than per-Extension), guarantees every extension gets it
# regardless of that extension's own extra_compile_args. Getting
# the right attribute took two tries: patching compiler_so alone
# only reached .c files, and compiler_cxx turned out to be a red
# herring too -- on this setuptools/Python combination, UnixCCompiler
# ._compile() actually dispatches C++ sources through
# compiler_so_cxx (confirmed by reading _compile()'s source
# directly: it builds the g++ command from compiler_so_cxx, not
# compiler_cxx, which distutils only ever uses as a bare
# [executable-name] placeholder). Patch every list that could
# plausibly be consulted so this isn't sensitive to yet another
# distutils-vs-setuptools-vendored-copy naming difference.
for macro in ('-DOMPI_SKIP_MPICXX', '-DMPICH_SKIP_MPICXX'):
for attr in ('compiler_so', 'compiler_so_cxx', 'compiler_cxx', 'compiler'):
lst = getattr(self.compiler, attr, None)
if isinstance(lst, list) and macro not in lst:
lst.append(macro)
try:
self.compiler.linker_so.remove('-Wl,-pie')
self.compiler.compiler_so.remove('-fPIE')
self.compiler.linker_so.remove('-fPIE')
self.compiler.compiler.remove('-fPIE')
except:
pass
build_ext.build_extensions(self)
import numpy
## \file setup.py setup.py
# \brief The python script for building proteus
#
# Set the DISTUTILS_DEBUG environment variable to print detailed information while setup.py is running.
#
# insert (not append): an already-installed proteus package earlier on
# sys.path (e.g. via PYTHONPATH pointing at a previous --target install)
# would otherwise shadow *this* checkout's own proteus/config, silently
# building against a stale config.py instead of the one actually being
# edited/rebuilt.
sys.path.insert(0, os.path.join(os.path.dirname(__file__)))
from proteus import config
from proteus.config import *
###to turn on debugging in c++
##\todo Finishing cleaning up setup.py/setup.cfg, config.py...
PROTEUS_PETSC_EXTRA_LINK_ARGS = getattr(config, 'PROTEUS_PETSC_EXTRA_LINK_ARGS', [])
PROTEUS_PETSC_EXTRA_COMPILE_ARGS = getattr(config, 'PROTEUS_PETSC_EXTRA_COMPILE_ARGS', [])
PROTEUS_CHRONO_CXX_FLAGS = getattr(config, 'PROTEUS_CHRONO_CXX_FLAGS', [])
proteus_install_path = os.path.join(sysconfig.get_python_lib(), 'proteus')
# handle non-system installations
for arg in sys.argv:
if arg.startswith('--root'):
proteus_install_path = proteus_install_path.partition(sys.prefix + '/')[-1]
break
if arg.startswith('--prefix'):
proteus_install_path = proteus_install_path.partition(sys.prefix + '/')[-1]
break
def get_pybind_include_dirs():
"""Include path for the pybind11 extensions.
These need pybind11, numpy and proteus's own headers (`proteus/pyarray.h`
in particular, via the `proteus` entry).
"""
return [str(get_pybind_include()),
str(get_pybind_include(user=True)),
str(get_numpy_include()),
os.path.join(prefix, 'include'),
os.path.join(sys.prefix, 'include'),
os.path.join(sys.prefix, 'Library', 'include'),
'proteus']
class get_pybind_include(object):
"""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)
class get_numpy_include(object):
"""Helper class to determine the numpy include path
The purpose of this class is to postpone importing numpy
until it is actually installed, so that the ``get_include()``
method can be invoked. """
def __init__(self):
pass
def __str__(self):
import numpy as np
return np.get_include()
# -mavx is x86-only; unconditionally requesting it fails outright on arm64
# ("unsupported option '-mavx' for target ...") rather than just being a
# missed optimization. But not every non-arm64 host actually supports AVX
# either (older Xeons/Atoms, and some virtualized/cloud CPU profiles that
# expose a conservative feature mask, e.g. QEMU's default "qemu64" model) --
# requesting it there doesn't fail the build, it silently bakes an illegal
# instruction into mprans.MeshSmoothing/mprans.cMoveMeshMonitor that SIGILLs
# the first time either module is imported. So probe the actual build host's
# CPU capability instead of just checking platform.machine(). If detection
# itself isn't possible (unknown platform, sandboxed build host, etc.),
# default to no AVX -- a missed optimization is far cheaper than a crash.
def _host_supports_avx():
if platform.machine() not in ('x86_64', 'AMD64', 'i386', 'i686'):
return False
if platform.system() == 'Linux':
try:
with open('/proc/cpuinfo') as f:
return any(
'avx' in line.split(':', 1)[1].split()
for line in f if line.startswith('flags')
)
except (OSError, IndexError):
return False
if platform.system() == 'Darwin':
try:
out = subprocess.check_output(
['sysctl', '-n', 'machdep.cpu.features'],
stderr=subprocess.DEVNULL).decode()
return 'AVX' in out.split()
except (OSError, subprocess.CalledProcessError):
return False
# e.g. Windows -- no cheap portable probe here; be conservative.
return False
PROTEUS_AVX_FLAGS = ['-mavx'] if _host_supports_avx() else []
def _probe_pumi_partitioners(scorec_lib_dir):
"""Which graph partitioners the PUMI (SCOREC core) install was built with.
SCOREC's installed CMake target files carry PUMI_HAS_ZOLTAN on apf_zoltan
and PUMI_HAS_METIS on apf_metis when core was built with them (the
libraries themselves always exist, as an empty stub when not enabled).
Returns {'zoltan': 1|0|-1, 'metis': 1|0|-1}; -1 means the install has no
CMake target files to read, so the answer is unknown.
"""
found = {}
for name, tgt in (('zoltan', 'apf_zoltan'), ('metis', 'apf_metis')):
found[name] = -1
cmake_dir = os.path.join(scorec_lib_dir or '', 'cmake', 'SCOREC')
files = [os.path.join(cmake_dir, f) for f in (
os.listdir(cmake_dir) if os.path.isdir(cmake_dir) else [])
if f.startswith(tgt + '-target')]
if files:
text = ''.join(open(f).read() for f in files)
found[name] = int(('PUMI_HAS_' + name.upper()) in text)
return found
PROTEUS_PUMI_PARTITIONERS = _probe_pumi_partitioners(PROTEUS_SCOREC_LIB_DIR)
print("proteus build: PUMI partitioners (%s): %s" % (
PROTEUS_SCOREC_LIB_DIR,
", ".join("%s=%s" % (k, {1: 'yes', 0: 'no', -1: 'unknown'}[v])
for k, v in sorted(PROTEUS_PUMI_PARTITIONERS.items()))))
# What is expected to vectorize (C30, ON_NODE_PERFORMANCE_BASELINE.md §6;
# decided 2026-10-24). The extensions compile at sysconfig's -O2 with no
# -march, plus PROTEUS_OPT from the environment for a site's choice. The
# legacy element kernels in femIntegrals.c are scaffolding on the way to the
# generated kernels (campaign C19) and are not expected to vectorize: their
# flat index arithmetic and in-memory accumulators keep the compiler out at
# any flag level (clang -Rpass: 150 of 369 loops at -O2, none of the passes
# that dominate assembly; -O3 -mcpu=native changes the residual by 10% and the
# Jacobian by nothing). The generated kernels are expected to, over the
# quadrature points of an element, which needs local accumulators, restrict
# (or references into fixed-size element arrays) and compile-time element
# shape. Keep -O2 the default; do not tune the legacy passes for flags.
EXTENSIONS_TO_BUILD = [
Extension("MeshAdaptPUMI.MeshAdapt",
sources = ['proteus/MeshAdaptPUMI/MeshAdapt.pyx', 'proteus/MeshAdaptPUMI/cMeshAdaptPUMI.cpp',
'proteus/MeshAdaptPUMI/MeshConverter.cpp', 'proteus/MeshAdaptPUMI/ParallelMeshConverter.cpp',
'proteus/MeshAdaptPUMI/MeshFields.cpp', 'proteus/MeshAdaptPUMI/SizeField.cpp',
'proteus/MeshAdaptPUMI/DumpMesh.cpp',
'proteus/MeshAdaptPUMI/ErrorResidualMethod.cpp','proteus/MeshAdaptPUMI/VMS.cpp','proteus/MeshAdaptPUMI/createAnalyticGeometry.cpp'],
depends=["proteus/partitioning.h",
"proteus/partitioning.cpp",
"proteus/cpartitioning.pyx",
"proteus/cmeshTools.pxd",
"proteus/mesh.h",
"proteus/index_type.h",
'proteus/mesh.cpp',
'proteus/meshio.cpp'],
define_macros=[('PROTEUS_SUPERLU_H',PROTEUS_SUPERLU_H),
('PROTEUS_PUMI_HAS_ZOLTAN',PROTEUS_PUMI_PARTITIONERS['zoltan']),
('PROTEUS_PUMI_HAS_METIS',PROTEUS_PUMI_PARTITIONERS['metis']),
('PROTEUS_PUMI_PROBED_DIR','"%s"' % PROTEUS_SCOREC_LIB_DIR)],
language='c++',
include_dirs=[numpy.get_include(),'include',
'proteus','proteus/MeshAdaptPUMI']+
PROTEUS_SCOREC_INCLUDE_DIRS,
library_dirs=PROTEUS_SCOREC_LIB_DIRS,
libraries=PROTEUS_SCOREC_LIBS,
extra_compile_args=['-std=c++20']+PROTEUS_SCOREC_EXTRA_COMPILE_ARGS+PROTEUS_EXTRA_COMPILE_ARGS+PROTEUS_OPT,
extra_link_args=PROTEUS_SCOREC_EXTRA_LINK_ARGS+PROTEUS_EXTRA_LINK_ARGS),
Extension(
'mprans.cArgumentsDict',
sources = ['proteus/mprans/ArgumentsDict.cpp'],
depends=['proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h'],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'),
Extension(
'mprans.cPres',
sources = ['proteus/mprans/Pres.cpp'],
depends=['proteus/mprans/Pres.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'),
Extension(
'mprans.cPresInit',
sources = ['proteus/mprans/PresInit.cpp'],
depends=['proteus/mprans/PresInit.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'),
Extension(
'mprans.cPresInc',
sources = ['proteus/mprans/PresInc.cpp'],
depends = ['proteus/mprans/PresInc.h', 'proteus/mprans/PresInc.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'),
Extension('mprans.cAddedMass',
sources = ['proteus/mprans/AddedMass.cpp'],
depends=['proteus/mprans/AddedMass.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
language='c++',
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20']),
Extension('mprans.SedClosure',
sources = ['proteus/mprans/SedClosure.cpp'],
depends = ['proteus/mprans/SedClosure.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
language='c++',
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20']),
Extension('mprans.cVOF3P',
sources = ['proteus/mprans/VOF3P.cpp'],
depends = ['proteus/mprans/VOF3P.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
language='c++',
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20']),
Extension(
'mprans.cVOS3P',
sources = ['proteus/mprans/VOS3P.cpp'],
depends = ['proteus/mprans/VOS3P.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'),
Extension('mprans.cNCLS3P',
sources=['proteus/mprans/NCLS3P.cpp'],
depends=['proteus/mprans/NCLS3P.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h' , 'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
language='c++',
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20']),
Extension('mprans.cMCorr3P',
sources=['proteus/mprans/MCorr3P.cpp'],
depends=['proteus/mprans/MCorr3P.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
language='c++',
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
extra_link_args=PROTEUS_EXTRA_LINK_ARGS,
define_macros=[('PROTEUS_LAPACK_H',
PROTEUS_LAPACK_H),
('PROTEUS_LAPACK_INTEGER',
PROTEUS_LAPACK_INTEGER),
('PROTEUS_BLAS_H',
PROTEUS_BLAS_H)],
library_dirs=[PROTEUS_LAPACK_LIB_DIR,
PROTEUS_BLAS_LIB_DIR],
libraries=['m',PROTEUS_LAPACK_LIB,
PROTEUS_BLAS_LIB],
),
Extension(
'mprans.cRANS3PSed',
sources=['proteus/mprans/RANS3PSed.cpp'],
depends=['proteus/mprans/RANS3PSed.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'),
Extension(
'mprans.cRANS3PSed2D',
sources=['proteus/mprans/RANS3PSed2D.cpp'],
depends=['proteus/mprans/RANS3PSed2D.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'),
Extension(
'richards.cRichards',
sources=['proteus/richards/cRichards.cpp'],
depends=['proteus/richards/Richards.h', 'proteus/pskRelations.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h' ,'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
include_dirs=get_pybind_include_dirs(),
language='c++',
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
),
Extension(
# proteus/richards/ADR.py does `from .cADR import *`. This entry was
# dropped in merge 9e2aca55 (2026-08-12); see erdc/proteus#1285.
'richards.cADR',
sources=['proteus/richards/cADR.cpp'],
depends=['proteus/richards/ADR.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
include_dirs=get_pybind_include_dirs(),
language='c++',
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
),
Extension(
'm_comp_co2.cm_comp_co2',
sources=['proteus/m_comp_co2/cm_comp_co2.cpp'],
depends=['proteus/m_comp_co2/m_comp_co2.h', 'proteus/pskRelations.h', 'proteus/m_comp_co2/co2_brine_flash.h', 'proteus/m_comp_co2/co2_brine_eos.h', 'proteus/m_comp_co2/jet2.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h' ,'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
include_dirs=get_pybind_include_dirs(),
language='c++',
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
),
Extension(
'elastoplastic.cElastoPlastic',
sources=['proteus/elastoplastic/cElastoPlastic.cpp'],
define_macros=[('PROTEUS_LAPACK_H',
PROTEUS_LAPACK_H),
('PROTEUS_LAPACK_INTEGER',
PROTEUS_LAPACK_INTEGER),
('PROTEUS_BLAS_H',
PROTEUS_BLAS_H)],
depends=['proteus/elastoplastic/ElastoPlastic.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h'],
include_dirs=get_pybind_include_dirs(),
language='c++',
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
library_dirs=[PROTEUS_LAPACK_LIB_DIR,
PROTEUS_BLAS_LIB_DIR],
libraries=['m',PROTEUS_LAPACK_LIB,
PROTEUS_BLAS_LIB],
extra_link_args=PROTEUS_EXTRA_LINK_ARGS
),
Extension(
'mprans.cRANS3PF',
sources=['proteus/mprans/RANS3PF.cpp'],
depends=['proteus/mprans/RANS3PF.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h',
'proteus/equivalent_polynomials.h',
'proteus/equivalent_polynomials_utils.h',
'proteus/equivalent_polynomials_coefficients.h',
'proteus/equivalent_polynomials_coefficients_quad.h'],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'),
Extension(
'mprans.cRANS3PF2D',
sources=['proteus/mprans/RANS3PF2D.cpp'],
depends=['proteus/mprans/RANS3PF2D.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h',
'proteus/equivalent_polynomials.h',
'proteus/equivalent_polynomials_utils.h',
'proteus/equivalent_polynomials_coefficients.h',
'proteus/equivalent_polynomials_coefficients_quad.h'],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'),
Extension("Isosurface",
sources=['proteus/Isosurface.pyx'],
language='c',
extra_compile_args=PROTEUS_OPT,
include_dirs=[numpy.get_include(),'proteus'],
extra_link_args=PROTEUS_EXTRA_LINK_ARGS),
Extension("BoundaryConditions",
sources=['proteus/BoundaryConditions.py'],
depends=['proteus/BoundaryConditions.pxd'],
language='c++',
extra_compile_args=PROTEUS_OPT+['-std=c++14'],
include_dirs=[numpy.get_include(),'proteus']),
Extension("mprans.BoundaryConditions",
sources=['proteus/mprans/BoundaryConditions.py'],
depends=['proteus/mprans/BoundaryConditions.pxd'],
language='c++',
extra_compile_args=PROTEUS_OPT+['-std=c++14'],
include_dirs=[numpy.get_include(),'proteus']),
Extension("mprans.MeshSmoothing",
sources=['proteus/mprans/MeshSmoothing.pyx'],
language='c++',
include_dirs=[numpy.get_include(),'proteus',PROTEUS_INCLUDE_DIR],
libraries=['stdc++','m'],
extra_compile_args=["-std=c++20"]+PROTEUS_AVX_FLAGS+PROTEUS_OPT),
Extension("mprans.cMoveMeshMonitor",
sources=['proteus/mprans/cMoveMeshMonitor.pyx'],
language='c++',
include_dirs=[numpy.get_include(),'proteus',PROTEUS_INCLUDE_DIR],
libraries=['stdc++','m'],
extra_compile_args=["-std=c++20"]+PROTEUS_AVX_FLAGS+PROTEUS_OPT),
Extension("mbd.CouplingFSI",
sources=['proteus/mbd/CouplingFSI.pyx',
'proteus/mbd/ChVariablesBodyAddedMass.cpp',
'proteus/mbd/ChBodyAddedMass.cpp'],
depends=['proteus/mbd/CouplingFSI.pxd',
'proteus/mbd/ChronoHeaders.pxd',
'proteus/mbd/ProtChBody.h',
'proteus/mbd/ProtChMoorings.h'],
language='c++',
include_dirs=[numpy.get_include(),
'proteus',
'proteus/mbd',
PROTEUS_INCLUDE_DIR,
PROTEUS_INCLUDE_DIR+'/eigen3',
PROTEUS_CHRONO_INCLUDE_DIR,
PROTEUS_CHRONO_INCLUDE_DIR+'/chrono',
PROTEUS_CHRONO_INCLUDE_DIR+'/chrono/collision/bullet',],
library_dirs=[PROTEUS_CHRONO_LIB_DIR],
libraries=['Chrono_core',
'stdc++',
'm'],
extra_compile_args=["-std=c++20"]+PROTEUS_CHRONO_CXX_FLAGS+PROTEUS_OPT,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS),
Extension("WaveTools",
sources=['proteus/WaveTools.py'],
depends=['proteus/WaveTools.h'],
language='c++',
extra_compile_args=PROTEUS_OPT,
include_dirs=[numpy.get_include(),'proteus']),
Extension("fenton.Fenton",
sources=['proteus/fenton/Fenton.pyx',
'proteus/fenton/Solve.cpp',
'proteus/fenton/Dpythag.cpp',
'proteus/fenton/Dsvbksb.cpp',
'proteus/fenton/Dsvdcmp.cpp',
'proteus/fenton/Inout.cpp',
'proteus/fenton/Subroutines.cpp',
'proteus/fenton/Util.cpp',],
language='c++',
include_dirs=[numpy.get_include(),
'proteus',
PROTEUS_INCLUDE_DIR,],
libraries=['stdc++','m'],
extra_compile_args=["-std=c++11"]+PROTEUS_OPT),
Extension(
'cADR',
sources=['proteus/ADR.cpp'],
depends=['proteus/ADR.h', 'proteus/mprans/ArgumentsDict.h', 'proteus/pyarray.h', 'proteus/ModelFactory.h', 'proteus/CompKernel.h',
'proteus/equivalent_polynomials.h',
'proteus/equivalent_polynomials_utils.h',
'proteus/equivalent_polynomials_coefficients.h',
'proteus/equivalent_polynomials_coefficients_quad.h'],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'
),
Extension("subsurfaceTransportFunctions",
sources=['proteus/subsurfaceTransportFunctions.pyx'],
include_dirs=[numpy.get_include(),'proteus'],
extra_compile_args=PROTEUS_OPT,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS),
Extension("equivalent_polynomials",
sources=['proteus/equivalent_polynomials.pyx'],
depends=['proteus/equivalent_polynomials.pxd',
'proteus/equivalent_polynomials.h',
'proteus/equivalent_polynomials_utils.h',
'proteus/equivalent_polynomials_coefficients.h',
'proteus/equivalent_polynomials_coefficients_quad.h'],
language='c++',
extra_compile_args=PROTEUS_OPT,
include_dirs=[numpy.get_include(),'proteus'],),
Extension('cfemIntegrals',
sources=['proteus/cfemIntegrals.pyx',
'proteus/femIntegrals.c',
'proteus/postprocessing.c'],
depends=['proteus/femIntegrals.h'],
define_macros=[('PROTEUS_SUPERLU_H',PROTEUS_SUPERLU_H),
('PROTEUS_LAPACK_H',PROTEUS_LAPACK_H),
('PROTEUS_LAPACK_INTEGER',PROTEUS_LAPACK_INTEGER),
('PROTEUS_BLAS_H',PROTEUS_BLAS_H)],
include_dirs=[numpy.get_include(),'proteus',
PROTEUS_SUPERLU_INCLUDE_DIR,
PROTEUS_LAPACK_INCLUDE_DIR,
PROTEUS_BLAS_INCLUDE_DIR],
library_dirs=[PROTEUS_LAPACK_LIB_DIR,
PROTEUS_BLAS_LIB_DIR],
libraries=['m',PROTEUS_LAPACK_LIB,PROTEUS_BLAS_LIB],
extra_compile_args=PROTEUS_EXTRA_COMPILE_ARGS+PROTEUS_OPT,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS),
Extension("csparsity",
sources=['proteus/csparsity.pyx', 'proteus/sparsity.cpp'],
depends=['proteus/sparsity.h'],
language='c++',
extra_compile_args=PROTEUS_OPT,
include_dirs=[numpy.get_include(),'proteus'],),
Extension("cmeshTools",
sources=['proteus/cmeshTools.pyx', 'proteus/mesh.cpp', 'proteus/meshio.cpp'],
language='c++',
define_macros=[('PROTEUS_SUPERLU_H',PROTEUS_SUPERLU_H),
('CMRVEC_BOUNDS_CHECK',1),
('MV_VECTOR_BOUNDS_CHECK',1),
('PETSCVEC_BOUNDS_CHECK',1),
('F77_POST_UNDERSCORE',1),
('USE_BLAS',1)],
include_dirs=['proteus',
numpy.get_include(),
str(get_pybind_include()),
str(get_pybind_include(user=True)),
PROTEUS_SUPERLU_INCLUDE_DIR,
PROTEUS_HDF5_INCLUDE_DIR] + \
PROTEUS_PETSC_INCLUDE_DIRS + \
PROTEUS_MPI_INCLUDE_DIRS,
library_dirs=PROTEUS_PETSC_LIB_DIRS+PROTEUS_MPI_LIB_DIRS+PROTEUS_HDF5_LIB_DIRS,
libraries=['hdf5','stdc++','m']+PROTEUS_PETSC_LIBS+PROTEUS_MPI_LIBS+PROTEUS_HDF5_LIBS,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS + PROTEUS_PETSC_EXTRA_LINK_ARGS,
extra_compile_args=PROTEUS_EXTRA_COMPILE_ARGS + PROTEUS_PETSC_EXTRA_COMPILE_ARGS+PROTEUS_OPT),
Extension('ctransportCoefficients',
sources=['proteus/ctransportCoefficients.pyx','proteus/transportCoefficients.c'],
include_dirs=[numpy.get_include(),'proteus'],
depends=["proteus/transportCoefficients.h"],
language="c",
libraries=['m'],
extra_compile_args=PROTEUS_OPT),
Extension('csubgridError',
sources=['proteus/csubgridError.pyx','proteus/subgridError.c'],
depends=["proteus/subgridError.h"],
language="c",
include_dirs=[numpy.get_include(),'proteus'],
libraries=['m'],
extra_compile_args=PROTEUS_EXTRA_COMPILE_ARGS+PROTEUS_OPT,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS),
Extension('cshockCapturing',
sources=['proteus/cshockCapturing.pyx','proteus/shockCapturing.c'],
depends=["proteus/shockCapturing.h"],
language="c",
include_dirs=[numpy.get_include(),'proteus'],
libraries=['m'],
extra_compile_args=PROTEUS_EXTRA_COMPILE_ARGS+PROTEUS_OPT,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS),
Extension('superluWrappers',
sources=['proteus/superluWrappers.pyx'],
define_macros=[('PROTEUS_SUPERLU_H',PROTEUS_SUPERLU_H),
('PROTEUS_BLAS_H',PROTEUS_BLAS_H)],
language="c",
include_dirs=[numpy.get_include(),
'proteus',
PROTEUS_SUPERLU_INCLUDE_DIR],
library_dirs=[PROTEUS_SUPERLU_LIB_DIR,
PROTEUS_LAPACK_LIB_DIR,
PROTEUS_BLAS_LIB_DIR,
PROTEUS_METIS_LIB_DIR],
libraries=['m',
PROTEUS_SUPERLU_LIB,
PROTEUS_LAPACK_LIB,PROTEUS_BLAS_LIB,
PROTEUS_METIS_LIB],
extra_compile_args=PROTEUS_EXTRA_COMPILE_ARGS+PROTEUS_OPT,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS),
Extension("csmoothers",
sources=["proteus/csmoothers.pyx", "proteus/smoothers.c"],
define_macros=[('PROTEUS_SUPERLU_H',PROTEUS_SUPERLU_H),
('PROTEUS_LAPACK_H',PROTEUS_LAPACK_H),
('PROTEUS_LAPACK_INTEGER',PROTEUS_LAPACK_INTEGER),
('PROTEUS_BLAS_H',PROTEUS_BLAS_H)],
language="c",
include_dirs=['proteus',
numpy.get_include(),
PROTEUS_SUPERLU_INCLUDE_DIR,
PROTEUS_LAPACK_INCLUDE_DIR,
PROTEUS_BLAS_INCLUDE_DIR,
],
library_dirs=[PROTEUS_SUPERLU_INCLUDE_DIR,
PROTEUS_SUPERLU_LIB_DIR,
PROTEUS_LAPACK_LIB_DIR,
PROTEUS_BLAS_LIB_DIR,
PROTEUS_METIS_LIB_DIR],
libraries=['m',
PROTEUS_SUPERLU_LIB,
PROTEUS_LAPACK_LIB,
PROTEUS_BLAS_LIB,
PROTEUS_METIS_LIB],
extra_compile_args=PROTEUS_EXTRA_COMPILE_ARGS+PROTEUS_OPT,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS),
Extension("canalyticalSolutions",
sources=["proteus/canalyticalSolutions.pyx", "proteus/analyticalSolutions.c"],
depends=["proteus/analyticalSolutions.h"],
extra_compile_args=PROTEUS_OPT,
language="c", include_dirs=[numpy.get_include(), 'proteus']),
Extension("clapack",
sources=["proteus/clapack.pyx"],
depends=["proteus/proteus_lapack.h","proteus/proteus_blas.h"],
extra_compile_args=PROTEUS_EXTRA_COMPILE_ARGS+PROTEUS_OPT,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS,
language="c",
include_dirs=[numpy.get_include(), 'proteus',
PROTEUS_LAPACK_INCLUDE_DIR,
PROTEUS_BLAS_INCLUDE_DIR],
library_dirs=[PROTEUS_LAPACK_LIB_DIR,PROTEUS_BLAS_LIB_DIR],
libraries=['m',
PROTEUS_LAPACK_LIB,
PROTEUS_BLAS_LIB]),
Extension("cpostprocessing",
sources=["proteus/cpostprocessing.pyx","proteus/postprocessing.c"],
depends=["proteus/postprocessing.h","proteus/postprocessing.pxd"],
define_macros=[('PROTEUS_LAPACK_H',PROTEUS_LAPACK_H),
('PROTEUS_LAPACK_INTEGER',PROTEUS_LAPACK_INTEGER),
('PROTEUS_BLAS_H',PROTEUS_BLAS_H)],
extra_compile_args=PROTEUS_EXTRA_COMPILE_ARGS+PROTEUS_OPT,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS,
language="c",
include_dirs=[numpy.get_include(), 'proteus',
PROTEUS_LAPACK_INCLUDE_DIR,
PROTEUS_BLAS_INCLUDE_DIR],
library_dirs=[PROTEUS_LAPACK_LIB_DIR,PROTEUS_BLAS_LIB_DIR],
libraries=['m',
PROTEUS_LAPACK_LIB,
PROTEUS_BLAS_LIB]),
Extension('cnumericalFlux',
sources=['proteus/cnumericalFlux.pyx','proteus/numericalFlux.c'],
depends=["proteus/numericalFlux.h"],
extra_compile_args=PROTEUS_OPT,
language="c", include_dirs=[numpy.get_include(), 'proteus']),
Extension('ctimeIntegration',
sources=['proteus/ctimeIntegration.pyx','proteus/timeIntegration.c'],
depends=["proteus/timeIntegration.h"],
extra_compile_args=PROTEUS_OPT,
language="c", include_dirs=[numpy.get_include(), 'proteus']),
Extension("cTwophaseDarcyCoefficients",
sources=["proteus/cTwophaseDarcyCoefficients.pyx",
"proteus/SubsurfaceTransportCoefficients.cpp"],
depends=["proteus/SubsurfaceTransportCoefficients.h",
"proteus/pskRelations.h",
"proteus/pskRelations.pxd",
"proteus/densityRelations.h",
"proteus/twophaseDarcyCoefficients.pxd",
"proteus/twophaseDarcyCoefficients.h"],
define_macros=[('PROTEUS_SUPERLU_H',PROTEUS_SUPERLU_H),
('CMRVEC_BOUNDS_CHECK',1),
('MV_VECTOR_BOUNDS_CHECK',1),
('PETSCVEC_BOUNDS_CHECK',1),
('F77_POST_UNDERSCORE',1),
('USE_BLAS',1)],
include_dirs=['proteus',
numpy.get_include(),
PROTEUS_SUPERLU_INCLUDE_DIR,
PROTEUS_HDF5_INCLUDE_DIR] + \
PROTEUS_PETSC_INCLUDE_DIRS + \
PROTEUS_MPI_INCLUDE_DIRS,
language="c++",
library_dirs=PROTEUS_PETSC_LIB_DIRS+PROTEUS_MPI_LIB_DIRS+PROTEUS_HDF5_LIB_DIRS,
libraries=['hdf5','stdc++','m']+PROTEUS_PETSC_LIBS+PROTEUS_MPI_LIBS+PROTEUS_HDF5_LIBS,
extra_compile_args=PROTEUS_EXTRA_COMPILE_ARGS + PROTEUS_PETSC_EXTRA_COMPILE_ARGS+PROTEUS_OPT,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS + PROTEUS_PETSC_EXTRA_LINK_ARGS,
),
Extension("cSubsurfaceTransportCoefficients",
sources=["proteus/cSubsurfaceTransportCoefficients.pyx","proteus/SubsurfaceTransportCoefficients.cpp"],
depends=["proteus/SubsurfaceTransportCoefficients.pxd",
"proteus/SubsurfaceTransportCoefficients.h"],
define_macros=[('PROTEUS_SUPERLU_H',PROTEUS_SUPERLU_H),
('CMRVEC_BOUNDS_CHECK',1),
('MV_VECTOR_BOUNDS_CHECK',1),
('PETSCVEC_BOUNDS_CHECK',1),
('F77_POST_UNDERSCORE',1),
('USE_BLAS',1)],
include_dirs=['proteus',
numpy.get_include(),
PROTEUS_SUPERLU_INCLUDE_DIR,
PROTEUS_HDF5_INCLUDE_DIR] + \
PROTEUS_PETSC_INCLUDE_DIRS + \
PROTEUS_MPI_INCLUDE_DIRS,
language="c++",
library_dirs=PROTEUS_PETSC_LIB_DIRS+PROTEUS_MPI_LIB_DIRS+PROTEUS_HDF5_LIB_DIRS,
libraries=['hdf5','stdc++','m']+PROTEUS_PETSC_LIBS+PROTEUS_MPI_LIBS+PROTEUS_HDF5_LIBS,
extra_compile_args=PROTEUS_EXTRA_COMPILE_ARGS + PROTEUS_PETSC_EXTRA_COMPILE_ARGS+PROTEUS_OPT,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS + PROTEUS_PETSC_EXTRA_LINK_ARGS,
),
Extension("cpskRelations",
sources=["proteus/cpskRelations.pyx"],
depends=["proteus/pskRelations.pxd",
"proteus/pskRelations.h"],
define_macros=[('PROTEUS_SUPERLU_H',PROTEUS_SUPERLU_H),
('CMRVEC_BOUNDS_CHECK',1),
('MV_VECTOR_BOUNDS_CHECK',1),
('PETSCVEC_BOUNDS_CHECK',1),
('F77_POST_UNDERSCORE',1),
('USE_BLAS',1)],
include_dirs=['proteus',
numpy.get_include(),
PROTEUS_SUPERLU_INCLUDE_DIR,
PROTEUS_HDF5_INCLUDE_DIR] + \
PROTEUS_PETSC_INCLUDE_DIRS + \
PROTEUS_MPI_INCLUDE_DIRS,
language="c++",
library_dirs=PROTEUS_PETSC_LIB_DIRS+PROTEUS_MPI_LIB_DIRS+PROTEUS_HDF5_LIB_DIRS,
libraries=['hdf5','stdc++','m']+PROTEUS_PETSC_LIBS+PROTEUS_MPI_LIBS+PROTEUS_HDF5_LIBS,
extra_compile_args=PROTEUS_EXTRA_COMPILE_ARGS + PROTEUS_PETSC_EXTRA_COMPILE_ARGS+PROTEUS_OPT,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS + PROTEUS_PETSC_EXTRA_LINK_ARGS,
),
Extension("cpartitioning",
sources=["proteus/cpartitioning.pyx",
"proteus/partitioning.cpp",
"proteus/cartesianPartitioning.cpp",
'proteus/mesh.cpp',
'proteus/meshio.cpp',],
depends=["proteus/partitioning.h",
"proteus/partitioning.cpp",
"proteus/cartesianPartitioning.cpp",
"proteus/cpartitioning.pyx",
"proteus/cmeshTools.pxd",
"proteus/mesh.h",
"proteus/index_type.h",
'proteus/mesh.cpp',
'proteus/meshio.cpp'],
define_macros=[('PROTEUS_SUPERLU_H',PROTEUS_SUPERLU_H),
('CMRVEC_BOUNDS_CHECK',1),
('MV_VECTOR_BOUNDS_CHECK',1),
('PETSCVEC_BOUNDS_CHECK',1),
('F77_POST_UNDERSCORE',1),
('USE_BLAS',1)],
include_dirs=['proteus',
numpy.get_include(),
str(get_pybind_include()),
str(get_pybind_include(user=True)),
PROTEUS_SUPERLU_INCLUDE_DIR,
PROTEUS_HDF5_INCLUDE_DIR] +
PROTEUS_PETSC_INCLUDE_DIRS + PROTEUS_MPI_INCLUDE_DIRS,
language="c++",
library_dirs=PROTEUS_PETSC_LIB_DIRS+PROTEUS_MPI_LIB_DIRS+PROTEUS_HDF5_LIB_DIRS,
libraries=['hdf5','stdc++','m']+PROTEUS_PETSC_LIBS+PROTEUS_MPI_LIBS+PROTEUS_HDF5_LIBS,
extra_compile_args=['-std=c++20']+PROTEUS_EXTRA_COMPILE_ARGS + PROTEUS_PETSC_EXTRA_COMPILE_ARGS+PROTEUS_OPT,
extra_link_args=PROTEUS_EXTRA_LINK_ARGS + PROTEUS_PETSC_EXTRA_LINK_ARGS,
),
# Extension("flcbdfWrappers",["proteus/flcbdfWrappers.pyx"],
# language="c++",
# depends=["proteus/flcbdfWrappers.pxd"],
# define_macros=[('PROTEUS_SUPERLU_H',PROTEUS_SUPERLU_H),
# ('CMRVEC_BOUNDS_CHECK',1),
# ('MV_VECTOR_BOUNDS_CHECK',1),
# ('PETSCVEC_BOUNDS_CHECK',1),
# ('F77_POST_UNDERSCORE',1),
# ('USE_BLAS',1)],
# include_dirs=['proteus',
# numpy.get_include(),
# PROTEUS_SUPERLU_INCLUDE_DIR,
# PROTEUS_DAETK_INCLUDE_DIR,
# PROTEUS_HDF5_INCLUDE_DIR] + \
# PROTEUS_PETSC_INCLUDE_DIRS + \
# PROTEUS_MPI_INCLUDE_DIRS,
# library_dirs=[PROTEUS_DAETK_LIB_DIR]+PROTEUS_PETSC_LIB_DIRS+PROTEUS_MPI_LIB_DIRS+PROTEUS_HDF5_LIB_DIRS,
# libraries=['hdf5','stdc++','m',PROTEUS_DAETK_LIB]+PROTEUS_PETSC_LIBS+PROTEUS_MPI_LIBS+PROTEUS_HDF5_LIBS,
# extra_link_args=PROTEUS_EXTRA_LINK_ARGS + PROTEUS_PETSC_EXTRA_LINK_ARGS,
# extra_compile_args=PROTEUS_EXTRA_COMPILE_ARGS + PROTEUS_PETSC_EXTRA_COMPILE_ARGS+PROTEUS_OPT,
# ),
Extension(
'mprans.cCLSVOF',
sources=['proteus/mprans/CLSVOF.cpp'],
depends=["proteus/mprans/CLSVOF.h", "proteus/mprans/CLSVOF.h"] + ["proteus/ModelFactory.h","proteus/CompKernel.h"],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'),
Extension(
'mprans.cNCLS',
sources=['proteus/mprans/NCLS.cpp'],
depends=["proteus/mprans/NCLS.h", "proteus/mprans/ArgumentsDict.h", "proteus/pyarray.h"] + ["proteus/ModelFactory.h","proteus/CompKernel.h"],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'),
Extension(
'mprans.cMCorr',
sources=['proteus/mprans/MCorr.cpp'],
depends=["proteus/mprans/MCorr.h", "proteus/mprans/ArgumentsDict.h", "proteus/pyarray.h"] + ["proteus/ModelFactory.h","proteus/CompKernel.h"] + [
"proteus/equivalent_polynomials.h",
"proteus/equivalent_polynomials_utils.h",
"proteus/equivalent_polynomials_coefficients.h",
'proteus/equivalent_polynomials_coefficients_quad.h'],
define_macros=[('PROTEUS_LAPACK_H',PROTEUS_LAPACK_H),
('PROTEUS_LAPACK_INTEGER',PROTEUS_LAPACK_INTEGER),
('PROTEUS_BLAS_H',PROTEUS_BLAS_H)],
include_dirs=get_pybind_include_dirs(),
library_dirs=[PROTEUS_LAPACK_LIB_DIR,
PROTEUS_BLAS_LIB_DIR],
libraries=['m',PROTEUS_LAPACK_LIB,PROTEUS_BLAS_LIB],
extra_compile_args=PROTEUS_EXTRA_COMPILE_ARGS+PROTEUS_OPT+['-std=c++20'],
extra_link_args=PROTEUS_EXTRA_LINK_ARGS,
language='c++'),
Extension(
'mprans.cRANS2P',
sources=['proteus/mprans/RANS2P.cpp'],
depends=["proteus/mprans/RANS2P.h", "proteus/mprans/ArgumentsDict.h", "proteus/pyarray.h"] + ["proteus/MixedModelFactory.h","proteus/CompKernel.h"] + [
"proteus/equivalent_polynomials.h",
"proteus/equivalent_polynomials_utils.h",
"proteus/equivalent_polynomials_coefficients.h",
'proteus/equivalent_polynomials_coefficients_quad.h'],
include_dirs=get_pybind_include_dirs() + PROTEUS_MPI_INCLUDE_DIRS,
extra_compile_args=PROTEUS_OPT+PROTEUS_MPI_LIB_DIRS+['-std=c++20'],#,'-fopenmp'],#,'-DXTENSOR_USE_OPENMP'],
library_dirs=PROTEUS_MPI_LIB_DIRS+[PROTEUS_LAPACK_LIB_DIR,
PROTEUS_BLAS_LIB_DIR],
libraries=PROTEUS_MPI_LIBS+['m',
PROTEUS_LAPACK_LIB,
PROTEUS_BLAS_LIB],
extra_link_args=PROTEUS_SCOREC_EXTRA_LINK_ARGS+PROTEUS_EXTRA_LINK_ARGS,#+['-fopenmp'],
language='c++'),
Extension(
'mprans.cRANS2P_IB',
sources=['proteus/mprans/RANS2P_IB.cpp'],
depends=["proteus/mprans/RANS2P_IB.h", "proteus/mprans/ArgumentsDict.h", "proteus/pyarray.h"] + ["proteus/MixedModelFactory.h","proteus/CompKernel.h"] + [
"proteus/equivalent_polynomials.h",
"proteus/equivalent_polynomials_utils.h",
"proteus/equivalent_polynomials_coefficients.h",
'proteus/equivalent_polynomials_coefficients_quad.h'],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'),
Extension(
'mprans.cRANS2P2D',
sources=['proteus/mprans/RANS2P2D.cpp'],
depends=["proteus/mprans/RANS2P2D.h"] + ["proteus/MixedModelFactory.h","proteus/CompKernel.h"] + [
"proteus/equivalent_polynomials.h",
"proteus/equivalent_polynomials_utils.h",
"proteus/equivalent_polynomials_coefficients.h",
'proteus/equivalent_polynomials_coefficients_quad.h'],
include_dirs=get_pybind_include_dirs() + PROTEUS_MPI_INCLUDE_DIRS,
extra_compile_args=PROTEUS_OPT+PROTEUS_MPI_LIB_DIRS+['-std=c++20'],#,'-fopenmp'],#,'-DXTENSOR_USE_OPENMP'],
library_dirs=PROTEUS_MPI_LIB_DIRS+[PROTEUS_LAPACK_LIB_DIR,
PROTEUS_BLAS_LIB_DIR],
libraries=PROTEUS_MPI_LIBS+['m',
PROTEUS_LAPACK_LIB,
PROTEUS_BLAS_LIB],
extra_link_args=PROTEUS_SCOREC_EXTRA_LINK_ARGS+PROTEUS_EXTRA_LINK_ARGS,#+['-fopenmp'],
language='c++'),
Extension(
'mprans.cRDLS',
sources=['proteus/mprans/RDLS.cpp'],
depends=["proteus/mprans/RDLS.h", "proteus/mprans/ArgumentsDict.h", "proteus/pyarray.h"] + ["proteus/ModelFactory.h","proteus/CompKernel.h"] + [
"proteus/equivalent_polynomials.h",
"proteus/equivalent_polynomials_utils.h",
"proteus/equivalent_polynomials_coefficients.h",
'proteus/equivalent_polynomials_coefficients_quad.h'],
include_dirs=get_pybind_include_dirs(),
extra_compile_args=PROTEUS_OPT+['-std=c++20'],
language='c++'),
Extension(
'mprans.cVOF',
sources=['proteus/mprans/VOF.cpp'],
depends=["proteus/mprans/VOF.h", "proteus/mprans/ArgumentsDict.h", "proteus/pyarray.h", "proteus/ModelFactory.h","proteus/CompKernel.h",
"proteus/equivalent_polynomials.h",
"proteus/equivalent_polynomials_utils.h",
"proteus/equivalent_polynomials_coefficients.h",