Install PDL

New to Perl?

No worries! If you are using Linux or Mac OS X, you should already have Perl installed. If you are a Windows user, you can use Strawberry Perl or Active Perl.

I am looking for ...



Pre-Built Binaries

My platform is ...





Source Installation

My platform is ...







Easiest install - Mac O X

Install "SciPDL-2.4.10" binary.

Easiest install - Ubuntu / Debian

apt-get install pdl pgplot5 libpgplot-perl

Easiest install - Fedora

yum install perl-PDL perl-PDL-Graphics-PLplot plplot-perl

Note: Does not include PGPLOT.

Easiest install - Gentoo Linux

Update the available list of packages by typing on a terminal as root

emerge --sync

Install the relevant PDL Gentoo packages by typing (again as root)

emerge dev-perl/PDL

Note: There is a known issue with writing 16bit PNG/PNM/PGM/PPM images.

Easiest install - Mandriva

urpmi perl-PDL

Note: Does not include PGPLOT, PLplot, OpenGL.

Easiest install - OpenSUSE

yast -i perl-PDL

Note: Does not include PGPLOT, PLplot, OpenGL.

Easiest install - Windows

To install via ppm for Strawberry Perl (32-bit only) and ActiveState Perl (32-bit and 64-bit):

ppm install Astro-FITS-Header
ppm install Convert-UU
Then install the OpenGL, PGPLOT and PDL modules from the sisyphusion repo by running: For 32-bit builds of perl (versions 5.8 and later):
ppm install http://www.sisyphusion.tk/ppm/OpenGL.ppd
ppm install http://www.sisyphusion.tk/ppm/PGPLOT.ppd
ppm install http://www.sisyphusion.tk/ppm/PDL.ppd
For 64-bit builds of perl, ppm packages are provided only for perl versions 5.10 and later. Also, there are no PGPLOT packages for these builds - so just run:
ppm install http://www.sisyphusion.tk/ppm/OpenGL.ppd
ppm install http://www.sisyphusion.tk/ppm/PDL.ppd

For more details see Installing PDL on Windows on the wiki or win32/INSTALL file in the PDL source distribution.

Source install - Windows

  1. Install Cygwin
  2. See "Installing PDL on Cygwin" on the wiki.

Source install - Ubuntu / Debian

Tested: Ubuntu 10.04 LTS (Lucid Lynx).
Tested: Debian 5.05 Stable (Lenny).

Notes:
Ubuntu users: Run these commands with sudo.
Debian users: Run these commands as root.
Required: Build system (Debian only)
apt-get install gcc make
Recommended: PGPLOT library (Debian: enable lenny/non-free and squeeze/contrib)
apt-get install libpgplot-perl
Recommended: PLplot library (Problems with Debian)
apt-get install libplplot-dev
Recommended: Improved PDL shell
apt-get install libdevel-repl-perl
cpan Devel::REPL
Recommended: Proj4 library (Debian: enable squeeze/main)
apt-get install libproj-dev
Optional: Minuit and Slatec libraries
apt-get install gfortran libextutils-f77-perl
Optional: NetPBM image utilities
apt-get install netpbm
Optional: GD image library
apt-get install libgd2-xpm-dev
Optional: GNU Scientific Library
apt-get install libgsl0-dev
Optional: FFTW library
apt-get install fftw-dev
Optional: HDF4 library (Debian: enable squeeze/main)
apt-get install libhdf4-dev
Install PDL.
cpan PDL

Note: The pgplot test opens a window and you have to close it. If the install seems to "hang", look for an open pgplot window.

Missing: NDF support.

Source install - Fedora

Tested: Fedora Core 13 & 14.

Note: You must run the following commands a root.

Required: Build environment.
yum install gcc
Recommended: 3D Graphics
yum install libXi-devel libXmu-devel freeglut-devel perl-OpenGL
Recommended: PLplot library
yum install plplot-devel
Recommended: Improved PDL shell
yum install perl-Devel-REPL perl-Term-ReadLine-Gnu
Recommended: Proj4 library
yum install proj-devel proj-nad
Optional: Minuit and Slatec libraries (you must disable SELinux).
yum install compat-gcc-34-g77 perl-ExtUtils-F77
Optional: NetPBM image utilities
yum install netpbm-progs
Optional: GD image library
yum install gd-devel
Optional: GNU Scientific Library
yum install gsl-devel
Optional: FFTW library
yum install fftw2-devel
Optional: HDF4 Library
yum install hdf-devel
Now install CPAN and then PDL
yum install perl-CPAN
cpan PDL

Missing: PGPLOT (but see below) and NDF support.

Common Problems

If you installed gfortran and ExtUtils::F77 but did not get the Slatec and Minuit libraries, try disabling SELinux (and install PDL again).

/usr/sbin/setenforce 0

## Disable SELinux at boot - set SELINUX=disabled in the config file.
vi /etc/selinux/config
PGPLOT is not distributed by Fedora as it is not free software. But if you install the RPM Fusion Non-free Yum repository (look under "Command Line Setup Using RPM" here), then you may simply run
yum install pgplot-devel
cpan PGPLOT
cpan PDL

Source install - Mandriva

Tested: Mandriva 2010 Spring.

Note: You must run the following commands a root.

Required: Build environment.
urpmi gcc make perl-devel
Recommended: PLplot
  1. urpmi cmake gcc-c++ gcc-gfortran
  2. Download the latest version from http://www.plplot.org
  3. Unpack the tar.gz file
  4. mkdir build_dir
    cd build_dir
    cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../plplot-5.9.6             
    make            
    make install 
    
Optional: Minuit and Slatec libraries
urpmi gcc-gfortran perl-ExtUtils-F77
Optional: NetPBM image utilities
urpmi netpbm
Optional: GNU Scientific Library
urpmi libgsl-devel
Optional: FFTW library
urpmi fftw2-devel
Install PDL
cpan PDL

Missing: OpenGL, PGPLOT, PDL2 shell, Proj4, GD, HDF4 and NDF support.

Common problems

Mandriva's packages for Proj4, GD and HDF4 are known to have problems with PDL. You might see an error like:

make[3]: *** [SD.o] Error 1
make[3]: Leaving directory `/root/.cpan/build/PDL-2.4.6_992-20Qukl/IO/HDF/SD'
...
make: *** [subdirs] Error 2
 CHM/PDL-2.4.6_992.tar.gz
 /usr/bin/make -- NOT OK

If this happens, you have two options:

Source install - Mac OS X

See "Installing PDL on Mac OS X" on the wiki.

Source install - CPAN (all platforms)

perl -MCPAN -e shell
cpan> install PDL

Note: Installs all of PDL that is supported by available dependencies.

Source install - Manual install (all platforms)

Download sources from SourceForge and extract.

perl Makefile.PL
make
make test
make install

Note 1: On Windows, replace 'make' with 'dmake'. If you have trouble, or want more details, visit the complete manual installation page on the wiki.

Note 2: Search CPAN as an alternate way to get the latest release and information about PDL.