blueCFD / Core

Coordination repository for the blueCFD-Core: Issue tracking, Wiki, project webpage and miscellaneous scripts
http://bluecfd.github.io/Core
53 stars 10 forks source link

gnuplot in blueCFD-Core 2017-1 does not provide support for PNG nor JPEG #78

Closed wyldckat closed 6 years ago

wyldckat commented 7 years ago

Since MSys2 had started providing gnuplot as a package, we had decided to go for it and use it, instead of providing it as an add-on.

Furthermore, the only way to launch gnuplot interactively from the MSys2 terminal, was to launch it as:

winpty gnuplot

Here is the output on the version that comes with MSys2:

gnuplot> set terminal

Available terminal types:
           canvas  HTML Canvas object
              cgm  Computer Graphics Metafile
          context  ConTeXt with MetaFun (for PDF documents)
          domterm  DomTerm terminal emulator with embedded SVG
             dumb  ascii art for anything that prints text
              dxf  dxf-file for AutoCad (default size 120x80)
            eepic  EEPIC -- extended LaTeX picture environment
              emf  Enhanced Metafile format
            emtex  LaTeX picture environment with emTeX specials
         epslatex  LaTeX picture environment using graphicx package
              fig  FIG graphics language for XFIG graphics editor
             hpgl  HP7475 and relatives [number of pens] [eject]
            latex  LaTeX picture environment
               mf  Metafont plotting standard
               mp  MetaPost plotting standard
             pcl5  HP Designjet 750C, HP Laserjet III/IV, etc. (many options)
       postscript  PostScript graphics, including EPSF embedded files (*.eps)
          pslatex  LaTeX picture environment with PostScript \specials
            pstex  plain TeX with PostScript \specials
         pstricks  LaTeX picture environment with PSTricks macros
              qms  QMS/QUIC Laser printer (also Talaris 1200 and others)
              svg  W3C Scalable Vector Graphics
          texdraw  LaTeX texdraw environment
             tgif  TGIF X11 [mode] [x,y] [dashed] ["font" [fontsize]]
         tkcanvas  Tk canvas widget
             tpic  TPIC -- LaTeX picture environment with tpic \specials
          unknown  Unknown terminal type - not a plotting device
          windows  Microsoft Windows

Therefore, there are 2 possible ways to fix this:

  1. Submit a patch/pull request to MSys2 to fix this (must depend on the -dev packages).

  2. Or must provide it as an add-on once again.

wyldckat commented 7 years ago

OK, so MSys2 already has a mostly working package, problem is that it hasn't been built yet to be placed on the MSys2 package repository.

Getting the folder mingw-w64-gnuplot from https://github.com/Alexpux/MINGW-packages - then installing the package base-devel like this (name from here):

pacman -S --needed base-devel

Then running the following command from within the aforementioned folder:

MINGW_INSTALLS=mingw64 makepkg-mingw -sLf

Then can be installed by running:

pacman -U mingw-w64-x86_64-gnuplot-5.2.0-3-any.pkg.tar.xz

This provides gnuplot with PNG and JPEG support, among others. However:

  1. gnuplot is not interactive via command line, not even with winpty.
  2. Creation of eps or ps files is not possible, unless the following is executed:
    export GNUPLOT_PS_DIR=/mingw64/share/gnuplot/5.2/PostScript

Side note, for installing ghostscript via MSys2:

pacman -S mingw64/mingw-w64-x86_64-ghostscript

However, it doesn't seem to be necessary to be installed.

wyldckat commented 6 years ago

OK, updated the MSys2 installation in the development folder for blueCFD-Core 2017 and have gotten the updated gnuplot installation. However, it doesn't start because Qt5 DLL files are needed, namely QT5CORE.DLL, QT5GUI and QT5NETWORK.

To install Qt5 into MSys2, we run:

pacman -S mingw64/mingw-w64-x86_64-qt5

The problem is that it will need some additional 6GB of disk... which we can offset in our blueCFD-Core 2017 installer, by excluding the development and help folders for Qt5, since all we need are the DLL files.

wyldckat commented 6 years ago

Installing Qt5 makes wgnuplot work properly.

Simply running gnuplot will not give an appearance of it being running, but it does accept controls and does not rely on winpty. For example, running:

set terminal

will give the following output:

set terminal

Available terminal types:
             caca  Colour ascii art using libcaca, the Colour AsCii Art library
       cairolatex  LaTeX picture environment using graphicx package and Cairo backend
           canvas  HTML Canvas object
              cgm  Computer Graphics Metafile
          context  ConTeXt with MetaFun (for PDF documents)
          domterm  DomTerm terminal emulator with embedded SVG
           dpu414  Seiko DPU-414 thermal printer [small medium large]
             dumb  ascii art for anything that prints text
              dxf  dxf-file for AutoCad (default size 120x80)
            eepic  EEPIC -- extended LaTeX picture environment
              emf  Enhanced Metafile format
            emtex  LaTeX picture environment with emTeX specials
         epscairo  eps terminal based on cairo
         epslatex  LaTeX picture environment using graphicx package
     epson_180dpi  Epson LQ-style 180-dot per inch (24 pin) printers
      epson_60dpi  Epson-style 60-dot per inch printers
      epson_lx800  Epson LX-800, Star NL-10, NX-1000, PROPRINTER ...
              fig  FIG graphics language for XFIG graphics editor
              gif  GIF images using libgd and TrueType fonts
           hp500c  HP DeskJet 500c, [75 100 150 300] [rle tiff]
             hpdj  HP DeskJet 500, [75 100 150 300]
Press return for more:
             hpgl  HP7475 and relatives [number of pens] [eject]
           hpljii  HP Laserjet series II, [75 100 150 300]
             hppj  HP PaintJet and HP3630 [FNT5X9 FNT9X17 FNT13X25]
             jpeg  JPEG images using libgd and TrueType fonts
            latex  LaTeX picture environment
               mf  Metafont plotting standard
               mp  MetaPost plotting standard
          nec_cp6  NEC printer CP6, Epson LQ-800 [monochrome color draft]
          okidata  OKIDATA 320/321 Standard
              pbm  Portable bitmap [small medium large] [monochrome gray color]
             pcl5  HP Designjet 750C, HP Laserjet III/IV, etc. (many options)
         pdfcairo  pdf terminal based on cairo
              png  PNG images using libgd and TrueType fonts
         pngcairo  png terminal based on cairo
       postscript  PostScript graphics, including EPSF embedded files (*.eps)
          pslatex  LaTeX picture environment with PostScript \specials
            pstex  plain TeX with PostScript \specials
         pstricks  LaTeX picture environment with PSTricks macros
              qms  QMS/QUIC Laser printer (also Talaris 1200 and others)
               qt  Qt cross-platform interactive terminal
          sixelgd  sixel using libgd and TrueType fonts
            starc  Star Color Printer
Press return for more:
              svg  W3C Scalable Vector Graphics
      tandy_60dpi  Tandy DMP-130 series 60-dot per inch graphics
          texdraw  LaTeX texdraw environment
             tgif  TGIF X11 [mode] [x,y] [dashed] ["font" [fontsize]]
         tkcanvas  Tk canvas widget
             tpic  TPIC -- LaTeX picture environment with tpic \specials
          unknown  Unknown terminal type - not a plotting device
          windows  Microsoft Windows
              wxt  wxWidgets cross-platform interactive terminal

So this settles this issue.

wyldckat commented 6 years ago

Have also installed evince, so that EPS files can be opened:

pacman -S mingw64/mingw-w64-x86_64-evince

It also installed mingw-w64-x86_64-ghostscript and GSL, along with a few other libraries.

wyldckat commented 6 years ago

Next steps

  1. Need to figure out a fix for this issue:

    gnuplot
    help
    C:/building/msys64/mingw64/share/gnuplot/5.2/gnuplot.gih: No such file or directory
  2. Add the export line export GNUPLOT_PS_DIR=/mingw64/share/gnuplot/5.2/PostScript to the profile loading scripts.

    • Added this line in the file /etc/profile.d/gnuplot.sh.
  3. Need to revise the installer script, so that Qt 5 is only included as the bare minimal installation for gnuplot and wgnuplot to run.

    • Done.
  4. Need to add an indication on the FAQ about how silent'ish this gnuplot is in the command line and that wgnuplot can be used instead for a bit more interactivity... although it also works a bit funny... since the commands are shown in the mintty terminal instead.

wyldckat commented 6 years ago

3 - Files/folders to be ignored

gnuplot depends on the following files:

        Qt5Core.dll => /home/ofuser/blueCFD/msys64/mingw64/bin/Qt5Core.dll (0x66740000)
        Qt5Network.dll => /home/ofuser/blueCFD/msys64/mingw64/bin/Qt5Network.dll (0x6d200000)
        Qt5Gui.dll => /home/ofuser/blueCFD/msys64/mingw64/bin/Qt5Gui.dll (0x2fe0000)
wyldckat commented 6 years ago

Have also added an FAQ entry for the issue with supported terminals in 2017-1: http://bluecfd.github.io/Core/FAQ/gnuplot-does-not-plot-to-image-files/

And with this I hereby close this task, delegating future fixes to #90.