feat(linux): portable build works on linux + benchmarks

This commit is contained in:
2026-09-05 11:01:34 -04:00
parent 7282b2e134
commit 323555b722
10 changed files with 1482 additions and 19 deletions

View File

@@ -31,6 +31,16 @@ if get_option('build_tests') and get_option('build_examples')
timeout: 120,
)
if mfem_has_cuda
test(
'serial-poisson-cuda',
serial_example,
args: ['cuda'],
env: runtime_environment,
timeout: 120,
)
endif
if mfem_has_mpi
if mpi_launcher_from_dependency and not wheel_carries_native_bundle
mpi_launcher_program = find_program(
@@ -57,9 +67,76 @@ if get_option('build_tests') and get_option('build_examples')
env: runtime_environment,
timeout: 180,
)
if mfem_has_cuda
test(
'parallel-hypre-boomeramg-cuda',
python_build,
args: [
files('../tools/run_mpi_test.py'),
'--launcher', mpi_launcher,
'--processes', '2',
parallel_example,
'cuda',
],
env: runtime_environment,
timeout: 180,
)
endif
endif
endif
if get_option('build_tests') and get_option('build_benchmarks')
benchmark_smoke_environment = environment()
benchmark_smoke_environment.set('OMP_NUM_THREADS', '1')
benchmark_smoke_environment.set('OMP_DYNAMIC', 'FALSE')
if (
mfem_runtime_prefix != '' and dependency_prefix != '' and
not wheel_carries_native_bundle
)
benchmark_smoke_environment.prepend('PATH', dependency_prefix / 'bin')
if host_machine.system() == 'darwin'
benchmark_smoke_environment.prepend('DYLD_LIBRARY_PATH', dependency_prefix / 'lib64')
benchmark_smoke_environment.prepend('DYLD_LIBRARY_PATH', dependency_prefix / 'lib')
elif host_machine.system() != 'windows' and not is_wasm
benchmark_smoke_environment.prepend('LD_LIBRARY_PATH', dependency_prefix / 'lib64')
benchmark_smoke_environment.prepend('LD_LIBRARY_PATH', dependency_prefix / 'lib')
endif
endif
if mfem_runtime_prefix != ''
benchmark_smoke_environment.prepend('PATH', mfem_runtime_prefix / 'bin')
if host_machine.system() == 'darwin'
benchmark_smoke_environment.prepend('DYLD_LIBRARY_PATH', mfem_runtime_prefix / 'lib64')
benchmark_smoke_environment.prepend('DYLD_LIBRARY_PATH', mfem_runtime_prefix / 'lib')
elif host_machine.system() != 'windows'
benchmark_smoke_environment.prepend('LD_LIBRARY_PATH', mfem_runtime_prefix / 'lib64')
benchmark_smoke_environment.prepend('LD_LIBRARY_PATH', mfem_runtime_prefix / 'lib')
endif
endif
test(
'backend-benchmark-smoke',
python_build,
args: [
files('../tools/run_mpi_test.py'),
'--launcher', benchmark_mpi_launcher,
'--processes', '1',
'--',
benchmark_executable,
'--device', 'cpu',
'--mesh-n', '4',
'--order', '2',
'--applications', '2',
'--minimum-apply-seconds', '0',
'--warmup-applications', '1',
'--relative-tolerance', '1e-6',
'--max-iterations', '200',
'--solve',
],
depends: benchmark_executable,
env: benchmark_smoke_environment,
timeout: 180,
)
endif
if get_option('build_tests') and get_option('build_python')
python_test_environment = environment()
python_test_environment.prepend('PYTHONPATH', python_extension_dir)