project( 'serif', ['c', 'cpp'], version: '0.1.0', meson_version: '>=1.9.1', default_options: [ 'c_std=c11', 'cpp_std=c++26', 'warning_level=2', ], ) # these silence some warnings from mfem. Really these should be specific to mfem. add_global_arguments('-Wno-unused', language: 'c') add_global_arguments('-Wno-unused', language: 'cpp') add_global_arguments('-Wno-unused-parameter', language: 'c') add_global_arguments('-Wno-unused-parameter', language: 'cpp') python_mod = import('python') fs = import('fs') cc = meson.get_compiler('c') cpp = meson.get_compiler('cpp') platform_c_args = [] platform_cpp_args = [] platform_link_args = [] if host_machine.system() == 'darwin' and get_option('macos_deployment_target') != '' macos_minimum_flag = '-mmacosx-version-min=' + get_option('macos_deployment_target') platform_c_args += [macos_minimum_flag] platform_cpp_args += [macos_minimum_flag] platform_link_args += [macos_minimum_flag] add_project_arguments(macos_minimum_flag, language: ['c', 'cpp']) add_project_link_arguments(macos_minimum_flag, language: ['c', 'cpp']) endif subdir('build-check') subdir('build-config') # Stellar mesh construction uses the bundled STROID with the same MFEM and C++ ABI. stroid_project = subproject('stroid', default_options: [ 'build_tests=false', 'build_tools=false', 'build_python=false', 'pkg_config=false', ]) stroid_dep = stroid_project.get_variable('stroid_dep') subdir('src') # Register the original library first: RayFEM's archive reader depends on SERiF. # Only downstream consumers receive RayFEM, keeping the library graph acyclic. meson.override_dependency('serif', declare_dependency( dependencies: serif_dep, variables: {'libdir': fs.parent(serif_lib.full_path())}, )) rayfem_project = subproject('rayfem', default_options: [ 'mfem_provider=external', 'serif=enabled', 'build_viewer=enabled', 'build_examples=disabled', 'build_tests=disabled', ]) rayfem_dep = rayfem_project.get_variable('rayfem_dep') serif_dep = declare_dependency(dependencies: [serif_dep, rayfem_dep]) subdir('tests') summary( { 'MFEM provider': mfem_provider, 'build type': get_option('buildtype'), 'optimization': get_option('optimization'), 'debug symbols': get_option('debug'), 'bundled MFEM debug checks': mfem_provider == 'system' ? 'external' : mfem_debug_checks.to_string(), 'dependency profile': get_option('feature_profile'), 'allow preinstalled': get_option('allow_preinstalled'), 'parallel MPI/Hypre': mfem_has_mpi, 'METIS': mfem_has_metis, 'CUDA': mfem_has_cuda, 'HIP': mfem_has_hip, 'OpenMP': mfem_has_openmp, 'GSLIB': mfem_has_gslib, 'zlib': mfem_has_zlib, 'SUNDIALS': mfem_has_sundials, 'libCEED': mfem_features.get('ceed'), 'FMS': mfem_features.get('fms'), 'Algoim': mfem_features.get('algoim'), 'SparseDirect backend': serif_sparse_direct_backend, 'Python bindings': get_option('build_python'), 'tests': get_option('build_tests'), }, section: 'serif ' + meson.project_version(), bool_yn: true, )