Files
MeanField_SERiF/build-python/meson.build
Emily Boudreaux d1f59d6d70 feat(mean_field): added dimensions, discritization, and start of eos
The full rewrite of mean_field into something maintainable is progressing. dimensions is mostly done, discritization (domain, blocks, and fields) is done, and eos is progressing quickly
2026-09-15 10:42:00 -04:00

43 lines
1.3 KiB
Meson

python_extension = []
python_extension_dir = ''
if get_option('build_python')
error('Python bindings are not currently supported')
if is_wasm
error('The native CPython extension cannot be built for Emscripten. Disable build_python for the WASM profile.')
endif
nanobind_dep = dependency('nanobind', version: '>=2.15.0', fallback: 'nanobind')
extension_rpath_args = []
if host_machine.system() == 'darwin'
extension_rpath_args = [
'-Wl,-rpath,@loader_path/lib',
'-Wl,-rpath,@loader_path/lib64',
]
elif not is_windows
extension_rpath_args = [
'-Wl,-rpath,$ORIGIN/lib',
'-Wl,-rpath,$ORIGIN/lib64',
]
endif
python_extension = python_build.extension_module(
'_core',
'../src/python/bindings.cpp',
dependencies: [nanobind_dep, mfem_dep, template_include_dep],
override_options: ['cpp_std=' + mfem_consumer_cpp_std],
link_args: extension_rpath_args,
build_rpath: '',
install_rpath: '',
install: true,
install_tag: 'python-runtime',
subdir: 'meson_mfem_template',
)
python_extension_dir = meson.current_build_dir()
python_build.install_sources(
'../python/meson_mfem_template/__init__.py',
'../python/meson_mfem_template/_core.pyi',
'../python/meson_mfem_template/py.typed',
subdir: 'meson_mfem_template',
install_tag: 'python-runtime',
)
endif