Skip to content

Installing PDL on Cygwin

Zakariyya Mughal edited this page Jan 5, 2015 · 2 revisions

TOC

General Notes

Please post to the perldl mailing list for help or questions regarding a Cygwin install.

Cygwin seems to have a roughly 300MB process memory limit that we have not determined how to work around. If you work with large data sets, you may wish to use the native win32 PDL with either ActiveState Perl or Strawberry Perl.

Work is underway to improve the native win32 perl PDL support for external dependencies so that it may be used, feature for feature, instead of the cygwin port.

Installing with CPAN on Cygwin

If you already have a full cygwin install on your PC, the simplest way to get a basic PDL is to use the cpan shell.

This will get you all the functionality that is supported by existing cygwin package functionality (i.e. available from the standard Setup.exe installs).

NOTE: you will be asked to answer some configuration questions the first time you use cpan on your system. Most should be self-explanatory.

Just start up an xterm and run cpan from the bash prompt:

 bash$ cpan
 cpan> install ExtUtils::F77
 cpan> install OpenGL
 cpan> install PDL

This installs the Perl OpenGL (a.k.a POGL) module, ExtUtils::F77, and should pull in installs for the following dependencies:

 Astro::FITS::Header
 Convert::UU
 Data::Dumper
 File::Spec
 Filter::Util::Call
 Text::Balanced
 Inline

if they are not already installed or of a recent enough version. This should finish with a PDL having the following functionality:

 - base PDL modules
 
 - PDL::IO::GD
 - PDL::GIS::Proj
 - PDL::Graphics::TriD
 - PDL::GSL::*
 - PDL::Slatec
 - PDL::Transform::Proj4

Manual Configuration and Install

In general, the standard install process for perl modules should work on Cygwin. If you don't want to accept the default build options for PDL, edit the perldl.conf file. You'll find that file in the top level PDL folder/directory.

The remaining PDL functionality depends on external libraries and packages that must be pre-installed before installing PDL.

If you want to use other modules with external dependencies not available through the Setup.exe from http://www.cygwin.com then you'll need to get, build, and install the desired libraries yourself (see the per-library notes below).

The manual configure/build/install process is:

  • Edit the PDL/perldl.conf file as desired

  • From the bash$ prompt in the top level PDL/ directory:

    perl Makefile.PL # configures all the Makefile make # builds/compiles everything make test # run test suite make doctest # builds online documentation # and html docs

  • If any tests fail (rather than skipped) you can run them by hand for more detailed diagnostic messages. For example:

    perl -Mblib t/plplot.t 1..27 ok 1 - use PDL::Graphics::PLplot;

    Looks like you planned 27 tests but only ran 1.

    perl -Mblib t/proj_transform.t 1..4

    Looks like your test died before it could output anything.

    These test failures with the number of planned tests not equal to the number of tests run (1) or if a test died before it could output anything indicate a problem with the DLL base addresses. See the instructions for REBASEALL below.

  • If PDL built ok and passed tests, you can test the interactive PDL shell before actually installing PDL by running from the PDL/ top level directory:

    perl -Mblib Perldl2/pdl2 # type quit to exit the PDL shell

  • To finally install the PDL into your system run:

    make install

FFTW

You'll need to build version 2 of the FFTW library for PDL. Version 3 has a new API and is not compatible with this PDL.

 # download the source code if needed, I used wget
 wget http://www.fftw.org/fftw-2.1.5.tar.gz


 # extract the source files
 tar xzf fftw-2.1.5.tar.gz 


 # change to the source directory
 cd fftw-2.1.5/


 # this is the standard GNU build process
 ./configure 
 make
 make check
 make install

The FFTW library built without a hitch and installed in /usr/local as the default (/usr/local/lib, /usr/local/include, and /usr/local/info). A clean build of PDL should pick it up.

NOTE: If problems see rebaseall below.

PGPLOT

NOTE: cygwin 1.7.5 has new include locations so the following will not work without changing the various paths!

1. Build the pgplot library and install.

 Download from http://astro.caltech.edu/~tjp/pgplot


 # Extract the archive file into a source location, I used ~/
 $ tar xzf pgplot5.2.tar.gz 
 $ cd ~/pgplot


 # Make an install directory, this is a typical default location
 $ mkdir /usr/local/pgplot


 $ cp drivers.list /usr/local/pgplot/
 $ cd /usr/local/pgplot
 $ vi drivers.list 
 
 Edit drivers.list to enable the drivers you wish but
 uncommenting desired drivers by removing the leading ! on the
 line. Here are the ones I used (see PDL/cygwin/driver.list):


 $ grep -v '^!' drivers.list
   LXDRIV 0 /LATEX     LaTeX picture environment
   NUDRIV 0 /NULL      Null device (no output)                           Std F77
   PPDRIV 1 /PPM       Portable Pixel Map file, landscape
   PPDRIV 2 /VPPM      Portable PIxel Map file, portrait
   PSDRIV 1 /PS        PostScript printers, monochrome, landscape        Std F77
   PSDRIV 2 /VPS       Postscript printers, monochrome, portrait         Std F77
   PSDRIV 3 /CPS       PostScript printers, color, landscape             Std F77
   PSDRIV 4 /VCPS      PostScript printers, color, portrait              Std F77
   TTDRIV 5 /XTERM     XTERM Tektronix terminal emulator                 Std F77
   WDDRIV 1 /WD        X Window dump file, landscape
   WDDRIV 2 /VWD       X Window dump file, portrait
   XWDRIV 1 /XWINDOW   Workstations running X Window System              C
   XWDRIV 2 /XSERVE    Persistent window on X Window System              C
 
 Edit the sys_cygwin configuration file to work with the
 current version of cygwin. (TBD, update this file and pass on
 to pgplot distribution for inclusion, for now see
 PDL/cygwin/g77_gcc.conf)


 $ vi sys_cygwin/g77_gcc.conf 


 # This diff command shows the lines that need changing
 $ diff g77_gcc.conf*
 12c12
 perldl.conf file).  If your pgplot installation worked, it should be picked up automatically.

NOTE: If problems see rebaseall below.

rebaseall

There is a known issue on Cygwin where DLLs have to have their base addresses fixed so that runtime conflicts do not occur. The problems occur for the external modules and their interfaces using DLLs. Specifically, the DLLs in /usr/lib/perl5 and the DLLs in the PLplot bin directory at least. The usual sign for this is that some tests fail mysteriously. If you run the failing test by hand (for example):

 perl -Mblib t/plplot.t

You may see no error but only 1 test run or even a message saying that the test failed before generating any output. If so, you'll need to run rebaseall:

 0. Generate a list of additional DLLs to check:
    
    find /usr/lib/perl5 /usr/bin /usr/local /pdl_build_dir/blib -iname '*.dll' > /bin/fixit.list


 1. Exit all cygwin processes, windows, shells, X server,...


 2. Start up a windows CMD shell window (Start->Run cmd)


 3. cd to the cygwin /bin directory (cd c:\cygwin\bin by default)


 4. Run ash in that directory (ash)


 5. Run rebaseall (./rebaseall -T fixit.list)


      Note that we created the fixit.list file in the c:\cygwin\bin
      folder to begin with.  If you put it elsewhere, you'll need
      to use the appropriate pathnames.

After the rebaseall command has completed, you should be able to start up X windows and rerun the failed tests (perl -Mblib t/testname.t) or all tests (make test).

PLplot

TBD

HDF

TBD

Clone this wiki locally