How to download source code for the development version of gnuplot

Source code for the development version of gnuplot is kept on SourceForge. However, the best way to get the complete set of source is to install the cvs tools on your own machine and use them to access the SourceForge site.

Creating a copy of the CVS source tree on your local machine

This will create a subdirectory named ./gnuplot, and copy the cvs source tree into it.
csh version
setenv CVS_RSH ssh
setenv CVSROOT ''
cvs login
        (hit <cr> - no password needed for anonymous)
cvs -z3 checkout gnuplot

bash version
export CVS_RSH=ssh
cvs login

cvs -z3 checkout gnuplot

If you just want to build the current version without patching

If you don't have any patches to apply, at this point you can build the current CVS version using the following sequence of commands:
cd ./gnuplot
If you want to explore the possible configuration options, you can get a list by typing
./configure --help
By default the CVS version has all options turned on, but you might want to specify some particular prefered external libraries. The only extra option I use myself is:
./configure --with-readline=gnu

Applying the patches

Download the patches you want. I will assume you are getting patches from this site, but you may also want to look at the much longer list of submitted patches at SourceForge. I recommend renaming your local copy of the source directory before patching, so that later on you can update your copy of the CVS source without overwriting or colliding with your local patched copy. To apply the patches and reconfigure the patched source for your local setup:
mv ./gnuplot ./gnuplot-patched
cd ./gnuplot-patched
patch -p1 < ../patch1.patch
patch -p1 < ../patch2.patch
./configure --help      (to see the configuration options)
./configure --enable-datastrings --enable-histograms
The downloaded patches are not always a perfect match to the current CVS code, because the code keeps getting updated (that's the whole point!). So you may see warning messages from the patch commands. You can ignore most of these, but if you see messages like:
2 out of 5 hunks FAILED -- saving rejects to file src/unset.c.rej
then you have a problem and will have to fix this particular file by hand. If you want to test patch compatibility before actually applying it, you can use the command
patch -p1 --dry-run < ../patch1.patch

Ethan A Merritt
15 Feb 2005