vmagnin / gtk-fortran

A GTK / Fortran binding, and its documentation in the Wiki tab.
GNU General Public License v3.0
255 stars 43 forks source link

PLplot >= 5.11 problem #116

Closed ax006ho closed 5 years ago

ax006ho commented 7 years ago

Fedora 27 provides at the moment plplot 5.12.x, which uses a new library scheme: there is no libplplotf95c.so anymore. Additionally the Fortran sees duplicated declarations of the same type provided by use chains as an error.

I can change the according cmake and example files for my personal use, but I would like to have the source directly usable without theses changes (I use the package in a Fortran course and telling every participant whit to change is very cumbersome). Are there plans to adapt gtk-fortran accordingly?

v5.13 changes the Fortran naming convention (https://sourceforge.net/projects/plplot/files/plplot/5.13.0%20Source/) and then there are more changes to come. Any plans about that?

vmagnin commented 7 years ago

Dear ax006ho,

I am happy to see that gtk-fortran is used in teaching. I will try to help you.

Personally, I try to follow the development cycle of Ubuntu. Its 17.10 version still comes with Plplot 5.10.0. A look at https://packages.qa.debian.org/p/plplot.html shows that Debian testing is still with plplot 5.10.0 and that Debian unstable is using plplot 5.13.0 since 2017-09-22. So, we can hope that 5.13.0 will be in Ubuntu 18.04 (or 18.10 ?).

Concerning your problem with 5.12.0, what do you think of this solution: tell me what branch you use (master or gtk3) and I will create a temporary branch for plplot 5.12. You pull that branch, you modify the cmake and example files to make it work. And you make a pull request with github or you post your modifications in this forum, so I can update the new branch. Your students can then use that branch.

And when Plplot will be updated in Ubuntu, I will merge that branch with the main one.

And we will see for the 5.13 version when it lands in the distributions. I don't know if jtappin, the author of the plplot part in gtk-fortran, has time to work on it. But your contribution is welcome.

Vincent

jtappin commented 7 years ago

I certainly won't have time for a week or two.

bonanza commented 6 years ago

I think, we should give the suggested solution a try. But maybe it makes most sense to work with GTK+3 and PLplot 5.13, which is the version currently used by MinGW64 too. With MinGW64 there is another problem with CMake, which was not able to find PLplot with the current CMakeLists.txt. I modified this file to use PkgConfig in this case. However, the New-PLplot tests are still failing:

-- Checking for module 'plplot-fortran'
--   Found plplot-fortran, version 5.13.0
-- Performing Test NEW_PLPLOT
-- Performing Test NEW_PLPLOT - Failed
-- Performing Test NEW_PLPLOT_DEFS
-- Performing Test NEW_PLPLOT_DEFS - Failed
-- Old PLPLOT

Of course, the same problem with duplicated declarations is present with MinGW64/PLplot5.13:

C:/msys32b/home/bonanza/gtk-fortran-gtk3/plplot/hl_plplot4e_old.f90:60:15:

     type(c_ptr), intent(in), dimension(2) :: area
               1
Error: Type name 'c_ptr' at (1) is ambiguous
C:/msys32b/home/bonanza/gtk-fortran-gtk3/plplot/hl_plplot4e_old.f90:62:15:

     type(c_ptr), dimension(2) :: cc, cs
               1
Error: Type name 'c_ptr' at (1) is ambiguous
C:/msys32b/home/bonanza/gtk-fortran-gtk3/plplot/hl_plplot4e_old.f90:105:29:

     call pl_cmd(PLESC_DEVINIT, cc(1))
                             1
Error: Name 'plesc_devinit' at (1) is an ambiguous reference to 'plesc_devinit' from module 'plplot'
C:/msys32b/home/bonanza/gtk-fortran-gtk3/plplot/hl_plplot4e_old.f90:111:29:

     call pl_cmd(PLESC_DEVINIT, cc(2))
                             1
Error: Name 'plesc_devinit' at (1) is an ambiguous reference to 'plesc_devinit' from module 'plplot'
vmagnin commented 6 years ago

Ubuntu 18.04 will come with Plplot 5.13 as can be seen on https://launchpad.net/ubuntu/+source/plplot/5.13.0+dfsg-6ubuntu2

vmagnin commented 6 years ago

After upgrading to Kubuntu 18.04 (with PLplot 5.13), the problems appear:

[ 92%] Building Fortran object plplot/CMakeFiles/hl_plplot4e.dir/hl_plplot4e.f90.o
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:60:15:

     type(c_ptr), intent(in), dimension(2) :: area
               1
Error: Type name ‘c_ptr’ at (1) is ambiguous
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:62:15:

     type(c_ptr), dimension(2) :: cc, cs
               1
Error: Type name ‘c_ptr’ at (1) is ambiguous
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:58:25:

   subroutine plot_04(area)
                         1
Error: Symbol ‘area’ at (1) has no IMPLICIT type
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:225:64:

          symbol_colors, symbol_scales, symbol_numbers, symbols )
                                                                1
Error: There is no specific subroutine for the generic ‘pllegend’ at (1)
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:76:35:

     call plparseopts(PL_PARSE_FULL)
                                   1
Error: There is no specific subroutine for the generic ‘plparseopts’ at (1)
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:80:7:

        cc(i) = hl_gtk_drawing_area_cairo_new(area(i))
       1
Error: Function ‘cc’ at (1) has no IMPLICIT type
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:80:45:

        cc(i) = hl_gtk_drawing_area_cairo_new(area(i))
                                             1
Error: Function ‘area’ at (1) has no IMPLICIT type
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:81:7:

        cs(i) = cairo_get_target(cc(i))
       1
Error: Function ‘cs’ at (1) has no IMPLICIT type
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:81:32:

        cs(i) = cairo_get_target(cc(i))
                                1
Error: Function ‘cc’ at (1) has no IMPLICIT type
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:90:49:

     call plsetopt("drvopt", "set_background=1")
                                                 1
Error: There is no specific subroutine for the generic ‘plsetopt’ at (1)
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:94:65:

     write(geometry, "(I0,'x',I0)") cairo_image_surface_get_width(cs(1)), &
                                                                 1
Error: Function ‘cs’ at (1) has no IMPLICIT type
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:95:42:

          & cairo_image_surface_get_height(cs(1))
                                          1
Error: Function ‘cs’ at (1) has no IMPLICIT type
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:96:40:

     call plsetopt("geometry",  geometry)
                                        1
Error: There is no specific subroutine for the generic ‘plsetopt’ at (1)
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:105:31:

     call pl_cmd(PLESC_DEVINIT, cc(1))
                               1
Error: Function ‘cc’ at (1) has no IMPLICIT type
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:111:31:

     call pl_cmd(PLESC_DEVINIT, cc(2))
                               1
Error: Function ‘cc’ at (1) has no IMPLICIT type
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:117:43:

     call hl_gtk_drawing_area_cairo_destroy(cc(1))
                                           1
Error: Function ‘cc’ at (1) has no IMPLICIT type
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:118:43:

     call hl_gtk_drawing_area_cairo_destroy(cc(2))
                                           1
Error: Function ‘cc’ at (1) has no IMPLICIT type
/home/vmagnin/Bureau/gtk-fortran/plplot/hl_plplot4e.f90:255:6:

   use plplot_code_ex4
      1
Fatal Error: Can't open module file ‘plplot_code_ex4.mod’ for reading at (1): Aucun fichier ou dossier de ce type
compilation terminated.
plplot/CMakeFiles/hl_plplot4e.dir/build.make:62: recipe for target 'plplot/CMakeFiles/hl_plplot4e.dir/hl_plplot4e.f90.o' failed
make[2]: *** [plplot/CMakeFiles/hl_plplot4e.dir/hl_plplot4e.f90.o] Error 1
CMakeFiles/Makefile2:2129: recipe for target 'plplot/CMakeFiles/hl_plplot4e.dir/all' failed
make[1]: *** [plplot/CMakeFiles/hl_plplot4e.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
ax006ho commented 6 years ago

At the moment I'm on Fedora 28 with gfortran from the nightly builds - gcc-Version 9.0.0 20181016 (experimental) (GCC) -. Download and installation went quite smooth, only the basic plplot library wasn't found.

//Path to a library. PLPLOTF95C_LIBRARY:FILEPATH=PLPLOTF95C_LIBRARY-NOTFOUND

//Path to a library. PLPLOTF95_LIBRARY:FILEPATH=/usr/lib64/libplplotf95.so

That came from different names of the Ubuntu and Fedora packages, I wasn't able to correct this in the basic CMakeLists.txt file. Libraries which exist on my system are

/usr/lib64/libplplot.so /usr/lib64/libplplot.so.14 /usr/lib64/libplplot.so.14.0.0 /usr/lib64/libplplotcxx.so /usr/lib64/libplplotcxx.so.13 /usr/lib64/libplplotcxx.so.13.0.0 /usr/lib64/libplplotf95.so /usr/lib64/libplplotf95.so.13 /usr/lib64/libplplotf95.so.13.0.0 and there are also the files

/usr/lib64/pkgconfig/plplot-c++.pc /usr/lib64/pkgconfig/plplot-f95.pc /usr/lib64/pkgconfig/plplot.pc

So at first I wasn't able to compile the examples in the plplot directory, but I found how to correct the Makefile in that directory. After that a lot of errors were spit out - the errors were nearly the same as in the previous comment by vmagnin.

Finally I managed to compile and execute by applying some changes to the source code. Theses were the main steps:

  1. Avoid using iso_c_binding (at least) twice, this prevents "Error: Type name ‘c_ptr’ at (1) is ambiguous".
  2. Using plplot_extra defines PLESC_DEVINIT a second time, so outcomment all the definitions.
  3. plplot uses modern interfaces, so the way of passing arrays must be changed.
  4. Replace subroutine calls by function calls, if necessary. I seem to remember that in old Fortran 66/77 something like that was possible, but it is gone with the modernisation of Fortran.

I attach 00git.diff.txt

a file 00git.diff, which is the result from git diff > 00git.diff, so the changes can be reviewed.

vmagnin commented 6 years ago

I am now working on Kubuntu 18.10, with PLPLOT 5.13.0. When executing cmake .. in the build directory I obtain:

-- Could NOT find PLPLOT (missing: PLPLOT_LIBRARIES) 
-- PLPLOT not found: PLPLOT integration and examples will not be built

I find no libplplotf95.so file, but : /usr/lib/x86_64-linux-gnu/libplplotfortran.so

Which is consistent with the following statement on PLplot site:

2.3 Change the Fortran naming convention Our Fortran binding and examples are written for the Fortran 2003 standard so the previous references in our build system, source code, documentation, and even names of files and directories to "f95", "F95", or Fortran 95 are all misnomers which we have addressed by replacing essentially all occurrences of those with "fortran" or "Fortran" as appropriate. For example, our Fortran binding and examples are now stored in the subdirectories bindings/fortran and examples/fortran rather than bindings/f95 and examples/f95 that we used before, and our build system enables our Fortran binding and examples with the CMake variable ENABLE_fortran rather than the ENABLE_f95 CMake variable that we used for this purpose before.

vmagnin commented 6 years ago

I attach 00git.diff.txt

@ax006ho I will have a look at your patch. But I need time, I have not worked on the Cmake files for 2 years... And I am not familiar with the PLplot code in gtk-fortran.

A curious thing is that on Fedora28 you have a /usr/lib64/libplplotf95.so file. Which should have become libplplotfortran.so in PLplot 5.13 (see the above message).

vmagnin commented 6 years ago

@ax006ho

I attach 00git.diff.txt

a file 00git.diff, which is the result from git diff > 00git.diff, so the changes can be reviewed.

I tried to apply the patch in the master (gtk2) branch but I have got an error: `$ git apply --apply 00git.diff.txt

error: patch failed: plplot/Makefile:1 error: plplot/Makefile: patch does not apply error: patch failed: plplot/hl_plplot17e.f90:26 error: plplot/hl_plplot17e.f90: patch does not apply error: patch failed: plplot/hl_plplot1e.f90:42 error: plplot/hl_plplot1e.f90: patch does not apply error: patch failed: plplot/hl_plplot30e.f90:47 error: plplot/hl_plplot30e.f90: patch does not apply error: patch failed: plplot/hl_plplot4e.f90:48 error: plplot/hl_plplot4e.f90: patch does not apply error: patch failed: plplot/hl_plplot4e_old.f90:175 error: plplot/hl_plplot4e_old.f90: patch does not apply error: patch failed: plplot/hl_plplot8e.f90:54 error: plplot/hl_plplot8e.f90: patch does not apply error: patch failed: plplot/plplot_extra.f90:31 error: plplot/plplot_extra.f90: patch does not apply $ git am --signoff -k 00git.diff.txt Patch format detection failed. $ ` Can you help me ? I am not familiar with git patches.

ax006ho commented 6 years ago

git apply --ignore-space-change --ignore-whitespace 00git.diff

worked for me.

vmagnin commented 6 years ago

git apply --ignore-space-change --ignore-whitespace 00git.diff

worked for me.

@ax006ho Thanks, applying the patch now works. But cmake .. is not OK, probably because the package name is not plplotf95 under ubuntu. I need to work on it.

bsbhro commented 5 years ago

Hi, I see you are working on the project. Did you build the plplot examples? still_missing lib It's Ubuntu 18.10 Thank you for the interesting stuff.

bsbhro commented 5 years ago

Hi, the example found here https://techlogbook.wordpress.com/2009/09/18/using-plplot-from-fortran-in-kubuntu-8-04/ compiled using this command: f95 testplplot2d.f90 $(pkg-config --cflags --libs plplot-fortran) I don't know how to modify the file cmake/FindPlplotF95.cmake . It would be nice if someone could. I like the whole package.

vmagnin commented 5 years ago

Hi, I see you are working on the project. Did you build the plplot examples?

Hi bsbhro,

these last months my time on gtk-fortran was mainly devoted to write a short paper in The Journal of Open Source Software (JOSS), in order to make gtk-fortran citable. So I have made no progress concerning the plplot problem. But the paper is now nearly ready for publication.

I need now to plunge again into CMake to solve the problem...

In the meantime, a solution to build the plplot examples is to install an Ubuntu <=17.10 in a virtual box...

vmagnin commented 5 years ago

Actual status

I have worked with Kubuntu 18.10 (64 bits), PLplot 5.13.0, GTK+ 2.24.32. I have created and pushed a gtk2devel branch to github. @ax006ho, I have applied your patch diff.txt to the gtk2devel branch: git apply --ignore-space-change --ignore-whitespace 00git.diff

The name of the package under Ubuntu is plplot, so I was obliged to modify the following lines in the main CMakeLists.txt file:

142    #  find_package(PlplotF95 QUIET)
143    find_package(plplot)

But I obtained the following error:

gtk-fortran/build$ cmake ..
-- Compiler: GNU 8.2.0 /usr/bin/f95
-- Build type is: release
-- Compilation flags: -pthread -O3 -mtune=native -march=native
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/plplot/export_plplot.cmake:279 (message):
  The imported target "tclmatrix" references the file

     "/usr/lib/x86_64-linux-gnu/libtclmatrix.so.10.3.0"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib/x86_64-linux-gnu/cmake/plplot/export_plplot.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/plplot/plplotConfig.cmake:20 (include)
  CMakeLists.txt:143 (find_package)

-- Configuring incomplete, errors occurred!

The missing file is in the plplot-tcl package:

$ apt-file search libtclmatrix.so.10.3.0
plplot-tcl: /usr/lib/x86_64-linux-gnu/libtclmatrix.so.10.3.0

So, I have installed the plplot-tcl-dev package. But there is now the following error:

gtk-fortran/build$ cmake ..
-- Compiler: GNU 8.2.0 /usr/bin/f95
-- Build type is: release
-- Compilation flags: -pthread -O3 -mtune=native -march=native
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/plplot/export_plplot.cmake:279 (message):
  The imported target "_Pltk_init2.7" references the file

     "/usr/lib/python2.7/dist-packages/_Pltk_init.so"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib/x86_64-linux-gnu/cmake/plplot/export_plplot.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/plplot/plplotConfig.cmake:20 (include)
  CMakeLists.txt:143 (find_package)

-- Configuring incomplete, errors occurred!

I have searched that file in Ubuntu:

$ apt-file search _Pltk_init
python-plplot: /usr/lib/python2.7/dist-packages/_Pltk_init.x86_64-linux-gnu.so
python3-plplot: /usr/lib/python3/dist-packages/_Pltk_init.cpython-36m-x86_64-linux-gnu.so
python3-plplot: /usr/lib/python3/dist-packages/_Pltk_init.cpython-37m-x86_64-linux-gnu.so

I have installed the python-plplot package, but the problem is that PLplot needs the file _Pltk_init.so which is named _Pltk_init.x86_64-linux-gnu.so in my distribution...

@ax006ho, do you have the same problem in Fedora ? @bsbhro, @bonanza, @jtappin, could you try to build the gtk2devel branch in your distributions ?

I have posted a ticket in the PLplot bug tracking system: https://sourceforge.net/p/plplot/bugs/192/

kinsho6i7h commented 5 years ago

ok, cannot get gtk-fortran to see plplot 5.14.0. As described above, the naming conventions have changed and, this is despite having a working plplot installed at /usr/local and, a broken system version still in place.

It seems the cmake is trying, incorrectly to use files that have new names and indeed, new installation conventions. As I said, plplot lives, on my mint 64 linux system.

pkg-config --cflags --libs plplot-fortran ... returns

-I/usr/local/include/plplot -I/usr/local/lib/fortran/modules/plplot -I/usr/local/include/plplot -L/usr/local/lib -lplplotfortran

I can link to, and use this and the mod files installed at /usr/local/lib/fortran/modules/plplot

I have no clue how to edit and use the cmake configuration but , to me, the windows part that uses pkgconfig would make more sense for the unix build rules to apply.

In fact, if you roughly cut / paste the windows cmake rules to the unix component, plplot is indeed found and the whole gtk-fortran thing compiles flags waving until the examples all fail due to the mod files in the build cannot be found.

vmagnin commented 5 years ago

A lot of changes concerning library names, CMake, Fortran bindings, have been made since PLplot 5.11: https://sourceforge.net/projects/plplot/files/plplot/5.11.0%20Source/ https://sourceforge.net/projects/plplot/files/plplot/5.12.0%20Source/ https://sourceforge.net/projects/plplot/files/plplot/5.13.0%20Source/ https://sourceforge.net/projects/plplot/files/plplot/5.14.0%20Source/

ax006ho commented 5 years ago

I'm now on Fedora Core 29 and I've just tested the current version (git pull). At the moment Ican say: gtk-fortran works just out of the box!

vmagnin commented 5 years ago

I'm now on Fedora Core 29 and I've just tested the current version (git pull). At the moment Ican say: gtk-fortran works just out of the box!

Thanks for the information. I have a Fedora 29 in a virtual box, I will try tomorrow. Which gtk-fortran branch have you pulled ?

vmagnin commented 5 years ago

@ax006ho Have you succeeded to build the PLplot examples ?

I have tried on Fedora 29 :

$ git clone git@github.com:vmagnin/gtk-fortran.git
$ sudo dnf install make cmake gcc-gfortran gtk3-devel plplot-devel plplot-fortran-devel

In the gtk3 branch, cmake does not find PLplot (5.13.0)

In the gtk3devel branch, PLplot is found but I was obliged to install a lot of packages to avoid errors: plplot-tk-devel plplot-octave plplot-wxGTK-devel plplot-ada-devel plplot-lua plplot-qt plplot-pyqt And finally:

[ 93%] Building Fortran object plplot/CMakeFiles/hl_plplot4e_old.dir/hl_plplot4e_old.f90.o
/home/osboxes/gtk-fortran/gtk-fortran/plplot/hl_plplot4e_old.f90:50:6:

   use plplot, PI => PL_PI
      1
Fatal Error: Can't open module file ‘plplot.mod’ for reading at (1): No such file or directory
vmagnin commented 5 years ago

this is a report of my progress toward interfacing gtk-fortran (gtk2devel branch) and PLplot 5.14:

1) I finally installed in a virtual machine a Debian Sid (unstable) because if offers the PLplot 5.14 packages.

2) I have installed the following packages for gtk-fortran and PLplot: # apt install git gitk cmake gfortran libgtk2.0-dev libgtk-3-dev libplplot-dev plplot-doc

I have successfully built the PLplot examples:

# cd /usr/share/doc/plplot-doc/examples/
# make
# ./x00c

I have tried some examples and successfully created output files using:

< 3> ps         PostScript File (monochrome)
<11> svg        Scalable Vector Graphics (SVG 1.1)

But for an unknown reason failed to plot anything directly on screen (xwin, tk, qt drivers...) although plplot-driver-qt, plplot-driver-wxwidgets and plplot-driver-xwin are installed. With that kind of message (x33c):

Enter device number or keyword: 1

*** PLPLOT ERROR, IMMEDIATE EXIT ***
Can't open display
Program aborted

3) On the gtk-fortran side, when trying to build the project, CMake found PLplot but stopped me with errors like:

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/plplot/export_plplot.cmake:175 (message):
  The imported target "PLPLOT::tclmatrix" references the file

 "/usr/lib/x86_64-linux-gnu/libtclmatrix.so.10.3.0"

  but this file does not exist.  Possible reasons include:
...

Using apt-file, I saw that it was in the plplot-tcl package so I installed plplot-tcl-dev. Then I was similarly obliged to install octave-plplot.

But I am now stopped by this error:

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/plplot/export_plplot.cmake:175 (message):
  The imported target "PLPLOT::plplot_pyqt5" references the file

     "/usr/lib/python3/dist-packages/plplot_pyqt5.so"

  but this file does not exist.  Possible reasons include:

...

I have installed the python3-plplot-qt package:

root@osboxes:~# apt-file search plplot_pyqt5
python3-plplot-qt: /usr/lib/python3/dist-packages/plplot_pyqt5.cpython-37m-x86_64-linux-gnu.so
root@osboxes:~# apt install python3-plplot-qt

But CMake still gives me the same error because in that package the file is named plplot_pyqt5.cpython-37m-x86_64-linux-gnu.so instead of plplot_pyqt5.so.

vmagnin commented 5 years ago

I am in contact with the PLplot developers on that problem: https://sourceforge.net/p/plplot/mailman/plplot-general/ It appears that there is a Debian packaging problem (impacting of course all distributions based on it), that is being worked on.

vmagnin commented 5 years ago

Debian Stretch 9.7 is still offering PLplot 5.10 (also named PLplot12) and the gtk-fortran PLplot examples are running fine in that distribution.

vmagnin commented 5 years ago

To get rid of the Debian packages probrem, I have build PLplot 5.14 from the sources on a Debian Sid. But we need to adapt to the new PLplot CMake files. One part of the problem is that CMake variables are case sensitive: for example, gtk-fortran was using PLPLOT_FOUND but now it seems we should use plplot_FOUND. See my messages posted on https://sourceforge.net/p/plplot/mailman/plplot-general/ to follow that work.

vmagnin commented 5 years ago

Using pkg-config, I have successfully compiled and executed the PLplot examples in my gtk2devel branch:

$ gfortran hl_plplot1e.f90 `pkg-config --cflags --libs plplot plplot-fortran gtk-2-fortran`

Note that the 00git.diff.txt does not edit the hl_plplot17e_gto.f90. So this one fails.

PLplot 5.13 under Ubuntu 18.10:

$ pkg-config --cflags --libs plplot
-I/usr/include/plplot -lplplot
$ pkg-config --cflags --libs plplot-fortran
-I/usr/include/plplot -I/usr/lib/x86_64-linux-gnu/fortran/modules/plplot -I/usr/include/plplot -lplplotfortran
vmagnin commented 5 years ago

In a gtk3devel branch (temporary pushed to github), I have applied the patch 00git.diff.txt. And I have modified the CMakeLists.txt (main and plplot/). Because of the Debian packages problem, I have replaced (temporarily ?) the CMake find_package(plplot) command by PKG_CHECK_MODULES(PLPLOT-FORTRAN REQUIRED plplot-fortran) and PKG_CHECK_MODULES(PLPLOT REQUIRED plplot) commands.

pkg-config finds everything needed to build the gtk-fortran PLplot examples. Everything runs OK under Ubuntu 18.10 with its PLplot 5.13 package.

It evens builds without problem in MSYS2 / Windows 7, but there is an execution error when launching all the PLplot examples:

$ ./hl_plplot17e.exe
  gtk-fortran/build/plplot/hl_plplot17e.exe: error while loading shared libraries: libgfortran-5.dll: cannot open shared object file: No such file or directory

The issue has been reported here: https://github.com/msys2/MINGW-packages/issues/5047

kinsho6i7h commented 5 years ago

Getting closer on my linux mint system. Now plplot libs are found, doxygen is found.

GTK libs are not. I installed 64bit static gtk3 libs with -fPIC. If I build shared, it breaks other stuff that can't link.

vmagnin commented 5 years ago

Hi @kinsho6i7h

Now plplot libs are found, doxygen is found.

Concerning PLplot, you can pull the gtk3devel branch (I will merge it with gtk3 only after some testing in various virtual machines). Concerning Doxygen, it was introduced in the CMake code a long time ago but I don't think it is used in the gtk-fortran code (I have found nothing). So it's optional.

GTK libs are not. I installed 64bit static gtk3 libs with -fPIC. If I build shared, it breaks other stuff that can't link.

Perhaps you should have a look to the file: https://github.com/vmagnin/gtk-fortran/blob/gtk3/cmake/FindGTK3.cmake

kinsho6i7h commented 5 years ago

Yes, I pulled the gt3devel branch today. I will look at that file carefully, thanks.

ax006ho commented 5 years ago

I've just tested the gtk3devel branch with the attached script 00install.txt The log file is attached as 00install.log 00install.txt 00install.log

There is a problem with gtkf-sketcher.f90, I will report it in another thread

ax006ho commented 5 years ago

This is the result of the gtk3 branch test. Script: 00install.txt Log file: 00install.log 00install.log 00install.txt

So everything but the plplot examples seems to work fine

vmagnin commented 5 years ago

The MSYS2 team has upgraded PLplot from 5.13 to 5.14: now, in the gtk3devel branch, the gtk-fortran PLplot examples all run under Windows !

That branch has finally been tested OK in:

On FreeBSD 12.0, it was more difficult to build PLplot 5.14 with Fortran support because at first CMake did not find gfortran which is named gfortran8. Finally I have succeeded using:

$ export FC=/usr/local/bin/gfortran8
$ cmake -D CMAKE_INSTALL_PREFIX=/home/osboxes/myplplot ../plplot-5.14.0

Then gtk-fortran was built successfully using:

$ PKG_CONFIG_PATH=/home/osboxes/myplplot/lib/pkgconfig cmake -D CMAKE_Fortran_COMPILER:FILEPATH="/usr/local/bin/gfortran8" ..

So, I will soon merge gtk3devel into gtk3 and close the present issue.

vmagnin commented 5 years ago

I have just merged gtk3devel=>gtk3.

All the documentations (README and WIKI) about PLplot has been revised for PLplot>=5.13.

I close this issue. You can open new issues about the other problems/discussions.