-
Notifications
You must be signed in to change notification settings - Fork 45
gtk-fortran with gfortran 15 #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…new iso_c_bindings
|
Thanks Florian for reporting. I had similar problems at first but they disappeared. Can you try first to delete and recreate your |
|
Hi, yes i did that. gtk-fortran ist not compiling on arch and even when using msys2 ucrt64 (gfortran 15.1) |
|
OK. No problem with GFortran 15.1.1 under Fedora 42. I will try soon on UCRT64. I wonder if it could be related to warnings I had obtained with Intel ifx about those string functions. I have therefore also opened that issue: |
|
ja, i think this is the same issue. its strange that it is working on Fedora. maybe they use other compilerflags/defaults ? |
|
I don't know. But I have just successfully build the latest gtk3 and gtk4 branches with GFortran 15.1.0 under MSYS2/Windows 10 (UCRT64). No problem so far on my side. I will look if I have other systems in virtual machines with GFortran 15. |
|
I had posted on Monday that problem in Fedora 42: [ 23%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gtk-hl-button.f90.o
/home/osboxes/gtk-fortran/src/gtk-hl-dialog.f90:41:6:
41 | use gtk_sup
| 1
......
289 | call f_c_string(name, string)
| 2
Error: ‘f_c_string’ at (1) has a type, which is not consistent with the CALL at (2)
$ gfortran --version
GNU Fortran (GCC) 15.1.1 20250425 (Red Hat 15.1.1-1)But soon it disappeared (the same day). I don't know if I have made a |
|
yes, this is the error i always get regardless if i use ucrt64 with gfortran 15.1 or Arch linux with gfortran 15.1.1. I do (there is no build directory ;) : cmake -B build
cmake --build buildif i follow you instructions i get: Lena Ober@DESKTOP-ACF18P4 UCRT64 ~/gtk-fortran
$ mkdir build3
Lena Ober@DESKTOP-ACF18P4 UCRT64 ~/gtk-fortran
$ cd build3
Lena Ober@DESKTOP-ACF18P4 UCRT64 ~/gtk-fortran/build3
$ cmake ..
-- Building for: Ninja
-- The Fortran compiler identification is GNU 15.1.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: D:/msys64/ucrt64/bin/gfortran.exe - skipped
-- Building gtk-3-fortran 3.24.49
-- Based on GTK 3.24.49 and GLib 2.84.1
-- GNUInstallDirs: C:/Program Files (x86)/gtk-fortran lib include bin share share/man
-- System: Windows 10.0.19045 AMD64
-- Compiler: GNU 15.1.0 D:/msys64/ucrt64/bin/gfortran.exe
-- Build type is: release
-- Compilation flags: -pthread -O3 -mtune=native -march=native
-- Found PkgConfig: D:/msys64/ucrt64/bin/pkg-config.exe (found version "2.3.0")
-- Checking for module 'gtk+-3.0'
-- Found gtk+-3.0, version 3.24.49
-- Checking for module 'plplot-fortran'
-- Found plplot-fortran, version 5.15.0
-- Checking for module 'plplot'
-- Found plplot, version 5.15.0
-- Configuring done (2.2s)
-- Generating done (0.4s)
-- Build files have been written to: D:/msys64/home/Lena Ober/gtk-fortran/build3
Lena Ober@DESKTOP-ACF18P4 UCRT64 ~/gtk-fortran/build3
$ make
make: *** No targets specified and no makefile found. Stop.
Lena Ober@DESKTOP-ACF18P4 UCRT64 ~/gtk-fortran/build3 |
|
I always do: $ cd build
$ cmake -D CMAKE_BUILD_TYPE=debug ..
$ makeIs this a Ninja related problem like in this issue? #292 On my side I don't use Ninja. |
|
ok, this solves to issue above, but nonetheless, if i use the Makefiles generator its reporting the error too: Lena Ober@DESKTOP-ACF18P4 UCRT64 ~/gtk-fortran
$ rm -fr build3
Lena Ober@DESKTOP-ACF18P4 UCRT64 ~/gtk-fortran
$ cmake -B build3 -G "MinGW Makefiles"
-- The Fortran compiler identification is GNU 15.1.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: D:/msys64/ucrt64/bin/gfortran.exe - skipped
-- Building gtk-3-fortran 3.24.49
-- Based on GTK 3.24.49 and GLib 2.84.1
-- GNUInstallDirs: C:/Program Files (x86)/gtk-fortran lib include bin share share/man
-- System: Windows 10.0.19045 AMD64
-- Compiler: GNU 15.1.0 D:/msys64/ucrt64/bin/gfortran.exe
-- Build type is: release
-- Compilation flags: -pthread -O3 -mtune=native -march=native
-- Found PkgConfig: D:/msys64/ucrt64/bin/pkg-config.exe (found version "2.3.0")
-- Checking for module 'gtk+-3.0'
-- Found gtk+-3.0, version 3.24.49
-- Checking for module 'plplot-fortran'
-- Found plplot-fortran, version 5.15.0
-- Checking for module 'plplot'
-- Found plplot, version 5.15.0
-- Configuring done (2.1s)
-- Generating done (0.7s)
-- Build files have been written to: D:/msys64/home/Lena Ober/gtk-fortran/build3
Lena Ober@DESKTOP-ACF18P4 UCRT64 ~/gtk-fortran
$ cmake --build build3
[ 1%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gdk-pixbuf-auto.f90.obj
[ 2%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/api_compatibility.f90.obj
[ 3%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/atk-auto.f90.obj
[ 3%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/cairo-auto.f90.obj
[ 4%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gdk-auto.f90.obj
[ 5%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/glib-auto.f90.obj
[ 6%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gtk.f90.obj
[ 6%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gtk-sup.f90.obj
[ 7%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gdk-pixbuf-hl.f90.obj
[ 8%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gdkevents-auto.f90.obj
[ 9%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gtk-draw-hl.f90.obj
[ 10%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gtk-hl-accelerator.f90.obj
[ 11%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gtk-hl-assistant.f90.obj
[ 11%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gtk-hl-misc.f90.obj
[ 12%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gtk-hl-button.f90.obj
[ 13%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gtk-hl-container.f90.obj
[ 14%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gtk-hl-entry.f90.obj
[ 15%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gtk-hl-chooser.f90.obj
[ 16%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gtk-hl-combobox.f90.obj
[ 17%] Building Fortran object src/CMakeFiles/gtk-fortran_object.dir/gtk-hl-dialog.f90.obj
D:\msys64\home\Lena Ober\gtk-fortran\src\gtk-hl-dialog.f90:50:6:
50 | use gtk_sup
| 1
......
280 | call f_c_string(name, string)
| 2
Error: 'f_c_string' at (1) has a type, which is not consistent with the CALL at (2)
D:\msys64\home\Lena Ober\gtk-fortran\src\gtk-hl-dialog.f90:50:6:
50 | use gtk_sup
| 1
......
286 | call f_c_string(license, string)
| 2
Error: 'f_c_string' at (1) has a type, which is not consistent with the CALL at (2)
D:\msys64\home\Lena Ober\gtk-fortran\src\gtk-hl-dialog.f90:50:6:
50 | use gtk_sup
| 1
......
294 | call f_c_string(comments, string)
| 2
Error: 'f_c_string' at (1) has a type, which is not consistent with the CALL at (2)
D:\msys64\home\Lena Ober\gtk-fortran\src\gtk-hl-dialog.f90:50:6:
50 | use gtk_sup
| 1
......
299 | call f_c_string(website, string)
| 2
Error: 'f_c_string' at (1) has a type, which is not consistent with the CALL at (2)
D:\msys64\home\Lena Ober\gtk-fortran\src\gtk-hl-dialog.f90:50:6:
50 | use gtk_sup
| 1
......
304 | call f_c_string(website_label, string)
| 2
Error: 'f_c_string' at (1) has a type, which is not consistent with the CALL at (2)
D:\msys64\home\Lena Ober\gtk-fortran\src\gtk-hl-dialog.f90:50:6:
50 | use gtk_sup
| 1
......
309 | call f_c_string(translators, string)
| 2
Error: 'f_c_string' at (1) has a type, which is not consistent with the CALL at (2)
D:\msys64\home\Lena Ober\gtk-fortran\src\gtk-hl-dialog.f90:50:6:
50 | use gtk_sup
| 1
......
314 | call f_c_string(copyright, string)
| 2
Error: 'f_c_string' at (1) has a type, which is not consistent with the CALL at (2)
D:\msys64\home\Lena Ober\gtk-fortran\src\gtk-hl-dialog.f90:50:6:
50 | use gtk_sup
| 1
......
319 | call f_c_string(version, string)
| 2
Error: 'f_c_string' at (1) has a type, which is not consistent with the CALL at (2)
D:\msys64\home\Lena Ober\gtk-fortran\src\gtk-hl-dialog.f90:50:6:
50 | use gtk_sup
| 1
......
327 | call f_c_string(authors(i), string)
| 2
Error: 'f_c_string' at (1) has a type, which is not consistent with the CALL at (2)
D:\msys64\home\Lena Ober\gtk-fortran\src\gtk-hl-dialog.f90:50:6:
50 | use gtk_sup
| 1
......
340 | call f_c_string(documenters(i), string)
| 2
Error: 'f_c_string' at (1) has a type, which is not consistent with the CALL at (2)
D:\msys64\home\Lena Ober\gtk-fortran\src\gtk-hl-dialog.f90:50:6:
50 | use gtk_sup
| 1
......
353 | call f_c_string(artists(i), string)
| 2
Error: 'f_c_string' at (1) has a type, which is not consistent with the CALL at (2)
mingw32-make[2]: *** [src\CMakeFiles\gtk-fortran_object.dir\build.make:344: src/CMakeFiles/gtk-fortran_object.dir/gtk-hl-dialog.f90.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:363: src/CMakeFiles/gtk-fortran_object.dir/all] Error 2
mingw32-make: *** [Makefile:165: all] Error 2 |
|
ok, i see why there is no error when you are compiling: -- Compilation flags: -g -pthread -Wall -Wextra -pedantic -std=f2008 -Wtabs -fcheck=all -fbacktrace -Wno-unused-dummy-argument
this is similar to the workaround i suggested in the first post |
|
I will also put the |
|
i don't know, if i would fix the fortran standard. If you want to, you should do it for the debug and for the release build mode too for both Compiler. |
|
Interesting, @florianober . |
Hi @vmagnin,
i just realised that gtk-fortran isn't compiling with the new gfortran 15, because gfortran is using new iso_c_binding as part of Fortran 2023. Included is a function (f_c_string) which converts fortran strings to c strings. This function is in conflict with the interface defined in the
gtk-sup.f90.As far as i can see, there is only one module (gtk-hl-dialog.f90) using this subroutine. Thus, i switched to the second interface defined in
gtk-sup.f90as well (convert_f_string) and removed the f_c_string interface.If you don't like this, you could also add
-std=f2018as compiler flag for the moment.Kind regards :)
Florian