nickschurch has asked for the wisdom of the Perl Monks concerning the following question:

Your monkinesses, please help me with a PGPLOT.pm install issue.

Below is the output from 'perl Makefile.PL' command, followed by the output from the make, and make test commands. I have the latest pgplot libraries installed, including the corrections for 64-bit architecture and the c-wrapper. All the demos run fine so this seems to be working.

My LD_LIBRARY_PATH env variable is set and includes the standard paths and the path for the pgplot libraries. MY PGPLOT_DIR env variable is also set... I am confused... :-s

---------------------------------- [njs@localhost ~/PGPLOT-2.20]$ perl Makefile.PL XDIR=/usr/lib64 ExtUtils::F77: Version 1.16 Loaded ExtUtils::F77 version 1.16 Found compiler g77 Found compiler gfortran ExtUtils::F77: Using system=Linux compiler=GFortran Runtime: -L/usr/lib/gcc/x86_64-redhat-linux/4.1.1 -L/usr/lib -lgfortra +n -lm -L/usr/lib/gcc/x86_64-redhat-linux/4.1.1 -lgcc ExtUtils::F77: Validating -L/usr/lib/gcc/x86_64-redhat-linux/4.1.1 -L/ +usr/lib -lgfortran -lm -L/usr/lib/gcc/x86_64-redhat-linux/4.1.1 -lgcc + [ok] ExtUtils::F77: Compiler: gfortran ExtUtils::F77: Cflags: -O Checking if your kit is complete... Looks good Writing Makefile for PGPLOT --------------------------------- [njs@localhost ~/PGPLOT-2.20]$ make cp PGPLOT.pm blib/lib/PGPLOT.pm /usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp -typemap /usr/lib/ +perl5/5.8.8/ExtUtils/typemap -typemap typemap PGPLOT.xs > PGPLOT.xsc + && mv PGPLOT.xsc PGPLOT.c Please specify prototyping behavior for PGPLOT.xs (see perlxs manual) gcc -c -I/usr/local/pgplot -D_REENTRANT -D_GNU_SOURCE -fno-strict-ali +asing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LAR +GEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe + -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param +=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"2.20\" -DXS_VERS +ION=\"2.20\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-mult +i/CORE" PGPLOT.c In file included from PGPLOT.xs:16: pgfun.c:47: warning: return type defaults to ‘int’ pgfun.c:53: warning: return type defaults to ‘int’ pgfun.c:60: warning: return type defaults to ‘int’ pgfun.c:67: warning: return type defaults to ‘int’ pgfun.c: In function ‘pgfunplot’: pgfun.c:168: warning: unused variable ‘retval’ In file included from PGPLOT.xs:18: arrays.c: In function ‘pack_element’: arrays.c:487: warning: label ‘errexit’ defined but not used arrays.c: In function ‘unpack1D’: arrays.c:517: warning: unused variable ‘work’ PGPLOT.c: In function ‘cpgconx’: pgfun.c:70: warning: control reaches end of non-void function PGPLOT.c: In function ‘cpgfunt’: pgfun.c:63: warning: control reaches end of non-void function PGPLOT.c: In function ‘cpgfuny’: pgfun.c:56: warning: control reaches end of non-void function PGPLOT.c: In function ‘cpgfunx’: pgfun.c:50: warning: control reaches end of non-void function PGPLOT.c: At top level: /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/patchlevel.h:122 +: warning: ‘local_patches’ defined but not used arrays.c: In function ‘unpack1D’: arrays.c:512: warning: ‘ivar’ may be used uninitialized in this functi +on arrays.c:516: warning: ‘uvar’ may be used uninitialized in this functi +on arrays.c:514: warning: ‘dvar’ may be used uninitialized in this functi +on arrays.c:513: warning: ‘fvar’ may be used uninitialized in this functi +on arrays.c:515: warning: ‘svar’ may be used uninitialized in this functi +on arrays.c: In function ‘pack2D’: arrays.c:249: warning: ‘nval’ may be used uninitialized in this functi +on arrays.c:245: warning: ‘array2’ may be used uninitialized in this func +tion Running Mkbootstrap for PGPLOT () chmod 644 PGPLOT.bs rm -f blib/arch/auto/PGPLOT/PGPLOT.so gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions - +fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic PGPLOT +.o -o blib/arch/auto/PGPLOT/PGPLOT.so \ -L/usr/lib64 -L/usr/local/pgplot -L/usr/local/lib -lpgplot +-lcpgplot -lX11 -lpng -L/usr/lib/gcc/x86_64-redhat-linux/4.1.1 -L/usr +/lib -lgfortran -lm -L/usr/lib/gcc/x86_64-redhat-linux/4.1.1 -lgcc +\ chmod 755 blib/arch/auto/PGPLOT/PGPLOT.so cp PGPLOT.bs blib/arch/auto/PGPLOT/PGPLOT.bs chmod 644 blib/arch/auto/PGPLOT/PGPLOT.bs Manifying blib/man3/PGPLOT.3pm --------------------------------------- [njs@localhost ~/PGPLOT-2.20]$ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl Default Device for plot tests [recommend /XSERVE] ? /xs ============== Running test1.p ============== Can't load 'blib/arch/auto/PGPLOT/PGPLOT.so' for module PGPLOT: /usr/l +ocal/pgplot/libpgplot.so: undefined symbol: e_rsfe at /usr/lib64/perl +5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230, <STDIN> lin +e 1. at test1.p line 3 Compilation failed in require at test1.p line 3, <STDIN> line 1. BEGIN failed--compilation aborted at test1.p line 3, <STDIN> line 1. ============== Running test2.p ============== Testing advanced point and line plot routines... PGPLOT module version 2.20 Can't locate auto/PGPLOT/pgqinf.al in @INC (@INC contains: blib/lib bl +ib/arch /Models/XSCORT/libraries /usr/lib64/perl5/site_perl/5.8.8/x86 +_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.7/x86_64-linux- +thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-mul +ti /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/li +b/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5 +/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_p +erl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr +/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/p +erl5/vendor_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/ven +dor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5 +.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8. +6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/li +b64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at +test2.p line 9 make: *** [test_dynamic] Interrupt
*** truncated to save space. All the test fail with this same error....
===============

Interestingly, if I install the module dispite the failed tests it doesn't complain even when I use the module... its only when I actually come to open a PGPLOT window that it fails....

/usr/bin/perl: symbol lookup error: /usr/local/pgplot/libpgplot.so: un +defined symbol: s_cat


Replies are listed 'Best First'.
Re: Problems installing PGPLOT.pm
by zentara (Cardinal) on Nov 26, 2007 at 15:58 UTC
    I have the latest pgplot libraries installed, including the corrections for 64-bit architecture and the c-wrapper. All the demos run fine so this seems to be working. My LD_LIBRARY_PATH env variable is set and includes the standard paths and the path for the pgplot libraries. MY PGPLOT_DIR env variable is also set... I am confused... :-s

    A couple of barely-educated guesses, from odd notes and memory of similar problems.

    1. Try rebuilding your pgplot c lib, using g77 instead of gcc.

    # make a build subdir in the toplevel of the pgplot src, then ../makemake ../ linux g77_gcc
    2. A bug in the Perl module, possibly related to the 64-bit stuff. I would contact the author.

    3. When you built your pgplot c lib, there may be some stray header for an older version earlier in the search path, which was accidently used. Usually /usr/local/lib is found first, but some odd glitch may be occurring.

    I would look at number 1 first.


    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
      Thanks for the help. I actually managed to find a pre-compiled version of PGPLOT.pm that came as part of a package that includes all the pg plot libraries (lheasoft package for atronomical software - if anyone is interested) so this now works.
        I recently came across this same trouble, and found a quick and easy solution that I thought I'd share. When you compiled the full PGPLOT distribution, you likely compiled it by something along the lines of (check the pgplot docs)
        makemake "wherever the source files are" linux g77_gcc
        but looking at the top line of your output of PGPLOT-2.20, it says
        Found compiler g77 Found compiler gfortran ExtUtils::F77: Using system=Linux compiler=GFortran ... ExtUtils::F77: Compiler: gfortran
        and therein lies the rub: pgplot was compiled and linked against G77, and PGPLOT-2.20 is compiling/linking against gfortran and the two are not compatible. Take a look at the Makefile.PL file in the PGPLOT-2.20 directory and UNcomment the line that reads something like
        #use ExtUtils::F77 qw(generic g77);
        and this will force PGPLOT-2.20 to use g77 instead of gfortan like it wants to. Other suggestions on the interwebs suggest compiling pgplot itself through gfortran, but this leaves you hanging dry if you need some of the more common output types. This took a while to figure out, but it works as expected for me.