Friday, October 26, 2007

pdl and perl and pgplot5 and dh-install-perl

To use PDL the perl data language with graphics, you need to

1) install pgplot5 the plotting package ( Fortran! amazing)
which is located in debian non-free.

apt-get install pgplot5

2) install PGPLOT, the cpan module for working with pgplot5
it is currently not in Debian (it fell out a while ago... :( ).

Thus you need to download the PGPLOT module
from CPAN.

But we want a debian package for it!
It will be called libpgplot-perl_2.20-1_amd64.deb


apt-get install dh-install-perl

this will enable us to make a debian package for PGPLOT

then create a directory to work in

mkdir libperl-pgplot
cd libperl-pg-plot
dh-install-perl --cpan PGPLOT
dh-install-perl --build PGPLOT-2.20
dpkg -i libpgplot-perl_2.20-1_amd64.deb

Of course you will have gotchas along the way :)

When dh-install-perl makes an error in the build,
say because you are missing say g77 or

so you have to delete the debian created directory
rm -rf PGPLOT-2.20/debian
so that you can recompile the binaries.
then you run
dh-install-perl --build PGPLOT-2.20

Of course you could just do
dh-install-perl --install --cpan PGPLOT
which should do it all, but is fun to do it step by step.

No comments: