feat(initial): added portable mfem build system

This commit is contained in:
2026-09-05 07:11:05 -04:00
commit 6a54f2625e
49 changed files with 4344 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
from __future__ import annotations
import os
from pathlib import Path
def _native_search_paths() -> list[Path]:
package = Path(__file__).resolve().parent
return [package / "lib", package / "lib64", package / "bin"]
_dll_directory_handles = []
if os.name == "nt" and hasattr(os, "add_dll_directory"):
for _directory in _native_search_paths():
if _directory.is_dir():
_dll_directory_handles.append(os.add_dll_directory(str(_directory)))
from ._core import capabilities, mfem_version, serial_poisson_dofs
__all__ = [
"capabilities",
"get_cmake_prefix",
"get_include",
"get_lib",
"mfem_version",
"serial_poisson_dofs",
]
def _package_dir() -> Path:
return Path(__file__).resolve().parent
def get_include() -> str:
"""Return the wheel-local include directory containing MFEM headers."""
return str(_package_dir() / "include")
def get_lib() -> str:
"""Return the wheel-local directory containing MFEM runtime libraries."""
return str(_package_dir() / "lib")
def get_cmake_prefix() -> str:
"""Return the prefix that can be appended to CMAKE_PREFIX_PATH."""
return str(_package_dir())