Install Gnuplot 4.4.0 on Ubuntu Linux

Posted March 3rd @ 5:02 by Werner

The most frequented blog entries here are about installing Gnuplot on Ubuntu Linux or Mac OS X. These entries are still valid for the newer Ubuntu versions. But Gnuplot newest version 4.4.0 was already released, and in this release there are cairo based pdf and png terminals provided. So you don’t need the pdflib anymore. Below you’ll find updated instructions to compile and install Gnuplot 4.4.0 with wxt and pdfcairo terminal. These instructions were tested on Ubuntu 8.04 (Hardy Heron) and Ubuntu 9.10 (Karmic Koala) and should also work on 8.10 (Intrepid Ibex) and 9.04 (Jaunty Jackalop).

Prerequisites

We need to make sure some packages are already installed before we try to compile gnuplot

  • libwxgtk2.8-dev – for the wxt terminal
  • libpango1.0-dev – for the cairo (pdf, png) and wxt terminals
  • libreadline5-dev – readline support (editing command lines)
  • libx11-dev and libxt-dev – X11 terminal
  • texinfo (optional) – needed for the tutorial
  • libgd2-xpm-dev (optional) – old png, jpeg and gif terminals based on libgd

This command (run in a terminal) will install all prerequisites if not already installed:

sudo apt-get install libwxgtk2.8-dev libpango1.0-dev libreadline5-dev libx11-dev libxt-dev texinfo libgd2-xpm-dev

Then we download and compile gnuplot (run each command/line in a terminal)

  • wget http://sourceforge.net/projects/gnuplot/files/gnuplot/4.4.0/gnuplot-4.4.0.tar.gz/download
  • tar xzf gnuplot-4.4.0.tar.gz
  • mkdir build && cd build
  • ../gnuplot-4.4.0/configure --with-readline=gnu

check if you find the lines in the output at the bottom:

X Window System terminal: yes
jpeg terminal: yes
gif terminal: yes (with animated gif)
png terminal: yes
    (jpeg, gif and png terminals can use TTF fonts)
wxt terminal: yes
cairo-based pdf and png terminals: yes
Readline library: GNU readline library with  -lncurses
  • make

(if you have problems here with some latex errors than disable the latex tutorial during the configure stage with “--without-tutorial”, if you get a “103: makeinfo: not found” error message than install the texinfo package)

  • sudo make install

Then you have gnuplot installed with nice readline support (command line like in bash), a nice new wxWidgets terminal and a pdf terminal based on cairo.

2 Trackbacks/Pingbacks

  1. Pingback: Install gnuplot on Ubuntu Gutsy Gibbon | miscellaneous.debris on March 3, 2010
  2. Pingback: Install gnuplot on Ubuntu | miscellaneous.debris on March 3, 2010

19 Comments

  1. Ryan
    March 9, 2010 at 11:30

    Thanks for this update – I used your site ages ago to set up PDF support in Hardy, and it’s good of you to keep these things up to date.

  2. maurizio
    April 2, 2010 at 18:06

    sorry for my stupid question, but i’m an absolute beginner in ubuntu and gnuplot. the new release is out, is your install tutorial still valid? what’s changed (about prerequisites)?
    thanks for your help.

  3. Werner
    April 2, 2010 at 22:25

    Hi Maurizio, sure this tutorial is also valid for Gnuplot 4.4.0. Prerequisites are the same.

    HTH,
    WErner

  4. maurizio
    April 3, 2010 at 15:16

    sorry, i didn’t understand ‘So you don’t need the pdflib anymore.’ :)
    i’ll follow your instructions, thanks.

  5. maurizio
    April 3, 2010 at 15:54

    i got this make error:

    /usr/lib/libwx_baseu-2.8.so: undefined reference to `std::ctype::_M_widen_init() const@GLIBCXX_3.4.11′
    collect2: ld returned 1 exit status
    make[3]: *** [gnuplot] Errore 1
    make[3]: uscita dalla directory «/home/user_name/Scrivania/build/src»
    make[2]: *** [all-recursive] Errore 1
    make[2]: uscita dalla directory «/home/user_name/Scrivania/build/src»
    make[1]: *** [all-recursive] Errore 1
    make[1]: uscita dalla directory «/home/user_name/Scrivania/build»
    make: *** [all] Errore 2

    is it a serious error? make install is a disaster :-(
    [i'm italian: scrivania = desktop, errore = error, uscita dalla directory = exit from directory]

  6. Werner
    April 3, 2010 at 20:43

    >sorry, i didn’t understand ‘So you don’t need the pdflib anymore.’
    >i’ll follow your instructions, thanks.

    The pdflib is used for the pdf terminal. You can still install it, like I explained in my older tutorial: http://www.miscdebris.net/blog/2008/01/23/install-gnuplot-on-ubuntu-gutsy-gibbon/

    But since there is now the pdfcairo terminal you don’t need this library anymore to get plots in pdf.

    Werner

  7. Werner
    April 3, 2010 at 20:48

    > is it a serious error? make install is a disaster ..

    Sure it is serious. Which Ubuntu version are you using? I seems to be this error: http://old.nabble.com/-Bug-49433–gcc4.4,-NEW:-gcc4.4-misses-std::endl-implementation-at–O2%2B-td22836171.html

    So if you are using gcc 4.4 (gcc –version) then this could be the reason. Could you use an older version of gcc (e.g. gcc 4.3).

    Werner

  8. maurizio
    April 3, 2010 at 21:47

    i use ubuntu 9.10.
    i give up the idea of installing gnuplot. i’m afraid downgrading GCC versions breaks the linking of a lot of C++ libraries and i NEED them for my work software (OpenFOAM, etc.). how can i remove the partial gnuplot install? is it enough to delete the gnuplot-4.4.0 and build folders on my desktop?
    thanks for your help.

  9. Werner
    April 3, 2010 at 22:02

    You actually don’t need to downgrade, usually Ubuntu provides more then one gcc version. You can install an older one and then choose one before calling cmake via

    export CC=”gcc-4.2″
    export CXX=”g++-4.2″
    cmake ….

    or similar. Anyway, as long as you didn’t run “make install” all files are in the build folder. Just delete them. If you did run “make install”, try to run “make uninstall” before you delete the build folders, this might get rid of all installed files. Alternatively run “make install” and see where the files were copied to.

  10. maurizio
    April 3, 2010 at 22:24

    ehi, wait a moment! i’m a newbie! :-D
    please, give me step-by-step instructions… could i install a lower gcc version (e.g. 4.3), coexistent with gcc 4.4, and then type (instead of the simple ‘make’ of your above instructions):
    export CC=”gcc-4.3″
    export CXX=”g++-4.3″
    cmake?
    please, how can i install gcc-4.3? i see quite a few packages (source, base, multilib…).

  11. ben
    April 9, 2010 at 08:34

    Hello, having ‘make install’ trouble also. here’s the last bit of output:

    test -z “/usr/local/usr//usr/local/texlive/2009/../texmf-local/tex/latex/gnuplot” || /bin/mkdir -p “/usr/local/usr//usr/local/texlive/2009/../texmf-local/tex/latex/gnuplot”
    /usr/bin/install -c -m 644 ../../../gnuplot-4.4.0/share/LaTeX/gnuplot.cfg ../../../gnuplot-4.4.0/share/LaTeX/gnuplot-lua-tikz.sty ‘/usr/local/usr//usr/local/texlive/2009/../texmf-local/tex/latex/gnuplot’
    make install-data-hook
    make[4]: Entering directory `/home/ben/Downloads/build/share/LaTeX’
    test -n “” || texhash
    /bin/bash: texhash: command not found
    make[4]: *** [install-data-hook] Error 127
    make[4]: Leaving directory `/home/ben/Downloads/build/share/LaTeX’
    make[3]: *** [install-data-am] Error 2
    make[3]: Leaving directory `/home/ben/Downloads/build/share/LaTeX’
    make[2]: *** [install-am] Error 2
    make[2]: Leaving directory `/home/ben/Downloads/build/share/LaTeX’
    make[1]: *** [install-recursive] Error 1
    make[1]: Leaving directory `/home/ben/Downloads/build/share’
    make: *** [install-recursive] Error 1

    Any ideas?

  12. Werner
    April 9, 2010 at 09:48

    Hi Ben. You’re missing the texhash command (“/bin/bash: texhash: command not found”). According to this page (http://ns2.canonical.com/karmic/i386/texlive-base-bin/filelist) you should install the Ubuntu package texlive-base-bin (assuming you use Ubuntu):

    sudo apt-get install texlive-base-bin

    But I assume you have that package already. Maybe uninstall and reinstall the whole tex packages. Anyway, a fast workaround would be to use the configure option “–without-tutorial” – The tutorial won’t then be built – it’s available on http://www.gnuplot.info anyway.

    HTH,
    Werner

  13. ben
    April 10, 2010 at 11:53

    Hi Werner,

    I’ve already got texhash, but I think the real problem was I needed to tell configure the tex directories. It actually tells you it isn’t very good at finding them. I’ve now got gnuplot 4.4 installed on one machine, will try the other one during the week.

    thanks for this post, made it easy for me!

    ben.

  14. seb
    April 12, 2010 at 12:08

    Thanks for your documentation. I just have two comments for clarity:

    1. Concerning “../gnuplot-4.4.0/configure –with-readline=gnu”: the character in front of with should be a “–”

    2. I need to make a sudo in front of make install: “sudo make install”

    Thanks again!

  15. Werner
    April 12, 2010 at 14:38

    Hi seb,

    thanks I improved the tutorial so it’s clear now, that we need two – in front of with-readline. Unfortunately wordpress makes one – out of two — (even in your post ;) . Also added the sudo.

    Thanks,
    Werner

  16. maurizio
    April 15, 2010 at 18:01

    hi, werner.

    i hope to not annoy you. i need your help, please.
    on april 3 i read your answer to my comment, but i’m an absolute ubuntu beginner. meanwhile i’ve been looking for documentation (i didn’t understand anything about gcc), but i can’t manage to install gnuplot.
    you said i don’t need to downgrade because i can install an older gcc version (e.g. 4.3), coexistent with gcc 4.4, am i correct?
    then you said:

    export CC=”gcc-4.2″
    export CXX=”g++-4.2″
    cmake…

    may you mean that i must type that code, between ‘configure’ and ‘make’, but why ‘cmake’ and not ‘make’, as in your tutorial?
    be patient, i’m a newbie.

    greetings,

    maurizio

  17. kat
    May 11, 2010 at 03:50

    Thank you SO much!! I spent the whole day trying to find why I could not use gnuplot, and it turned out so much better to just follow your instructions and install a newer version… Now I can get to actually do what I needed to do in the first place!
    THANKS!
    :)

  18. Dai
    June 2, 2010 at 18:51

    Great tutorial: simple and efficient. Thank you!

  19. EDM
    July 28, 2010 at 18:21

    After installing I wasn’t able to read the help files. I had to run:

    sudo chmod o+x `sudo find /usr/local/share/gnuplot/ -type d`

    in order to access them.

Leave a comment

OpenID Login

Standard Login

Options:

Size

Colors