Thursday, May 19, 2011

Installing PDL

The PDL wiki has an instruction set to install PDL from CPAN, however I find it is missing a few things so here are my instructions (also my instructions use CPAN when possible):

Step 0) If installing over SSH (if not go to Step 1)

If you are installing over an SSH shell be sure you used the -X (and/or the -Y) flag when connecting (ssh -X host.name.etc). Then execute

export LIBGL_ALWAYS_INDIRECT=y

to allow OpenGL to work correctly.

Step 1) Install system packages


sudo apt-get install libxi-dev \
libxmu-dev freeglut3-dev libgsl0-dev \
libnetpbm10-dev libplplot-dev \
pgplot5 build-essential gfortran


Step 2) Install Perl modules

I use cpanm, one may also use cpan, but it makes you hit 'y' many more times


cpanm Term::ReadLine::Perl Inline Astro::FITS::Header ExtUtils::F77
cpanm -v PGPLOT OpenGL
cpanm -v PDL


I like to use the -v on the graphical modules and PDL because they have tests where it helps to read the output that cpanm suppresses. If you don't need that, you may omit the -v.

Also if it seems that any of those hang, try hitting the enter key to continue. Some of the plotting tests require you click around, do so, sometimes hitting the right mouse button as well. You may need to close the PGPLOT server window at some point as well (black window that doesn't seem like its doing anything).

Step 3) Test the tricky modules


perl -e '
use PDL;
use PDL::Graphics::PGPLOT;
use PDL::Graphics::TriD;
print "success\n"'

1 comment:

venkat said...

Hi, Thanks for the post. It is easy to install, bu tI got following output(Error)
while installing. What must be the reason for this?

Test Summary Report
-------------------
t/cmdline-LIBS-INC.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/custom-function.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/dash-l-libs.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/found.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/headers.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
Files=10, Tests=16, 1 wallclock secs ( 0.04 usr 0.00 sys + 0.46 cusr 0.15 csys = 0.65 CPU)
Result: FAIL
Failed 5/10 test programs. 0/16 subtests failed.
make: *** [test_dynamic] Error 255
FAIL
! Installing Devel::CheckLib failed. See /home/user/.cpanm/build.log for details.
! Bailing out the installation for PDL-2.007. Retry with --prompt or --force.

Thanks,
Venkat