09 March 2007

gnuplot 4.2 on ubuntu: right now!

Just a few days ago the new version of gnuplot was released. As you can read from the announce, it has been almost 3 years since release of the previous version 4.0. This new version contains a ton of new features, support for several new output devices, and improved performance. But I don't know how much I'm supposed to wait before the ubuntu guys will include this brand new version into its official repositories. Moreover, if you google for a debian package, you will find no more than the 4.0.0-5 version. So I moved to install gnuplot from sources.
   —   ∴   —   
So I took my tar-ball and unzipped it into a temporary directory:
[hronir@boltzmann:~/gnuplot-src] tar -xzvf gnuplot-4.2.0.tar.gz
[hronir@boltzmann:~/gnuplot-src] cd gnuplot-4.2.0
[hronir@boltzmann:~/gnuplot-src/gnuplot-4.2.0]
To be careful, I decided not to replace the previous instance of gnuplot, so I asked ./configure to take a home-based directory as the --prefix option:
[hronir@boltzmann:~/gnuplot-src/gnuplot-4.2.0] ./configure --prefix=$HOME/gnuplot4.2
[hronir@boltzmann:~/gnuplot-src/gnuplot-4.2.0] make
[hronir@boltzmann:~/gnuplot-src/gnuplot-4.2.0] make install
My first attempt failed just in the last step: it was saying something ending with:
/home/hronir/gnuplot-src/gnuplot-4.2.0/missing: 103: makeinfo: not found
WARNING: `makeinfo' is missing on your system. You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make' (AIX,
DU, IRIX). You might want to install the `Texinfo' package or
the `GNU make' package. Grab either from any GNU archive site.
make[1]: *** [gnuplot.info] Error 1
make[1]: Leaving directory `/home/hronir/gnuplot-src/gnuplot-4.2.0/docs'
make: *** [install-recursive] Error 1
But it really was a very small hurdle to overcome. As the warning was suggesting, I simply took the Texinfo package from my Adept Manager and at the second attempt with ./configure, make, make install I get my new-gnuplot [›››] (the only comment is that it was not only a warning, since without the Texinfo package it would not complete the installation...)
Last thing: making the new-gnuplot the default gnuplot. First check which gnuplot is your gnuplot:
[hronir@boltzmann:~] which gnuplot
and bind it to some alias of your choice, for example:
[hronir@boltzmann:~] alias gnuplot-old=`which gnuplot` 
Then bind a gnuplot alias to the new-gnuplot, which lies in the bin directory:
[hronir@boltzmann:~] alias gnuplot='$HOME/gnuplot4.2/bin/gnuplot'
and all done!
 
PS
As a matter of fact, the gnuplot-old alias is not needed. When you have an alias which overloads a pre-existing command, you can always recover the original command by pre-posing a backslash to the command itself. In this case, for example, you have:
[hronir@boltzmann:~] gnuplot --version
gnuplot 4.2 patchlevel 0
[hronir@boltzmann:~] \gnuplot --version
gnuplot 4.0 patchlevel 0
and the gnuplot-old alias is pretty useless.

8 comments:

Anonymous said...

thanks, this was quite helpful.

Pavan

hronir said...

glad to be useful!

Walter said...

It's my fifth gnuplot 4.2 install (on different machines) following your procedure, so I thought it was about time for a big THANKS! Very useful post...

(btw: ubuntu still distributes 4.0.0)

hronir said...

Thanks, Walter!

Vincent said...

What you also can do is temporarely add the following line to sources.list: deb http://nl.archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse (change to your localised archive-server, if you don't live in or near to the Netherlands).
Then start Synaptic, reload the packages, don't update system (second buttom), search for gnuplot and select to install it and all depending packages. Alltogether there should only be about 20 packages ready to be installed. If you're sure about what you did, start the installation (third button).

After all is successfull, comment out the added line in sources.list and reload the packages again.

If you pressed the "update system"-button, just quit Synaptic and try again. This could completely upgrade your system to Gutsy and that is not what you want since its alpha-state. This trick works too to get Tomcat5.5 installed without the dependency on gij!

hronir said...

Thanks, Vincent.
Then, next October with the Gutsy Gibbon, we have to compile the next 4.3-development version... :)

Will said...

Thanks for the info ... if you want to have the x11 console, you also need to have X11 development packages installed, including libx11-dev and libxt-dev. Otherwise, your freshly compiled gnuplot won't accept x11 as a terminal and you can't see any of the plots.

hronir said...

Maybe I already had such packages installed...
Thanks anyway for this info!