Debian Codegraph @

HELP

raw
1
2 List of various gotchas!
3 ------------------------
4
5 Last Change: Jan 3rd, 2006.
6
7 Karl Glazebrook.
8
9 ExtUtils::F77
10 -------------
11
12 This module requires installation of ExtUtils::F77 to compile. The
13 latest version is v1.13 so you probably better get that from
14 CPAN (www.cpan.org)
15
16 Non-standard PATHs
17 ------------------
18
19 If your PGPLOT, X11, etc. libs are located in non-standard places you may use the
20 following command line command line options to "perl Makefile.PL" which take comma
21 separated lists of values. The possible options are:
22
23 * XDIR: The directories to search for X11 libraries (without the
24 -L)
25 * XLIB: The X11 libraries to link (without the -l
26 * IDIR: The PGPLOT include directory
27 * LDIR: The PGPLOT library directory
28 * EXLIB: extra libraries to link (in my case it's png,z)
29 * EXDIR: Library directories for the extra libraries
30
31
32 perl5.004_?? problem
33 --------------------
34
35 If you type 'make' and see an error message like:
36
37
38 /usr/bin/perl -I/usr/lib/perl5/i586-linux/5.00404 -I/usr/lib/perl5
39 /usr/lib/perl5/ExtUtils/xsubpp -typemap /usr/lib/perl5/ExtUtils/typemap -typemap typemap
40 PGPLOT.xs >PGPLOT.tc && mv PGPLOT.tc PGPLOT.c
41 make: *** [PGPLOT.c] Error 139
42
43 (sometimes with a segmentation violation or bus error)
44
45 Then you have encountered a bug in perl versions 5.004_01 and later (5.004
46 itself works just fine). The generation of PGPLOT.c from PGPLOT.xs fails
47 because of a bug in xsubpp to do with handling of line numbers (of all
48 things).
49
50 This has been reported and ought to be fixed. Meanwhile here is
51 a workaround:
52
53 Edit the 'Makefile' which has been generated by the 'perl Makefile.PL ...'
54 command and add the '-nolinenumbers' option to the xsubpp call. The
55 line should look something like:
56
57 XSUBPPARGS = -nolinenumbers -typemap $(XSUBPPDIR)/typemap -typemap typemap
58
59 Then type 'make' again and everything should work.
60
61
62 Common Problems and Possible Solutions
63 --------------------------------------
64
65 *** First check the HINTS.* files for OS-specific problems. ***
66
67 If you have libpgplot set up following the recommended defaults and the
68 Makefile.PL recognises your system then Perl/PGPLOT should build out of the
69 box. If you don't you may experience problems. Read on for possible
70 fixes. Patches for ExtUtils::F77, to make it even smarter, are very
71 welcome!
72
73 o Check the -lX11 you are linking with is the same one that libpgplot
74 was built against! This can cause the module to die with a very
75 unhelpful error. Use -L/dir to fix this.
76
77 o If 'make test' does not work try 'perl -Mblib test.pl'. Sometimes
78 one can get funny dynamic loading problem. [The former sets
79 PERL_DL_NONLAZY=1 which makes it fail on any unresolved symbol.
80 Sometimes this is wrong.]
81
82 If 'perl -Mblib test.pl' produces sensible graphs it is probably
83 safe to do a 'make install'.
84
85 o Next make sure you can compile, link and run successfully PGPLOT
86 C programs (e.g. 'cpgdemo' in the PGPLOT distribution). If not you
87 will not be able to run the perl version. A common requirement is
88 to set the environment variable PGPLOT_DIR if PGPLOT is installed
89 in a non-standard location.
90
91 o You may experience problems if the module does not 'know' about
92 the FORTRAN/C interface on your architecture. Please contact me and I
93 will try to help if I have time. Alternatively - install GNU-77! (You
94 gnu it makes sense...) and edit 'Makefile.PL' to select GNU-77 (this
95 is the default on Linux, etc. anyway).
96
97 o If you are using f2c based Fortran compilers (e.g. g77 or f2c) then
98 it is possible that it is not picking this fact up. [e.g. on systems
99 where the default f77 is something else like Solaris. Note is is SUPPOSED
100 to figure this out. :-)]. In such cases try editing the line:
101
102 use ExtUtils::F77;
103
104 to become:
105
106 use ExtUtils::F77 qw(generic g77);
107
108 o Make sure when you build the pgplot library you did a 'make cpg' to
109 create the C library and the cpgplot.h header file.
110
111 o See if you can compile and run the C program cpgdemo.c which comes
112 with the pgplot library itself - 'make cpg' in the pgplot build sequence.
113 If this fails there is no way the PGPLOT module will work.
114
115 o Check Perl normal dynamic loading works, try:
116
117 perl -e 'use Socket'
118
119 and see if there are any errors. If you contact me I can supply a
120 simple test module.
121
122 o Using Linux and G77, you might need to ensure that libf2c.a is present
123 in the normal library search path. You might also need to add ' -lgcc'
124 after the fortran runtime library in Makefile.PL
125
126 o If using G77 check the library /usr/lib/libf2c.a is the one that came
127 with g77 and not an older one that comes with F2C. Check also that is is not picking up
128 an older shared library (e.g. /usr/lib/libf2c.so) that does not
129 correspond to the current libf2c.a. The g77 one should be a link to libg77, e.g.:
130
131 lrwxrwxrwx 1 root root 42 Aug 28 16:17 /usr/lib/libf2c.a ->
132 /usr/lib/gcc-lib/i486-linux/2.7.2/libg77.a
133
134 o Check the cc compiler you used to build cpgplot is the same one
135 you used to build Perl (this is the one invoked by Makefile.PL)
136
137 o Using the PGPLOT module with a dynamically loaded libpgplot
138 library on some UNIX systems CAN be problematic (many confusing
139 possibilites of -L/-R/LD_LIBRARY_PATH/LD_RUN_PATH exist). Commonly
140 the module builds with no errors but fails to plot anything. You can
141 maybe fix this by ensuring the pgplot libraries are linked in to
142 /usr/local/lib/ (as per the pgplot install instructions) or
143 alternatively playing with LD_LIBRARY_PATH. If this fails try
144 deleting the libpgplot.so* or libpgplot.sl* shareable library (or at
145 least move it to /tmp!). Alternatively, if you don't have system
146 priviledge, try this dirty hack:
147
148 mkdir pgplot_tmp
149 cp /usr/local/pgplot/lib*pgplot.a pgplot_tmp
150 ranlib pgplot_tmp/*
151
152 (don't worry if the 'ranlib' command gives an error - many UNIX
153 systems don't have or need it.)
154
155 Now start from the top again. The Makefile.PL will automatically
156 detect 'pgplot_tmp' and link in these files statically.
157
158 o Finally, if you mail me for help include in your message the complete log
159 output of:
160
161 perl -V; perl Makefile.PL; make; make test
162
163
164 Architecture-Specific Problems/Tips
165 -----------------------------------
166
167 HP systems - Try using c89 with HP's fort77 compiler rather than gcc.
168 (e.g. if you get a message about not being able to resolve symbol
169 '__main__')
170
171 DEC Alphas - are suceptible to the LD_LIBRARY_PATH problems mentioned
172 above.
173
174
175 RedHat 5.2 is reported to work with the following RPMs for C and FORTRAN :-
176 egcs-c++-1.0.3a-1
177 egcs-1.0.3a-1
178 egcs-objc-1.0.3a-1
179 egcs-g77-1.0.3a-1
180 f2c-19970805-3
181