Skip to content

Commit d1ee74a

Browse files
authored
GCC 15 Workaround (#20)
1 parent 10a3437 commit d1ee74a

4 files changed

Lines changed: 35 additions & 1 deletion

File tree

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ a Fortran compiler supporting Fortran 2008 and one of the supported build system
1515
a build-system backend, *i.e.* [ninja](https://ninja-build.org) version 1.10 or newer
1616
- [fpm](https://github.com/fortran-lang/fpm) version 0.2.0 or newer
1717

18-
Supported for this project are GCC and Intel compilers.
18+
Currently, this project supports GCC and Intel compilers.
19+
20+
<details>
21+
<summary>Problematic Versions</summary>
22+
23+
GCC versions 15.0.x - 15.1.x contain a [compiler bug](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119928) leading to "Interface mismatch" errors during compilation.
24+
25+
</details>
1926

2027

2128
### Building with meson

config/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ set(
3434
)
3535
set(module-dir "${module-dir}" PARENT_SCOPE)
3636

37+
38+
# Compiler-specific configurations
39+
40+
# gfortran "Interface mismatch" bug (119928)
41+
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
42+
if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL "15.0"
43+
AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS "15.2")
44+
message(FATAL_ERROR
45+
"Unsupported GNU Fortran version ${CMAKE_Fortran_COMPILER_VERSION}. "
46+
"This release has a known issue (fixed in 15.2). "
47+
"Please use GCC >= 15.2 or < 15.0, or a different Fortran compiler.")
48+
endif()
49+
endif()
50+
51+
3752
# Set build type as CMake does not provide defaults
3853
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
3954
set(

config/meson.build

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ if fc_id == 'gcc'
2323
'-fbacktrace',
2424
language: 'fortran',
2525
)
26+
27+
# gfortran "Interface mismatch" bug (119928)
28+
if fc.version().version_compare('>=15.0') and fc.version().version_compare('<15.2')
29+
error('Unsupported GNU Fortran version ' + fc.version() +
30+
'. This release has a known issue (fixed in 15.2). ' +
31+
'Please use GCC >= 15.2 or < 15.0.')
32+
endif
33+
2634
elif fc_id == 'intel'
2735
add_project_arguments(
2836
'-fpp',

subprojects/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
/*/
2+
.wraplock
3+
jonquil.wrap
4+
test-drive.wrap
5+
toml-f.wrap

0 commit comments

Comments
 (0)