Installing Gnuplot 5.0 on Ubuntu

Multi tool use
Installing Gnuplot 5.0 on Ubuntu
I have been trying to install Gnuplot 5.0 from source on Ubuntu.
I followed the procedure given in the blog:
Installing gnuplot from source
I used the following commands:
tar xzf gnuplot-5.0.0.tar.gz
mkdir build
cd build
../gnuplot-5.0.0/configure --with-readline=gnu
make
Everything until the configure command works fine. However, I end up getting the following error when I run the make command:
In file included from ../../gnuplot-5.0.0/src/qtterminal/QtGnuplotWindow.cpp:187:0:
./ui_QtGnuplotSettings.h:13:25: fatal error: QtGui/QAction: No such file or directory
#include <QtGui/QAction>
Could someone guide on how to fix this issue? If there is an alternative easier way to install gnuplot 5.0.0. that would be helpful as well.
qtbase5-dev
qt
Yes. I did install qtbase5-dev, qtdeclarative5-dev and libqt5svg5-dev. There are a bunch of qt4 libraries already installed as well, which I did not remove.
– Ravi
Apr 8 '15 at 22:09
QtGui/QAction means qt4 (QtWidget/QAction in qt5), first install all qt4 dev packages, the recompile (or re-configure too)
– gengisdave
Apr 8 '15 at 23:03
Is there a list of all the qt4 dev packages available?
– Ravi
Apr 8 '15 at 23:06
I'm not sure which dev packages are all required to build gnuplot with qt, but you can use
./configure --with-qt=no
to build without the qt terminal. You'll still have wxt
as interactive terminal.– Christoph
Apr 9 '15 at 6:36
./configure --with-qt=no
wxt
2 Answers
2
Here's a compilation of the various library-dev packages necessary for gnuplot in ubuntu. Additional -dev packages that are installed automatically with the ones named are not listed or in (parentheses).
For the old interactive x11
terminal
x11
libx11-dev
For the pdfcairo
, pngcairo
, epscairo
terminals
pdfcairo
pngcairo
epscairo
libcairo2-dev
libpango1-dev
additionally for the interactive wxt
terminal (try ./configure --with-wx-single-threaded
in case of problems (e.g. make check
crashes). If it doesn't compile with complaints about "XInitThreads", try TERMLIBS="-lX11" ./configure
.)
wxt
./configure --with-wx-single-threaded
make check
TERMLIBS="-lX11" ./configure
libwxgtk2.8-dev or libwxgtk3.0-dev
libgtk2.0-dev
For the libgd-based png
, gif
, jpeg
terminals
png
gif
jpeg
libgd-dev
(libxpm-dev)
(libjpeg-turbo8-dev)
(libtiff5-dev)
For the interactive qt
terminal (./configure --with-qt=qt5
)
qt
./configure --with-qt=qt5
qtbase5-dev
libqt5svg5-dev
alternatively for qt4 (./configure --with-qt=qt4
)
./configure --with-qt=qt4
libqt4-dev
For the lua
terminal
lua
liblua5.2-dev (also read ./INSTALL)
For the text-mode caca
terminal (./configure --with-caca
)
caca
./configure --with-caca
libcaca-dev
To use external libreadline instead of gnuplots builtin replacement (recommended)
libreadline-dev
To have the mathematical functions provided by the cerf library (can't hurt)
libcerf-dev
The list is not final (i don't have a spare system to try out all the dependencies at the moment). Feel free to add, update and correct!
Your answer was very helpful. I just want to add that I also needed to
sudo apt-get install qttools5-dev-tools
in addition to qtbase5-dev
and libqt5svg5-dev
to get qt5 terminal in gnuplot. Without this, a linking error /usr/lib/x86_64-linux-gnu/qt5/bin/lrelease: No such file or directory
occurs. I have edited your answer to reflect this.– Allan
Oct 14 '15 at 8:43
sudo apt-get install qttools5-dev-tools
qtbase5-dev
libqt5svg5-dev
/usr/lib/x86_64-linux-gnu/qt5/bin/lrelease: No such file or directory
@Allan: I can't confirm this with ubuntu 15.04 or .10, What version are you using?
– Karl
Oct 20 '15 at 21:33
Well, not exactly Ubuntu, but Linux Mint 17.2.
– Allan
Oct 22 '15 at 12:11
They can easily have a different packaging. Split from debian ten years ago.
– Karl
Oct 23 '15 at 2:44
Any special options necessary to the configure script, e.g.
--psdir=XYZ
? I'm asking because with the version I build from scratch I get some weird errors sometimes about a postscript prologue file and such. I wonder what the right values are here.– con-f-use
May 25 '16 at 19:07
--psdir=XYZ
I simply followed the instructions in the file INSTALL and it worked perfectly:
$ tar xzf gnuplot-5.0.1.tar.gz
$ cd gnuplot-5.0.1
$ ./configure
$ make
$ sudo make install
After doing this, when I call gnuplot anywhere, the result is
$ gnuplot
G N U P L O T
Version 5.0 patchlevel 1 last modified 2015-06-07
Copyright (C) 1986-1993, 1998, 2004, 2007-2015
Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help FAQ"
immediate help: type "help" (plot window: hit 'h')
That's very nice for you (although you likely now have a gnuplot with only one useful terminal, postscript), but doesn't help with the problem.
– Karl
Jul 31 '15 at 13:57
I am using Ubuntu 15.04, and had previously installed gnuplot 4.6 from the repository. I instaled gnuplot 5.01 without unistalling gnuplot 4.6. Maybe, for that reason, it installed all necessary packages. Anyway, I have all terminals working and if I don't set any terminal, it opens a window and shows the graphic in a x11 terminal.
– bmello
Aug 4 '15 at 17:55
You most certainly don't have the wxt or qt terminal, or any of the *cairo terminals. Unless you previously installed the qt, cairo and pango dev-packages for something else. There is no automatism. The x11 terminal still works, but I don't think you'll want it back once you've seen the alternatives. Ubuntu has a package gnuplot5 if you want to try.
– Karl
Aug 4 '15 at 20:30
This being a top hit for "install gnuplot" it was useful to me to have the basics summarized here, together with Karl's last comment.
– PatrickT
May 21 '16 at 18:14
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Did you install
qtbase5-dev
? Or any otherqt
library component?– Willem Van Onsem
Apr 8 '15 at 22:03