Compare commits

..

2 Commits

Author SHA1 Message Date
dac09ae24c build(fortran): added check for fortran
fortran tests only build when fortran build option is enabled
2025-11-30 10:19:56 -05:00
4fe242a5ef build(meson): added checks for header compatibility 2025-11-30 10:16:44 -05:00
2 changed files with 20 additions and 9 deletions

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('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')
add_project_arguments('-Wno-bitwise-instead-of-logical', language: 'cpp')
endif
if meson.get_compiler('cpp').get_id() == 'gcc'
# We disable these because of boost notes about abi changes from C++10 -> C++17 make the build too noisey
if cppc.get_id() == 'gcc'
message('disabling psabi warnings for gcc')
add_project_arguments('-Wno-psabi', language: 'cpp')
if (meson.get_compiler('cpp').version().version_compare('<14.0'))
error('g++ version must be at least 14.0, found ' + meson.get_compiler('cpp').version())
if (cppc.version().version_compare('<14.0'))
error('g++ version must be at least 14.0, found ' + cppc.version())
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')
endif
endif
if (meson.get_compiler('fortran').version().version_compare('<14.0'))
error('gfortran version must be at least 14.0, found ' + meson.get_compiler('fortran').version())
if (fc.version().version_compare('<14.0'))
error('gfortran version must be at least 14.0, found ' + fc.version())
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

View File

@@ -1,2 +1,5 @@
subdir('C')
if get_option('build-fortran')
subdir('fortran')
endif