From fc0703563c725e0304d46bf9b8429cc1c35897a8 Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Sat, 14 Jun 2025 12:11:36 +0200 Subject: [PATCH 1/6] Fix #1149 segfault on fpm install --- src/fpm/cmd/install.f90 | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/fpm/cmd/install.f90 b/src/fpm/cmd/install.f90 index 0fba266b0e..867959526c 100644 --- a/src/fpm/cmd/install.f90 +++ b/src/fpm/cmd/install.f90 @@ -101,30 +101,32 @@ subroutine install_info(unit, verbose, targets, ntargets) integer, intent(out) :: ntargets integer :: ii - type(string_t), allocatable :: install_target(:), temp(:) + type(string_t), allocatable :: install_target(:), apps(:), tests(:) type(build_target_ptr), allocatable :: libs(:) - allocate(install_target(0)) - call filter_library_targets(targets, libs) - install_target = [install_target, (string_t(libs(ii)%ptr%output_file),ii=1,size(libs))] - - call filter_executable_targets(targets, FPM_SCOPE_APP, temp) - install_target = [install_target, temp] - - call filter_executable_targets(targets, FPM_SCOPE_TEST, temp) - install_target = [install_target, temp] + call filter_executable_targets(targets, FPM_SCOPE_APP, apps) + call filter_executable_targets(targets, FPM_SCOPE_TEST, tests) - ntargets = size(install_target) + ntargets = size(libs) + size(apps) + size(tests) + allocate(install_target(ntargets)) + + do ii = 1, size(libs) + install_target(ii) = string_t(libs(ii)%ptr%output_file) + end do + do ii = 1, size(apps) + install_target(size(libs) + ii) = string_t(apps(ii)%s) + end do + do ii = 1, size(tests) + install_target(size(libs) + size(apps) + ii) = string_t(tests(ii)%s) + end do if (verbose) then - write(unit, '("#", *(1x, g0))') & "total number of installable targets:", ntargets do ii = 1, ntargets write(unit, '("-", *(1x, g0))') install_target(ii)%s end do - endif end subroutine install_info From 5920f992b96fc1580fe874e4a28b82ac493287c9 Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Sat, 14 Jun 2025 12:24:04 +0200 Subject: [PATCH 2/6] Bump GCC version in CI --- .github/workflows/CI.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3a8e515a80..38a330e8d1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -23,11 +23,11 @@ jobs: matrix: os: [ubuntu-latest, macos-13, windows-latest] toolchain: - - {compiler: gcc, version: 10} - {compiler: gcc, version: 11} - {compiler: gcc, version: 12} - {compiler: gcc, version: 13} - {compiler: gcc, version: 14} + - {compiler: gcc, version: 15} - {compiler: intel, version: 2025.1} exclude: - os: macos-13 # No Intel on MacOS anymore since 2024 @@ -36,6 +36,8 @@ jobs: toolchain: {compiler: intel, version: '2025.1'} - os: windows-latest # gcc 14 not available on Windows yet toolchain: {compiler: gcc, version: 14} + - os: windows-latest # gcc 15 not available on Windows yet + toolchain: {compiler: gcc, version: 15} include: - os: ubuntu-latest os-arch: linux-x86_64 From 75325c8f94d9095f5c161669d65f05983cdacd20 Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Sat, 14 Jun 2025 12:32:51 +0200 Subject: [PATCH 3/6] Skip gcc15 for Ubuntu until available, workaround GCC 15.1 bug --- .github/workflows/CI.yml | 2 ++ src/fpm_compiler.F90 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 38a330e8d1..65a03db869 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -30,6 +30,8 @@ jobs: - {compiler: gcc, version: 15} - {compiler: intel, version: 2025.1} exclude: + - os: ubuntu-latest # gcc 15 not available on Ubuntu yet + toolchain: {compiler: gcc, version: 15} - os: macos-13 # No Intel on MacOS anymore since 2024 toolchain: {compiler: intel, version: '2025.1'} - os: windows-latest # Doesn't pass build and tests yet diff --git a/src/fpm_compiler.F90 b/src/fpm_compiler.F90 index aca930783c..7faa71f008 100644 --- a/src/fpm_compiler.F90 +++ b/src/fpm_compiler.F90 @@ -178,7 +178,7 @@ module fpm_compiler flag_gnu_opt = " -O3 -funroll-loops", & flag_gnu_debug = " -g", & flag_gnu_pic = " -fPIC", & - flag_gnu_warn = " -Wall -Wextra", & + flag_gnu_warn = " -Wall -Wextra -Wno-external-argument-mismatch", & flag_gnu_check = " -fcheck=bounds -fcheck=array-temps", & flag_gnu_limit = " -fmax-errors=1", & flag_gnu_external = " -Wimplicit-interface", & From 55407dd05c475be9d1326731a90863649472523d Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Sat, 14 Jun 2025 12:49:00 +0200 Subject: [PATCH 4/6] Remove GCC-15 again in CI until stable --- .github/workflows/CI.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 65a03db869..3a8e515a80 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -23,23 +23,19 @@ jobs: matrix: os: [ubuntu-latest, macos-13, windows-latest] toolchain: + - {compiler: gcc, version: 10} - {compiler: gcc, version: 11} - {compiler: gcc, version: 12} - {compiler: gcc, version: 13} - {compiler: gcc, version: 14} - - {compiler: gcc, version: 15} - {compiler: intel, version: 2025.1} exclude: - - os: ubuntu-latest # gcc 15 not available on Ubuntu yet - toolchain: {compiler: gcc, version: 15} - os: macos-13 # No Intel on MacOS anymore since 2024 toolchain: {compiler: intel, version: '2025.1'} - os: windows-latest # Doesn't pass build and tests yet toolchain: {compiler: intel, version: '2025.1'} - os: windows-latest # gcc 14 not available on Windows yet toolchain: {compiler: gcc, version: 14} - - os: windows-latest # gcc 15 not available on Windows yet - toolchain: {compiler: gcc, version: 15} include: - os: ubuntu-latest os-arch: linux-x86_64 From 089bb8933311733515062ca7a6f72eeb835f0874 Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Sat, 14 Jun 2025 17:39:02 +0200 Subject: [PATCH 5/6] Add -Wno-external-argument-mismatch everywhere --- src/fpm/manifest/profiles.f90 | 9 ++++++--- test/fpm_test/test_toml.f90 | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/fpm/manifest/profiles.f90 b/src/fpm/manifest/profiles.f90 index 234f8cd4bc..09046fcdda 100644 --- a/src/fpm/manifest/profiles.f90 +++ b/src/fpm/manifest/profiles.f90 @@ -783,19 +783,22 @@ function get_default_profiles(error) result(default_profiles) & new_profile('debug', & & 'caf', & & OS_ALL, & - & flags = ' -Wall -Wextra -Wimplicit-interface -fPIC -fmax-errors=1 -g -fcheck=bounds& + & flags = ' -Wall -Wextra -Wimplicit-interface -Wno-external-argument-mismatch& + & -fPIC -fmax-errors=1 -g -fcheck=bounds& & -fcheck=array-temps -fbacktrace', & & is_built_in=.true.), & & new_profile('debug', & & 'gfortran', & & OS_ALL, & - & flags = ' -Wall -Wextra -Wimplicit-interface -fPIC -fmax-errors=1 -g -fcheck=bounds& + & flags = ' -Wall -Wextra -Wimplicit-interface -Wno-external-argument-mismatch& + & -fPIC -fmax-errors=1 -g -fcheck=bounds& & -fcheck=array-temps -fbacktrace -fcoarray=single', & & is_built_in=.true.), & & new_profile('debug', & & 'f95', & & OS_ALL, & - & flags = ' -Wall -Wextra -Wimplicit-interface -fPIC -fmax-errors=1 -g -fcheck=bounds& + & flags = ' -Wall -Wextra -Wimplicit-interface -Wno-external-argument-mismatch& + & -fPIC -fmax-errors=1 -g -fcheck=bounds& & -fcheck=array-temps -Wno-maybe-uninitialized -Wno-uninitialized -fbacktrace', & & is_built_in=.true.), & & new_profile('debug', & diff --git a/test/fpm_test/test_toml.f90 b/test/fpm_test/test_toml.f90 index 8fd28dfbf3..1508c6e1d7 100644 --- a/test/fpm_test/test_toml.f90 +++ b/test/fpm_test/test_toml.f90 @@ -873,7 +873,7 @@ subroutine fpm_081_table(table) allocate(character(len=0) :: fpm) fpm = fpm//NL//'package-name = "fpm"' - fpm = fpm//NL//'fortran-flags = " -Wall -Wextra -fPIC -fmax-errors=1 -g "' + fpm = fpm//NL//'fortran-flags = " -Wall -Wextra -Wno-external-argument-mismatch -fPIC -fmax-errors=1 -g "' fpm = fpm//NL//'c-flags = ""' fpm = fpm//NL//'cxx-flags = ""' fpm = fpm//NL//'link-flags = ""' @@ -1144,7 +1144,7 @@ subroutine fpm_model_invalid(error) allocate(character(len=0) :: fpm) fpm = fpm//NL//'package-name = "fpm"' - fpm = fpm//NL//'fortran-flags = " -Wall -Wextra -fPIC -fmax-errors=1 -g "' + fpm = fpm//NL//'fortran-flags = " -Wall -Wextra -Wno-external-argument-mismatch -fPIC -fmax-errors=1 -g "' fpm = fpm//NL//'c-flags = ""' fpm = fpm//NL//'cxx-flags = ""' fpm = fpm//NL//'link-flags = ""' From 97a6b3200fe08e4bae5991e4f090fa4d6ad75f61 Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Sat, 14 Jun 2025 17:33:14 +0200 Subject: [PATCH 6/6] Add gcc-15, drop gcc-10 in CI --- .github/workflows/CI.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3a8e515a80..40f5d24d4f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -23,19 +23,23 @@ jobs: matrix: os: [ubuntu-latest, macos-13, windows-latest] toolchain: - - {compiler: gcc, version: 10} - {compiler: gcc, version: 11} - {compiler: gcc, version: 12} - {compiler: gcc, version: 13} - {compiler: gcc, version: 14} + - {compiler: gcc, version: 15} - {compiler: intel, version: 2025.1} exclude: + - os: ubuntu-latest # gcc 15 not available on Ubuntu LTS yet + toolchain: {compiler: gcc, version: 15} - os: macos-13 # No Intel on MacOS anymore since 2024 toolchain: {compiler: intel, version: '2025.1'} - os: windows-latest # Doesn't pass build and tests yet toolchain: {compiler: intel, version: '2025.1'} - os: windows-latest # gcc 14 not available on Windows yet toolchain: {compiler: gcc, version: 14} + - os: windows-latest # gcc 15 not available on Windows yet + toolchain: {compiler: gcc, version: 15} include: - os: ubuntu-latest os-arch: linux-x86_64 @@ -110,6 +114,7 @@ jobs: ${{ env.BOOTSTRAP }} run -- --help - name: Test Fortran fpm (bootstrap) + if: matrix.toolchain.compiler == 'gcc' && matrix.toolchain.version != 15 shell: bash run: | ${{ env.BOOTSTRAP }} test