
List of various gotchas!
------------------------

Last Change: May 15th, 1998.

Karl Glazebrook.


perl5.004_?? problem
--------------------

If you type 'make' and see an error message like:


  /usr/bin/perl -I/usr/lib/perl5/i586-linux/5.00404 -I/usr/lib/perl5
  /usr/lib/perl5/ExtUtils/xsubpp  -typemap /usr/lib/perl5/ExtUtils/typemap -typemap typemap
  PGPLOT.xs >PGPLOT.tc && mv PGPLOT.tc PGPLOT.c
  make: *** [PGPLOT.c] Error 139
  
  (sometimes with a segmentation violation or bus error)
  
Then you have encountered a bug in perl versions 5.004_01 and later (5.004
itself works just fine). The generation of PGPLOT.c from PGPLOT.xs fails
because of a bug in xsubpp to do with handling of line numbers (of all
things).

This has been reported and ought to be fixed. Meanwhile here is
a workaround:

  Edit the 'Makefile' which has been generated by the 'perl Makefile.PL ...'
  command and add the '-nolinenumbers' option to the xsubpp call. The
  line should look something like:
  
  XSUBPPARGS = -nolinenumbers -typemap $(XSUBPPDIR)/typemap -typemap typemap
  
Then type 'make' again and everything should work.


Common Problems and Possible Solutions
--------------------------------------

If you have libpgplot set up following the recommended defaults and the
Makefile.PL recognises your system then Perl/PGPLOT should build out of the
box. If you don't you may experience problems. Read on for possible
fixes. Patches for ExtUtils::F77, to make it even smarter, are very
welcome!

o You may experience problems if the module does not 'know' about
  the FORTRAN/C interface on your architecture. Please contact me and I
  will try to help if I have time. Alternatively - install GNU-77! (You
  gnu it makes sense...) and edit 'Makefile.PL' to select GNU-77 (this
  is the default on Linux, etc. anyway).

o If you are using f2c based Fortran compilers (e.g. g77 or f2c) then
  it is possible that it is not picking this fact up. [e.g. on systems
  where the default f77 is something else like Solaris. Note is is SUPPOSED
  to figure this out. :-)]. In such cases try editing the line:
  
  use ExtUtils::F77;
  
  to become:
  
  use ExtUtils::F77 qw(generic g77);

o Make sure when you build the pgplot library you did a 'make cpg' to
  create the C library and the cpgplot.h header file.

o See if you can compile and run the C program cpgdemo.c which comes
  with the pgplot library itself - 'make cpg' in the pgplot build sequence.
  If this fails there is no way the PGPLOT module will work.

o Check Perl normal dynamic loading works, try: 

  perl -e 'use Socket'

  and see if there are any errors. If you contact me I can supply a
  simple test module.
  
o Using Linux and G77, you might need to ensure that libf2c.a is present
  in the normal library search path. You might also need to add ' -lgcc'
  after the fortran runtime library in Makefile.PL

o If using G77 check the library /usr/lib/libf2c.a is the one that came
  with g77 and not an older one that comes with F2C. Check also that is is not picking up
  an older shared library (e.g. /usr/lib/libf2c.so) that does not
  correspond to the current libf2c.a. The g77 one should be a link to libg77, e.g.:
  
  lrwxrwxrwx   1 root     root           42 Aug 28 16:17 /usr/lib/libf2c.a -> 
  /usr/lib/gcc-lib/i486-linux/2.7.2/libg77.a

o Check the cc compiler you used to build cpgplot is the same one
  you used to build Perl (this is the one invoked by Makefile.PL)

o Using the PGPLOT module with a dynamically loaded libpgplot
  library on some UNIX systems CAN be problematic (many confusing
  possibilites of -L/-R/LD_LIBRARY_PATH/LD_RUN_PATH exist). Commonly
  the module builds with no errors but fails to plot anything. You can
  maybe fix this by ensuring the pgplot libraries are linked in to
  /usr/local/lib/ (as per the pgplot install instructions) or
  alternatively playing with LD_LIBRARY_PATH. If this fails try
  deleting the libpgplot.so* or libpgplot.sl* shareable library (or at
  least move it to /tmp!). Alternatively, if you don't have system
  priviledge, try this dirty hack:

  mkdir pgplot_tmp
  cp /usr/local/pgplot/lib*pgplot.a pgplot_tmp
  ranlib pgplot_tmp/*

  (don't worry if the 'ranlib' command gives an error - many UNIX
   systems don't have or need it.)

  Now start from the top again. The Makefile.PL will automatically
  detect 'pgplot_tmp' and link in these files statically.

o Finally, if you mail me for help include in your message the complete log 
  output of:

  perl -V; perl Makefile.PL; make; make test
  

Architecture-Specific Problems/Tips
-----------------------------------

HP systems - Try using c89 with HP's fort77 compiler rather than gcc. 
(e.g. if you get a message about not being able to resolve symbol 
'__main__')

DEC Alphas - are suceptible to the LD_LIBRARY_PATH problems mentioned
above.
