build(meson): added checks for header compatibility

This commit is contained in:
2025-11-30 10:16:44 -05:00
parent a0dcfe4332
commit 4fe242a5ef

View File

@@ -31,20 +31,20 @@ message('Found FORTRAN compiler: ' + meson.get_compiler('fortran').get_id())
message('C++ standard set to: ' + get_option('cpp_std')) message('C++ standard set to: ' + get_option('cpp_std'))
message('Fortran standard set to: ' + get_option('fortran_std')) message('Fortran standard set to: ' + get_option('fortran_std'))
cppc = meson.get_compiler('cpp')
if meson.get_compiler('cpp').get_id() == 'clang'
# We disable these because of CppAD if cppc.get_id() == 'clang'
message('disabling bitwise-instead-of-logical warnings for clang') message('disabling bitwise-instead-of-logical warnings for clang')
add_project_arguments('-Wno-bitwise-instead-of-logical', language: 'cpp') add_project_arguments('-Wno-bitwise-instead-of-logical', language: 'cpp')
endif endif
if meson.get_compiler('cpp').get_id() == 'gcc' if cppc.get_id() == 'gcc'
# We disable these because of boost notes about abi changes from C++10 -> C++17 make the build too noisey
message('disabling psabi warnings for gcc') message('disabling psabi warnings for gcc')
add_project_arguments('-Wno-psabi', language: 'cpp') add_project_arguments('-Wno-psabi', language: 'cpp')
if (meson.get_compiler('cpp').version().version_compare('<14.0')) if (cppc.version().version_compare('<14.0'))
error('g++ version must be at least 14.0, found ' + meson.get_compiler('cpp').version()) error('g++ version must be at least 14.0, found ' + cppc.version())
endif endif
endif endif
@@ -58,12 +58,20 @@ if (build_fortran)
error('The only supported fortran compiler for GridFire is gfortran (version >= 14.0), found ' + fc + '. GridFire has not been tested with any other compilers. You can disable this check with the -Dunsafe-fortran=true flag to try other compilers') error('The only supported fortran compiler for GridFire is gfortran (version >= 14.0), found ' + fc + '. GridFire has not been tested with any other compilers. You can disable this check with the -Dunsafe-fortran=true flag to try other compilers')
endif endif
endif endif
if (meson.get_compiler('fortran').version().version_compare('<14.0')) if (fc.version().version_compare('<14.0'))
error('gfortran version must be at least 14.0, found ' + meson.get_compiler('fortran').version()) error('gfortran version must be at least 14.0, found ' + fc.version())
endif endif
endif endif
if not cppc.has_header('print')
error('C++ standard library header <print> not found. Please ensure your compiler and standard library supports C++23. We have already validated your compiler version so this is likely an issue with your standard library installation.')
endif
if not cppc.has_header('format')
error('C++ standard library header <format> not found. Please ensure your compiler and standard library supports C++23. We have already validated your compiler version so this is likely an issue with your standard library installation.')
endif
# For Eigen # For Eigen