arthurz (4) [Avatar] Offline
#1
I am on Ubuntu 14.04. I downloaded the Release version 5 of GNUPlot and ran INSTALL. It fails.
Mainly, it is due to INSTALL errors (some excerpt below).
I am able to install GNUPlot 4.6 from Ubuntu Software Centre.

End of the INSTALL process text:

./INSTALL: line 318: wxt: command not found
./INSTALL: line 320: Cairo: command not found
./INSTALL: line 320: pango: command not found
./INSTALL: command substitution: line 321: syntax error near unexpected token `('
./INSTALL: command substitution: line 321: ` I recommend using MacPorts building universal (i386 libraries):'
./INSTALL: line 277: o: command not found
./INSTALL: line 279: To: command not found
./INSTALL: line 280: add: command not found
./INSTALL: line 281: To: command not found
./INSTALL: line 282: check: command not found
./INSTALL: line 283: syntax error near unexpected token `('
./INSTALL: line 283: ` file and any necessary macros (__ALPHA__, GNUC, or VAXC)'

Researched further, at ./compile stage found error: mv -f $depbase.Tpo $depbase.Poalloc.c:112:1: fatal error: opening dependency file .deps/alloc.Tpo: Permission denied
philipp.janert (286) [Avatar] Offline
#2
To build gnuplot from source, you need to have the DEVELOPMENT versions of the required libraries installed on your system. The messages that you have observed list the wxt, pango, cairo libaries as missing. In your package management system, you can recognize the development versions, because they usually have a "-dev" appended to their name.

Moreover, you say you "ran INSTALL". I am not sure I understand; I am not familiar with an "INSTALL" script. Generally, building from source is a three step process:
./configure
make
make install

More information is in the INSTALL file in the top-level directory of the distribution. (In particular, for best results, you should look through the options to ./configure.)

I am sorry if this sounds tedious, but building any non-trivial program from source is, well, non-trivial. Now that that Gnuplot 5.0 has officially been released however, the major Linux distributions will begin shipping pre-built versions in their upcoming versions (if they haven't already).
arthurz (4) [Avatar] Offline
#3
Yes, I did ./configure ; make and then make install
It seems yes, you must be right, I do not have these libs I deem.
Now the question is how to get them?

Well, what I observe with Ubuntu the updates sometimes are a year behind.
philipp.janert (286) [Avatar] Offline
#4
Go to your favorite Ubuntu package manager and search for wxt, pango, cairo. The missing libraries should be easy to find. Install them, and try again.

By the way, it is absolutely normal that you don't have the -dev versions installed. Unless you are actively building (not using!) software against them, there is no reason to have them on your system.

One hint: make sure you check the output from ./configure. If it can't find some of those libraries, even AFTER you installed them, this will give you diagnostics. And then you need to tweak the options to ./configure with the locations. But give it a whirl first - maybe it "just works".
mhalver (35) [Avatar] Offline
#5
I was able to get it to work and this StackOverflow post was very helpful to me in finding out which libraries I needed

http://stackoverflow.com/questions/29526044/installing-gnuplot-5-0-on-ubuntu

I had to install libwxgtk2.8-dev, libgtk2.0-dev, libgd-dev, libqt4-dev, and libcaca-dev. I apparently already had libx11-dev, libcairo2-dev, libpango1-dev, and possibly libreadline-dev, although I am not sure why I had those - one of these, I think it is libpango1-dev uses 1.0 instead of 1 on Ubuntu. Apparently Ubuntu Trusty does not have libcerf-dev. I didn't mess with the lua terminal, as I really don't know what it does (I only installed libcaca-dev because my windows version of gnuplot has it, but I don't know what that terminal does either). I had problems with compiling with qt5 so I used version 4 there.

After that I ran ./configure (I had to supply an option for that caca terminal but I don't remember off hand what it was) followed by make. Configure will detect most of the libraries, so you don't need to supply any options except for the one terminal I noted. After this I ran make check which verifies that it works (you need to be logged into your desktop for this to work) - you don't need this check, but it tells you that it works. Finally run sudo make install (if you follow the instructions for installing only for a single user, you don't need to use sudo, but you need to use it if you are installing for all users.

I think that I had to do --enable-stats or whatever the flag was (./configure --help will list all options) but I'm not sure if I needed that or if that is the default.
philipp.janert (286) [Avatar] Offline
#6
Thanks for all the detail, very helpful.

I am not surprised that you did not find libcerf, as this is a rather specialized (and optional) math library.
Lua is only required for the lua/tikz terminal, which is a particular Latex-based terminal.

I also think that the stats-command is enabled by default now.

mhalver (35) [Avatar] Offline
#7
It looks like libcerf-dev is available in Ubuntu Vivid but not before that. Of course, Vivid includes gnuplot5 as well, so it eliminates the need to compile from source unless some specific configuration is needed. Looking at the functions that the library includes, I'm not sure that I'd ever need them. In fact, I can't think of hand of a single way that I'd use any of them, and my background is in analysis, the branch of mathematics that they actually come from. Now, I'd love to see some more statistical distributions added (particularly the student-t distribution).

Hopefully what I posted above will help anyone else trying to build from source including the original poster. Once those libraries were in place, it worked pretty smoothly.
philipp.janert (286) [Avatar] Offline
#8
If you are looking for statistical distributions, you might want to check out
the file "stat.inc", which can be found in the "demo" folder of your gnuplot
installation. You will need to load it into your session using "load" first. It
includes a large number of probability density and their cumulative distribution
functions (including Student's t).
mhalver (35) [Avatar] Offline
#9
A couple more notes that hopefully will be helpful.

I wanted my Ubuntu installation to match my windows installation (which is from one of the precompiled zips), which means that I would need libcerf (even though I don't think that I will be using it) and the lua terminal (which I don't expect to need either).

To get the lua terminal, I installed liblua5.1-dev which was detected by configure with no further action on my part. The link that I listed above says to use 5.2 and read INSTALL which says that a symlink will need to be created for it to work. For some reason that still didn't work, but reading the output of the configuration script, I saw that it autodetects version 5.1, and using that works.

To get libcerf (under Ubuntu Trusty - this is available from the Ubuntu Vivid packages, thus this step is not needed), I had to download it and install from source. The libcerf homepage is at http://apps.jcns.fz-juelich.de/doku/sc/libcerf and it gives a download link for the source there. To make this work, create a working directory, move into it and give the commands:

wget http://apps.jcns.fz-juelich.de/src/libcerf/libcerf-1.4.tgz
tar zxvf libcerf-1.4.tgz
cd libcerf-1.4
./configure
make
make check
sudo make install

Note that current version is apparently 1.4. Some of those commands will change if the version changes. With this installed, the gnuplot build process autodetects libcerf and sets it up correctly.