Menu

#199 Build instructions using MSYS2/Mingw-w64

None
open
nobody
5
2022-01-29
2016-03-09
No

Attached is a first draft of build instructions with MSYS2/Mingw-w64. It applies to current CVS head (5.1), but for 5.0.3 only a few more changes to the Makefile are required.

Compilation of qtconversion.cpp might fail due to isnan(). If that is the case simply add an #include <cmath> and change the call to std::isnan(). A fix for this should be in the next release.

2 Attachments

Related

Bugs: #1740
Discussion: Building problems - HTML help SDK 1.4 and _WIN32_WINT conflicts with WINVER
Feature Requests: #444
Feature Requests: #517
Support Requests: #256

Discussion

  • Bastian Märkisch

    • summary: Build instruction using MSYS2/Mingw-w64 --> Build instructions using MSYS2/Mingw-w64
    • Group: -->
     
  • Tatsuro MATSUOKA

    Great! The instruction is helpful for those who would like try to build gnuplot for windows.

    I wrote latest information on the bottom of this thread.

     

    Last edit: Tatsuro MATSUOKA 2023-07-25
  • Tatsuro MATSUOKA

    Compilation of qtconversion.cpp might fail due to isnan(). If that is the case simply add an #include <cmath> and change the call to std::isnan(). A fix for this should be in the next release.

    However, on my build system Msys2+MinGW w64 gcc-5.3.0 on Original, std::isnan() gives error

    g++ -c -I/e/Programs/gplibs64_gcc530/include -fno-keep-inline-dllexport -D_FILE_OFFSET_BITS=64 -DUSE_MINGW_ANSI_STDIO -DDEFAULTTERM=\"wxt\" -DHAVE_FINDVERSION_H -m64 -O2 -pipe -I. -I../../src -I../../term/ -D_Windows -DHAVE_CONFIG_H -DPIPES -DWGP_CONSOLE -DCONSOLE_SWITCH_CP -DUSE_MINGW_ANSI_STDIO=1 -DGNUPLOT_SHARE_DIR=\"share\" -DDEVELOPMENT_VERSION -DUSE_MOUSE=1 -DWIN_IPC -I/c/Program\ Files\ (x86)/HTML\ Help\ Workshop/include -DHAVE_LIBGD -DHAVE_LIBPNG -DHAVE_LIBGD -DHAVE_GD_H -DHAVE_GD_GIF -DGIF_ANIMATION -DHAVE_GD_PNG -DHAVE_GD_JPEG -DHAVE_GD_TTF -DHAVE_CAIROPDF -DWXWIDGETS -DQTTERM -DQT_NO_OPENGL -DHAVE_LUA -DHAVE_LIBCACA -DHAVE_ICONV -DHAVE_LIBCERF -DNEED_CEXP -I/e/Programs/gplibs64_gcc530/include -I/e/Programs/gplibs64_gcc530/lib/wx/include/msw-unicode-3.0 -I/e/Programs/gplibs64_gcc530/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -DWXMSW -I/e/Programs/Qt/5.3.2_mgw64_530/include -I/e/Programs/Qt/5.3.2_mgw64_530/include/Qt -I/e/Programs/Qt/5.3.2_mgw64_530/include/QtCore -I/e/Programs/Qt/5.3.2_mgw64_530/include/QtGui -I/e/Programs/Qt/5.3.2_mgw64_530/include/QtWidgets -I/e/Programs/Qt/5.3.2_mgw64_530/include/QtNetwork -I/e/Programs/Qt/5.3.2_mgw64_530/include/QtSvg -DQTGNUPLOT_DATA_DIR=\"share/qt\" -MMD -MT 'qt_term.$(O)' -MF qt_term.d -o qt_term.co ../../src/qtterminal/qt_term.cpp
    In file included from E:/Programs/Qt/5.3.2_mgw64_530/include/QtCore/qmath.h:49:0,
    from E:/Programs/Qt/5.3.2_mgw64_530/include/QtCore/QtCore:65,
    from ../../src/qtterminal/qt_term.cpp:51:
    ../../src/qtterminal/qt_conversion.cpp: In function 'QImage qt_imageToQImage(int, int, coordval, t_imagecolor)':
    ../../src/qtterminal/qt_conversion.cpp:129:14: error: expected unqualified-id before '(' token
    if (std::isnan(
    image))

    and isnan() passes. However, on gcc-4.9.2 std::isnan(*image)) passed.

     
  • Tatsuro MATSUOKA

    I have build gnuplot for windows according to your instruction.
    (development source 5.1.0 2016-03-17)
    All dependecies can be get from one repository.
    That is GREAT!.

    One point:
    I have met the following screen (attachment file) using wxt terminal.

    For my binaries distributed, I attached dirty patch to suppress the
    Wxwedgets Debug Alert in source level.
    However, this is hopefully avoided.

    Do you have any good idea to avoid this?

     
    • Matthew Halverson

      I'm seeing this same problem and gave up on trying to build with wxWidgets. These build instructions are great for testing out the development version on windows, but I will stick to using the officially released binaries for anything important.

      Still, I would love to see a solution to this.

       
  • Tatsuro MATSUOKA

    Quick hack

    1778: #if !defined(DEVELOPMENT_VERSION) && wxCHECK_VERSION(2, 9, 0)
    

    in src/wxterminal/wxt_gui.cpp to

    1778: #if 1
    

    solves the problem

    I will considrer proper #if description

     
    • Bastian Märkisch

      The reason why I compile this in only for a "release" build was that I assume that that warning is there for a reason. So maybe we really need a proper fix.

       
      • Tatsuro MATSUOKA

        Thanks for the reply. It seems that simple change of #if description is not a sufficient. It will be better you consider the fix.

         
  • Morten MacFly

    Morten MacFly - 2020-10-25

    Sorry for bumping an old thread. I followed the guidelines, but this step:
    pacman -S mingw64/mingw-w64-x86_64-gd
    ...does not work for me. It fails with an error "target not found" and also, the package is not listed here:
    https://packages.msys2.org/package/
    Is this lib removed/obsolete in MSys2? But without the png/gif/jpeg terminals Gnuplut makes no sense for me... How do you guys work-around?

     
    • Hans-Bernhard Broeker

      Well, it's a bit much to expect four-and-a-half year old draft to still apply letter for letter today.
      MSYS2 repackaged libgd as 'libgd' instead of 'gd' at some point.

       
      • Morten MacFly

        Morten MacFly - 2020-10-25

        Thanks for the hint, this worked! But I am stuck now with PDFlib lite which does not compile for me on MSys2, even after patching the build system. I kind of have given up, unfortunately.

        I was hoping I could find a way to self-compile and thought that this recent entry: https://sourceforge.net/p/gnuplot/support-requests/256/#4f69/fba3/6faa/3607 was referring to here for self-compilation. Seems not. Maybe there is a more recent guideline somewhere?

        BTW: I used to self-compile Gnuplot every now and then a few years back, so I am not totally unexperienced. But it seems to have gotten too difficult for me, somehow.

         
        • Hans-Bernhard Broeker

          PDFlib is not really necessary for anything, as long as you have the Cairo PDF terminal instead, which is almost certainly superior.

           
  • Tatsuro MATSUOKA

    Change list at July 25, 2023

    External tool
    Microsoft HTML Help Compiler
    https://www.helpandmanual.com/downloads_mscomp.html
    (Site on Microsoft has been closed.)

    Tools or libraries for build

    Some required tools

    pacman -S --needed base-devel mingw-w64-x86_64-toolchain msys/dos2unix
    

    cairo / pango

    pacman -S mingw-w64-x86_64-cairo mingw-w64-x86_64-pango
    

    wxWidgets

    pacman -S mingw-w64-x86_64-wxwidgets3.0-msw
    

    libgd

     pacman -S mingw-w64-x86_64-libgd
    

    lua

     pacman -S mingw-w64-x86_64-lua
    

    libcerf (Building from source is no longer required)

    pacman -S mingw-w64-x86_64-libcerf
    

    pdflib

    # Usually it is not required. Use pdfcairo terminal instead
    # Usual binary distribution does not include this feature.)
    

    Qt
    Least components for reuired for gnuplot build.

    pacman -S mingw-w64-x86_64-qt5-base mingw-w64-x86_64-qt5-svg mingw-w64-x86_64-qt5-tools
    

    Full install (Huge)

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

    libcaca

    # Usual binary distribution does not include this feature.
    # pacman -S mingw-w64-x86_64-libcaca
    

    For version 6

    libwebp

    pacman -S mingw-w64-x86_64-libwebp
    

    openspecfun
    https://github.com/JuliaMath/openspecfun

    git clone https://github.com/JuliaMath/openspecfun.git
    cd openspecfun
    make
    gendef libopenspecfun.dll
     dlltool -d libopenspecfun.def -l libopenspecfun.dll.a
     dlltool -d libopenspecfun.def -l libopenspecfun_dll.a
     cp -p libopenspecfun.dll.a /mingw64/lib
     cp -p libopenspecfun_dll.a /mingw64/lib
     cp -p libopenspecfun.dll /mingw64/bin
    

    opensepcfun does not include "cexint" which is required for expint.
    See https://sourceforge.net/p/gnuplot/bugs/2475/

    For development version or sources on git branch

    git

    pacman -S git 
    

    Documantation
    In order to get up-to-date gnuplot manual, one should use the LaTeX.
    TeX (TeXLive on Msys2 is recommended) and ghostscipt are required.

    Least requirements for gnuplot documentation

    pacman -S \
    mingw-w64-x86_64-texlive-core \
    mingw-w64-x86_64-texlive-fonts-extra \
    mingw-w64-x86_64-texlive-fonts-recommended \
    mingw-w64-x86_64-texlive-font-utils \
    mingw-w64-x86_64-texlive-formats-extra \
    mingw-w64-x86_64-texlive-lang-cjk \
    mingw-w64-x86_64-texlive-lang-greek \
    mingw-w64-x86_64-texlive-latex-extra \
    mingw-w64-x86_64-texlive-latex-recommended \
    mingw-w64-x86_64-texlive-luatex \
    mingw-w64-x86_64-texlive-pictures \
    mingw-w64-x86_64-texlive-plain-generic \
    mingw-w64-x86_64-texlive-science
    
    # For documentation of Japanese Language
    pacman -S mingw-w64-x86_64-texlive-lang-japanese
    
    # ghostscrpt
    pacman -S mingw-w64-x86_64-ghostscript
    

    TeXLive full install (Huge)

    pacman -S mingw-w64-x86_64-texlive-full
    

    LaTeX style file "picins.sty" is requred for latex compilation.
    Download picins.zip from
    https://ctan.org/pkg/picins
    extract picins.zip and copy the "picins" directory to the /mingw64/share/texmf-dist/tex/latex
    and execute

    mktexlsr
    

    Packaging tools

    Inno Setup (Installer packaging tool)
    http://www.jrsoftware.org/isdl.php

    p7zip / zip

    pacman -S p7zip zip
    
     

    Last edit: Tatsuro MATSUOKA 2023-07-26

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.