Installing Demeter on Scientific Linux

The instructions on this page refer to version 5.5 of Scientific Linux

Installing Scientific Linux

I started by burning the installation DVDs from the download page. I installed this on a Lenovo ThinkPad X61 without difficulty.

At the installation step where I was asked to select sets of software for the additional tasks that I want the computer to perform (the Gnome and office productivity sets were selected by default), I clicked on "Software Development". This seems to have all the compilation tools required to install everything on this page, including Fortran and C++ compilers, many useful libraries and dev packages, and Subversion.

Once the installation finished and I rebooted, the first thing I did after logging in was to run the updater to bring the system up to date with respect to bug and security fixes.

/!\ Scientific Linux seems to be the type of linux distribution that has an explicit root account and does not encourage the use of sudo for normal maintenance. Therefore all the instructions below that require the administrator are explained using the "su -c" command. If your system is set up with a sudoers list (and you are on it), then you could sudo in every place where I suggest su -c.

The problem with Perl

Scientific Linux ships with Perl 5.8.8. This is the most WTF aspect of an otherwise solid linux distribution. This version of Perl is almost 6 years old. Getting Demeter to work with such an old version of Perl does not seem like a good use of my time, so I downloaded the latest version (5.12.1 at the time of this writing) and installed that, which can be found at perl.org.

Unpack the tarball, cd into the new directory, and do the following:

./Configure -d
make
su -c 'make install'

This is a somewhat lengthy build, but it finished without any trouble on my computer. If you are the cautious sort, you can do make test before installing. The tests are almost as lengthy as the compilation.

This will place the new Perl executable in /usr/local/bin. On my computer this seems to be in the PATH before /usr/bin, so it will come up first at the command line. Still, remember this -- it becomes relevant later on.

Other things to install before starting on Bruce's and Matt's software

Gnuplot

This is not strictly necessary, however I much prefer the Gnuplot plotting backend to PGPLOT. Much prettier plots.

There is package available from the SL package manager for Gnuplot 4.2. I tried using that package, but it is a disaster. There are several aspects that are quite broken and that not only do not work with Demeter, but would surprise anyone who has ever used Gnuplot. Don't bother. It is much better to install from source.

The source tarball can be found here: http://sourceforge.net/projects/gnuplot/files/

Download, unpack, cd into the new directory and do:

./configure
make
su -c 'make install'

This will install a working version of Gnuplot 4.4 with the X11 terminal. Unfortunately, you don't seem to be able to compile the awesome Wxt terminal with a fresh install of Scientific Linux. I couldn't find the Wx development tools in the package manager. If anyone has some advice on how to do this, please let us know. Demeter + Gnuplot + the Wxt terminal is a great combination.

On to Ifeffit

Here is the latest Ifeffit tarball: http://cars9.uchicago.edu/~ifeffit/src/ifeffit-1.2.11d.tar.gz . Download, unpack, cd in the new directory.

PGPLOT

Installing PGPLOT by hand is a serious pain in the ass. Fortunately, Matt wrote a handy script for automating this. Just do:

su -c './PGPLOT_install'

Apparently, appropriate libraries for png, gif, and jpg output were already on the system.

Ifeffit

This step also should be easy. Just do:

./configure
make
su -c 'make install'

Again, it seems that a suitable ncurses library is already on the system.

Finally, Demeter!

First download a copy of the source code:

git clone git@github.com:bruceravel/demeter.git

Dependencies

Next, start the build process and install all of the dependencies:

perl Build.PL
su -c './Build installdeps'

A few comments on the dependencies step:

  1. The su -c './Build installdeps' step is quite long. It took about a half and hour on my computer. Demeter has lots of dependencies and the Wx interface requires a lengthy compilation. However everything ran without incident and installed correctly on my computer.

  2. When starting, you will be asked about optional dependencies. These all are associated with various user interface aspects of Demeter. For full functionality, you should install them all.
  3. Some of the modules will ask you yes/no questions. "Yes" is the right answer for all of them, except for the question about the tests associated with the Term::Twiddle module. These tests are annoying and very interactive. I always skip them.

Building and installing Demeter

Once the dependencies are installed, do this:

./Build
./Build test
su -c './Build install'

Don't skip the tests. If they fail, I need to know about it. Cut-n-paste what it says on the screen into an email.

Failed tests will also indicate if any of the dependencies got skipped for some reason.

Further testing

In the examples/ directory, try running the plot and harness scripts. These are interactive test scripts that exercise various parts of Demeter and make plots for you to examine. Try running them with the -g flag to use the Gnuplot plotting backend rather than PGPLOT.

However ... remember how I pointed out that perl 5.12.1 will be installed in /usr/local/bin rather than /usr/bin. Well, the plot and harness scripts, as well as every other executable script in and under the examples/ directory has /usr/bin/perl in the #! line. So running plot as ./plot will invoke the perl 5.8.8 that was originally installed. Of course, running plot as perl plot will work, as the shell will choose the perl in /usr/local/bin.

In the main directory of the Demeter source code is a script called fixin that can be used to fix the #! lines of scripts. You will want to first use it on itself as

perl fixin fixin 

Another solution to this problem is to rm /usr/bin/perl (which is just a hardlink to /usr/bin/perl5.8.8, so removing it is fairly benign) and make a symlink to the one in /usr/local/bin:

su -c 'rm /usr/bin/perl'
su -c 'ln -s /usr/local/bin/perl /usr/bin/perl'

Also check out the things under recipes/. You will find there many examples of using Demeter for real problems.

Coexisting with the old versions of Hephaestus, Atoms, and Artemis

All of the executable scripts that will get installed into your path have the letter "d" at the beginning of their names, dartemis, dhephaestus and so on. This allows the old and new versions of artemis et al. to coexist. Once I retire the old versions, the "d" will be removed.

By the way, "dartemis" is pronounced "ar-tee'-mis", with a silent "d" :D

Making this easier for the next guy

Carlo Segre has the right idea for Debian-based systems. He maintains packages for my software and for any dependencies that are not already on the standard servers. Someone needs to do the same for rpm-based systems.

Demeter/ScientificLinux (last edited 2011-03-25 13:34:41 by BruceRavel)