feat(quadrature): quadrature system brought over
Ported and dramatically cleaned up the quadrature system. This includes centralizing all field definitions
This commit is contained in:
@@ -325,49 +325,107 @@ if mfem_has_cuda
|
||||
message(cuda_check_result.stdout().strip())
|
||||
endif
|
||||
system_mfem = disabler()
|
||||
system_mfem_dependencies = []
|
||||
mfem_provider = 'source bundle'
|
||||
|
||||
if effective_allow_preinstalled
|
||||
system_candidate = dependency('mfem', version: '>=4.10', required: false, allow_fallback: false)
|
||||
if system_candidate.found()
|
||||
system_compatible = true
|
||||
system_candidate = dependency(
|
||||
'mfem',
|
||||
version: '>=4.10',
|
||||
required: false,
|
||||
allow_fallback: false,
|
||||
)
|
||||
|
||||
if system_candidate.found()
|
||||
system_compatible = true
|
||||
system_candidate_dependencies = [system_candidate]
|
||||
|
||||
if mfem_has_mpi
|
||||
system_mpi = dependency(
|
||||
'mpi',
|
||||
language: 'cpp',
|
||||
required: false,
|
||||
)
|
||||
|
||||
if system_mpi.found()
|
||||
system_candidate_dependencies += [system_mpi]
|
||||
else
|
||||
system_compatible = false
|
||||
endif
|
||||
endif
|
||||
|
||||
foreach i : range(mfem_feature_names.length())
|
||||
if mfem_feature_states[i]
|
||||
feature_macro = mfem_cmake_names[i]
|
||||
|
||||
macro_ok = cpp.compiles(
|
||||
'#include <mfem/config/config.hpp>\n#ifndef ' + feature_macro + '\n#error missing\n#endif\nint main(){return 0;}',
|
||||
dependencies: system_candidate,
|
||||
'#include <mfem/config/config.hpp>\n' +
|
||||
'#ifndef ' + feature_macro + '\n' +
|
||||
'#error missing\n' +
|
||||
'#endif\n' +
|
||||
'int main(){return 0;}',
|
||||
dependencies: system_candidate_dependencies,
|
||||
name: 'system MFEM provides ' + feature_macro,
|
||||
)
|
||||
|
||||
system_compatible = system_compatible and macro_ok
|
||||
endif
|
||||
endforeach
|
||||
precision_macro = get_option('mfem_precision') == 'single' ? 'MFEM_USE_SINGLE' : 'MFEM_USE_DOUBLE'
|
||||
|
||||
precision_macro = get_option('mfem_precision') == 'single' \
|
||||
? 'MFEM_USE_SINGLE' \
|
||||
: 'MFEM_USE_DOUBLE'
|
||||
|
||||
system_compatible = system_compatible and cpp.compiles(
|
||||
'#include <mfem/config/config.hpp>\n#ifndef ' + precision_macro + '\n#error precision mismatch\n#endif\nint main(){return 0;}',
|
||||
dependencies: system_candidate,
|
||||
'#include <mfem/config/config.hpp>\n' +
|
||||
'#ifndef ' + precision_macro + '\n' +
|
||||
'#error precision mismatch\n' +
|
||||
'#endif\n' +
|
||||
'int main(){return 0;}',
|
||||
dependencies: system_candidate_dependencies,
|
||||
name: 'system MFEM uses requested precision',
|
||||
)
|
||||
|
||||
foreach i : range(mfem_feature_names.length())
|
||||
feature_opt = get_option('mfem_' + mfem_feature_names[i])
|
||||
feature_macro = mfem_cmake_names[i]
|
||||
|
||||
if feature_opt.disabled()
|
||||
macro_absent = cpp.compiles(
|
||||
'#include <mfem/config/config.hpp>\n#ifdef ' + feature_macro + '\n#error explicitly disabled\n#endif\nint main(){return 0;}',
|
||||
dependencies: system_candidate,
|
||||
'#include <mfem/config/config.hpp>\n' +
|
||||
'#ifdef ' + feature_macro + '\n' +
|
||||
'#error explicitly disabled\n' +
|
||||
'#endif\n' +
|
||||
'int main(){return 0;}',
|
||||
dependencies: system_candidate_dependencies,
|
||||
name: 'system MFEM omits disabled ' + feature_macro,
|
||||
)
|
||||
|
||||
system_compatible = system_compatible and macro_absent
|
||||
endif
|
||||
endforeach
|
||||
|
||||
if system_compatible
|
||||
system_compatible = cpp.compiles(
|
||||
'#include <mfem.hpp>\n' +
|
||||
'int main(){return 0;}',
|
||||
dependencies: system_candidate_dependencies,
|
||||
name: 'system MFEM public headers are consumable',
|
||||
)
|
||||
endif
|
||||
|
||||
if system_compatible
|
||||
system_mfem = system_candidate
|
||||
system_mfem_dependencies = system_candidate_dependencies
|
||||
mfem_provider = 'system'
|
||||
else
|
||||
message('The system MFEM does not satisfy the selected feature set; using the pinned source bundle.')
|
||||
message(
|
||||
'The system MFEM does not satisfy the selected feature set; ' +
|
||||
'using the pinned source bundle.'
|
||||
)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
uses_unmodelled_system_tpl = false
|
||||
foreach feature_name : mfem_feature_names
|
||||
if (
|
||||
@@ -399,7 +457,10 @@ mfem_build_target = []
|
||||
mpi_launcher_from_dependency = false
|
||||
|
||||
if system_mfem.found()
|
||||
mfem_dep = system_mfem
|
||||
mfem_dep = declare_dependency(
|
||||
dependencies: system_mfem_dependencies,
|
||||
version: system_mfem.version(),
|
||||
)
|
||||
else
|
||||
mfem_source = subproject('mfem').get_variable('mfem_source_dir')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user