fortran-lang / fpm

Fortran Package Manager (fpm)
https://fpm.fortran-lang.org
MIT License
877 stars 99 forks source link

Build failure with gcc14: `Error: There is no specific subroutine for the generic 'set_string' at (1)` #1059

Open barracuda156 opened 3 months ago

barracuda156 commented 3 months ago

Description

--->  Building fpm
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fpm/fpm/work/fpm-0.10.1" && FPM_CFLAGS="-Os -arch arm64" FPM_LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -arch arm64" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fpm/fpm/work/fpm-0.10.1/install.sh 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 27309    0 27309    0     0  24654      0 --:--:--  0:00:01 --:--:-- 24669
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1513k  100 1513k    0     0   586k      0  0:00:02  0:00:02 --:--:-- 1854k
fpm.F90:28554:101:

28554 |         call set_string(table, "descriptor", descriptor_name(self%descriptor), error, 'git_target_t')
      |                                                                                                     1
Error: There is no specific subroutine for the generic 'set_string' at (1)
fpm.F90:30325:93:

30325 |        call set_string(table,"os-type",os_type_name(self%os_type), error, 'profile_config_t')
      |                                                                                             1
Error: There is no specific subroutine for the generic 'set_string' at (1)
fpm.F90:31376:9:

31376 |     use fpm_git, only: git_target_t, git_target_tag, git_target_branch, &
      |         1
Fatal Error: Cannot open module file 'fpm_git.mod' for reading at (1): No such file or directory
compilation terminated.
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fpm/fpm/work/fpm-0.10.1" && FPM_CFLAGS="-Os -arch arm64" FPM_LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -arch arm64" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fpm/fpm/work/fpm-0.10.1/install.sh 
Exit code: 1

Expected Behaviour

It should build with the current release of GCC.

Version of fpm

0.10.1

Platform and Architecture

macOS 14.5 / arm64

Additional Information

Also failed on buildbots: https://github.com/macports/macports-ports/actions/runs/9792802490/job/27039380730?pr=24796

barracuda156 commented 3 months ago

No error with gcc 13.3.0:

--->  Building fpm
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fpm/fpm/work/fpm-0.10.1" && FPM_CFLAGS="-Os -arch arm64" FPM_LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -arch arm64" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fpm/fpm/work/fpm-0.10.1/install.sh 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 27309    0 27309    0     0  25878      0 --:--:--  0:00:01 --:--:-- 25885
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1513k  100 1513k    0     0   415k      0  0:00:03  0:00:03 --:--:--  762k
 + mkdir -p build/dependencies
Initialized empty Git repository in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fpm/fpm/work/fpm-0.10.1/build/dependencies/toml-f/.git/
From https://github.com/toml-f/toml-f
 * branch            d7b892b1d074b7cfc5d75c3e0eb36ebc1f7958c1 -> FETCH_HEAD
Initialized empty Git repository in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fpm/fpm/work/fpm-0.10.1/build/dependencies/M_CLI2/.git/
From https://github.com/urbanjost/M_CLI2
 * branch            7264878cdb1baff7323cc48596d829ccfe7751b8 -> FETCH_HEAD
Initialized empty Git repository in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fpm/fpm/work/fpm-0.10.1/build/dependencies/fortran-regex/.git/
From https://github.com/perazz/fortran-regex
 * tag               1.1.2      -> FETCH_HEAD
Initialized empty Git repository in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fpm/fpm/work/fpm-0.10.1/build/dependencies/jonquil/.git/
From https://github.com/toml-f/jonquil
 * branch            4fbd4cf34d577c0fd25e32667ee9e41bf231ece8 -> FETCH_HEAD
Initialized empty Git repository in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fpm/fpm/work/fpm-0.10.1/build/dependencies/fortran-shlex/.git/
From https://github.com/perazz/fortran-shlex
 * tag               1.0.1      -> FETCH_HEAD
[  0%]         filesystem_utilities.c
[  1%]         filesystem_utilities.c  done.
[  1%]        fpm_backend_console.f90
[  2%]        fpm_backend_console.f90  done.
[  2%]                       fpm_os.c
[  3%]                       fpm_os.c  done.
[  3%]                fpm_strings.f90
[  4%]                fpm_strings.f90  done.
[  4%]                       isatty.c
[  5%]                       isatty.c  done.
[  5%]                     iscygpty.c
[  6%]                     iscygpty.c  done.
[  6%]                  constants.f90
[  7%]                  constants.f90  done.
[  7%]                    version.f90
[  8%]                    version.f90  done.
[  8%]                      token.f90
[  9%]                      token.f90  done.
[  9%]                     M_CLI2.F90
[ 10%]                     M_CLI2.F90  done.
[ 10%]                      regex.f90
[ 12%]                      regex.f90  done.
[ 12%]                    version.f90
[ 13%]                    version.f90  done.
[ 13%]               shlex_module.f90
[ 14%]               shlex_module.f90  done.
[ 14%]                      error.f90
[ 15%]                      error.f90  done.
[ 15%]                   datetime.f90
[ 16%]                   datetime.f90  done.
[ 16%]                      error.f90
[ 17%]                      error.f90  done.
[ 17%]                         io.f90
[ 18%]                         io.f90  done.
[ 18%]            fpm_environment.f90
[ 19%]            fpm_environment.f90  done.
[ 19%]                 versioning.f90
[ 20%]                 versioning.f90  done.
[ 20%]                      utils.f90
[ 21%]                      utils.f90  done.
[ 21%]                        abc.f90
[ 23%]                        abc.f90  done.
[ 23%]             fpm_filesystem.F90
[ 24%]             fpm_filesystem.F90  done.
[ 24%]                fpm_release.F90
[ 25%]                fpm_release.F90  done.
[ 25%]                   terminal.f90
[ 26%]                   terminal.f90  done.
[ 26%]                      value.f90
[ 27%]                      value.f90  done.
[ 27%]                      lexer.f90
[ 28%]                      lexer.f90  done.
[ 28%]                     fpm_os.F90
[ 29%]                     fpm_os.F90  done.
[ 29%]                  installer.f90
[ 30%]                  installer.f90  done.
[ 30%]                 diagnostic.f90
[ 31%]                 diagnostic.f90  done.
[ 31%]                       list.f90
[ 32%]                       list.f90  done.
[ 32%]                        map.f90
[ 34%]                        map.f90  done.
[ 34%]                       node.f90
[ 35%]                       node.f90  done.
[ 35%]                     keyval.f90
[ 36%]                     keyval.f90  done.
[ 36%]                       sort.f90
[ 37%]                       sort.f90  done.
[ 37%]           fpm_command_line.f90
[ 38%]           fpm_command_line.f90  done.
[ 38%]                    context.f90
[ 39%]                    context.f90  done.
[ 39%]                 array_list.f90
[ 40%]                 array_list.f90  done.
[ 40%]                ordered_map.f90
[ 41%]                ordered_map.f90  done.
[ 41%]                  structure.f90
[ 42%]                  structure.f90  done.
[ 42%]                      lexer.f90
[ 43%]                      lexer.f90  done.
[ 43%]                      array.f90
[ 45%]                      array.f90  done.
[ 45%]                      table.f90
[ 46%]                      table.f90  done.
[ 46%]                       type.f90
[ 47%]                       type.f90  done.
[ 47%]                        ser.f90
[ 48%]                        ser.f90  done.
[ 48%]                     keyval.f90
[ 49%]                     keyval.f90  done.
[ 49%]                      merge.f90
[ 50%]                      merge.f90  done.
[ 50%]                     parser.f90
[ 51%]                     parser.f90  done.
[ 51%]                        ser.f90
[ 52%]                        ser.f90  done.
[ 52%]                         de.f90
[ 53%]                         de.f90  done.
[ 53%]                      array.f90
[ 54%]                      array.f90  done.
[ 54%]                      table.f90
[ 56%]                      table.f90  done.
[ 56%]                       path.f90
[ 57%]                       path.f90  done.
[ 57%]                      build.f90
[ 58%]                      build.f90  done.
[ 58%]                      tomlf.f90
[ 59%]                      tomlf.f90  done.
[ 59%]                     parser.f90
[ 60%]                     parser.f90  done.
[ 60%]                    jonquil.f90
[ 61%]                    jonquil.f90  done.
[ 61%]                 downloader.f90
[ 62%]                 downloader.f90  done.
[ 62%]                       toml.f90
[ 63%]                       toml.f90  done.
[ 63%]               fpm_settings.f90
[ 64%]               fpm_settings.f90  done.
[ 64%]                        git.f90
[ 65%]                        git.f90  done.
[ 65%]                      build.f90
[ 67%]                      build.f90  done.
[ 67%]                    fortran.f90
[ 68%]                    fortran.f90  done.
[ 68%]                    install.f90
[ 69%]                    install.f90  done.
[ 69%]                    library.f90
[ 70%]                    library.f90  done.
[ 70%]                       meta.f90
[ 71%]                       meta.f90  done.
[ 71%]                 preprocess.f90
[ 72%]                 preprocess.f90  done.
[ 72%]                   profiles.f90
[ 73%]                   profiles.f90  done.
[ 73%]                 dependency.f90
[ 74%]                 dependency.f90  done.
[ 74%]                 executable.f90
[ 75%]                 executable.f90  done.
[ 75%]                    example.f90
[ 76%]                    example.f90  done.
[ 76%]                       test.f90
[ 78%]                       test.f90  done.
[ 78%]                    package.f90
[ 79%]                    package.f90  done.
[ 79%]                   manifest.f90
[ 80%]                   manifest.f90  done.
[ 80%]                        new.f90
[ 81%]                        new.f90  done.
[ 81%]               fpm_compiler.F90
[ 82%]               fpm_compiler.F90  done.
[ 82%]                 dependency.f90
[ 83%]                 dependency.f90  done.
[ 83%]                  fpm_model.f90
[ 84%]                  fpm_model.f90  done.
[ 84%]                     update.f90
[ 85%]                     update.f90  done.
[ 85%]                   fpm_meta.f90
[ 86%]                   fpm_meta.f90  done.
[ 86%]         fpm_source_parsing.f90
[ 87%]         fpm_source_parsing.f90  done.
[ 87%]                fpm_sources.f90
[ 89%]                fpm_sources.f90  done.
[ 89%]                fpm_targets.f90
[ 90%]                fpm_targets.f90  done.
[ 90%]         fpm_backend_output.f90
[ 91%]         fpm_backend_output.f90  done.
[ 91%]                fpm_backend.F90
[ 92%]                fpm_backend.F90  done.
[ 92%]                        fpm.f90
[ 93%]                        fpm.f90  done.
[ 93%]                     export.f90
[ 94%]                     export.f90  done.
[ 94%]                    install.f90
[ 95%]                    install.f90  done.
[ 95%]                    publish.f90
[ 96%]                    publish.f90  done.
[ 96%]                       libfpm.a
[ 97%]                       libfpm.a  done.
[ 97%]                       main.f90
[ 98%]                       main.f90  done.
[ 98%]                            fpm
[100%]                            fpm  done.
[100%] Project compiled successfully.
perazz commented 3 months ago

@barracuda156 This is a regression issue introduced by gfortran-14. It was fixed in #1013 already. It will appear as soon as a new release is deployed.

barracuda156 commented 3 months ago

@perazz Thank you! I will try the fix.

If it is a regression in gfortran itself, is GCC upstream made aware of it?

barracuda156 commented 3 months ago

Well, I will need to wait until the release, since FPM fetches its bootstrap version during the build, and it is non-trivial to implement patching it.

rouson commented 2 months ago

On a different but related note, at some point it would be great to remove anything gfortran-specific in fpm so that building fpm with other compilers becomes an option too. I have tried building with the Cray, Intel (ifx), and NAG compilers and errors prevented building with all three. This is usually a sign that there are non-standard extensions or possibly even errors in the code.

perazz commented 2 months ago

It's a great idea @rouson. If you or anyone in your team has patches to contribute, it would be great.

I had only tried to add the Intel compiler in the fpm CI and last year I spent quite a lot of time on it: see #894 #898 #901 #964. Then, the switch to ifx exposed compiler bugs that are still currently not fixed, see #994, so it was removed from the CI.