Perl module installs on one Sun server, fails on another...

From: Kevin Buterbaugh (Kevin.Buterbaugh@lifeway.com)
Date: Wed May 21 2003 - 17:11:22 EDT


Greetings All,

     I hope that this post will not be considered off topic for Sun
Managers. The reason I'm posting here is that I believe that my problem
must be something related to my system setup and not Perl or the Perl
module in question. If you believe this to be off topic, please hit
delete now (or flame me if it'll make you feel better <grin>), as this is
a rather lengthy post. Anyway, here's the details...

     There is a Perl module (CIsam-1.0) which I have downloaded from CPAN.
 I successfully installed the module on our development server, an Ultra 2
running Solaris 2.8 and a third party app called Vista. Vista, BTW, uses
DIsam files, a variation on CIsam by a company called Byte Designs. In
any case, the module installed without a problem on the development
server. Our programmers have been using it for about a month now to
access the DIsam files from Perl. The steps I performed to install the
module on the development server were: 1) edited Makefile.PL as follows:

        use ExtUtils::MakeMaker;
        # See lib/ExtUtils/MakeMaker.pm for details of how to influence
        # the contents of the Makefile that is written.
        WriteMakefile(
            'AUTHOR' => 'Ilya Verlinsky ilya@wsi.net',
            'ABSTRACT' => 'Object Oriented Interface to C-ISAM files',
            'NAME' => 'CIsam',
            'VERSION_FROM' => 'CIsam.pm', # finds $VERSION
            'LIBS' => ['-lm -ldisam'], # e.g., '-lm'
            'DEFINE' => '-DCISAM4', # e.g., '-DHAVE_SOMETHING' if
you use Informix C-Isam v.4.xx do '-DCISAM4'
            'INC' => '-I/opt/disam96/head', # e.g.,
'-I/usr/include/other'
            'PMLIBDIRS' => [ 'lib', ${BASEEXT}, 'eg' ],
        );

    2) edited CIsam.xs and changed "#include <isam.h>" to "#include
<disam.h>", 3) ran "perl Makefile.PL", 4) ran "make", 5) ran "make
test" (all tests passed), 6) ran "make install". As I mentioned above,
no problems.

     One of our programmers has a Perl program which is ready to move to
production. Therefore, yesterday I attempted to install the very same
Perl module on our production server, an E4500 also running Solaris 2.8
and the same version of Vista (and DIsam) as the development server. I
should also point out that we are using the stock Perl that Sun ships with
Solaris on both servers and we are also using the same Sun Forte compiler
(v6) on both (we have a site license and NFS mount it from another
server).

     Since the Makefile.PL and CIsam.xs were the only two files I modified
on the development server, I copied them to the production server and ran
"perl Makefile.PL". Here's the output:

        Checking if your kit is complete...
        Looks good
        Note (probably harmless): No library found for -ldisam
        Writing Makefile for CIsam

     The note is not harmless, however, as the subsequent "make" returns
warnings and the "make test" fails:

        # make
        mkdir blib
        mkdir blib/lib
        mkdir blib/arch
        mkdir blib/arch/auto
        mkdir blib/arch/auto/CIsam
        mkdir blib/lib/auto
        mkdir blib/lib/auto/CIsam
        mkdir blib/man3
        cp CIsam.pm blib/lib/CIsam.pm
        AutoSplitting blib/lib/CIsam.pm (blib/lib/auto/CIsam)
        cp eg/Person.pm blib/lib/eg/Person.pm
        cp IsamObjects.pm blib/lib/IsamObjects.pm
        /usr/bin/perl -I/usr/perl5/5.00503/sun4-solaris
-I/usr/perl5/5.00503 /usr/perl5/5.00503/ExtUtils/xsubpp -typemap
/usr/perl5/5.00503/ExtUtils/typemap CIsam.xs >xstmp.c && mv xstmp.c
CIsam.c
        Please specify prototyping behavior for CIsam.xs (see perlxs
manual)
        cc -c -I/opt/disam96/head -xO3 -xdepend -DVERSION=\"1.0\"
-DXS_VERSION=\"1.0\" -KPIC -I/usr/perl5/5.00503/sun4-solaris/CORE -DCISAM4
CIsam.c
        "/usr/perl5/5.00503/sun4-solaris/CORE/config.h", line 1431:
warning: macro redefined: INTSIZE
        "CIsam.xs", line 682: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to struct keydesc {short k_flags, short
k_nparts, array[20] of struct keypart {..} k_part, short k_len, long
k_rootnode} : "/opt/disam96/head/disam.h", line 328
        argument : pointer to struct dictinfo {short di_nkeys, short
di_recsize, short di_idxsize, long di_nrecords}
        "CIsam.xs", line 754: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to struct keydesc {short k_flags, short
k_nparts, array[20] of struct keypart {..} k_part, short k_len, long
k_rootnode} : "/opt/disam96/head/disam.h", line 328
        argument : pointer to struct dictinfo {short di_nkeys, short
di_recsize, short di_idxsize, long di_nrecords}
        Running Mkbootstrap for CIsam ()
        chmod 644 CIsam.bs
        LD_RUN_PATH="/lib" cc -o blib/arch/auto/CIsam/CIsam.so -R/lib -G
CIsam.o -lm
        chmod 755 blib/arch/auto/CIsam/CIsam.so
        cp CIsam.bs blib/arch/auto/CIsam/CIsam.bs
        chmod 644 blib/arch/auto/CIsam/CIsam.bs
        Manifying blib/man3/CIsam.3
        /usr/perl5/5.00503/bin/pod2man: Invalid man page - no
documentation in CIsam.pm
        Couldn't install blib/man3/CIsam.3
 
        # make test
        PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib
-I/usr/perl5/5.00503/sun4-solaris -I/usr/perl5/5.00503 test.pl
        1..1
        Can't load 'blib/arch/auto/CIsam/CIsam.so' for module CIsam:
ld.so.1: /usr/bin/perl: fatal: relocation error: file
blib/arch/auto/CIsam/CIsam.so: symbol isaddindex: referenced symbol not
found at /usr/perl5/5.00503/sun4-solaris/DynaLoader.pm line 169.
         at test.pl line 11
        BEGIN failed--compilation aborted at test.pl line 11.
        *** Error code 255
        make: Fatal error: Command failed for target `test_dynamic'

     I have double-checked everything I can think of. The DIsam libraries
exist and are in the same location on both servers. Since we are running
the same Solaris, same Vista, same DIsam, same Perl, same Perl module,
same C compiler, etc. on both servers, I began to suspect it must be an
environment problem. Therefore, on the development server I executed "set
> dev.env", then copied that file to the production server and sourced it.
 I then ran "make clean" followed by "perl Makefile.PL" on the production
server and got the exact same warnings / errors.

     One thing I have noticed (by running diff on them) is that the
Makefile produced by "perl Makefile.PL" is slightly different (two lines)
on the two servers. On the development server there are two lines which
read:

        EXTRALIBS = -lm -ldisam
        LDLOADLIBS = -lm -ldisam

     On the production server those same two lines are:

        EXTRALIBS = -lm
        LDLOADLIBS = -lm

     Seems relevant, doesn't it? The Makefile contains the following
warning, however:

        # This Makefile is for the CIsam extension to perl.
        #
        # It was generated automatically by MakeMaker version
        # 5.4302 (Revision: 1.222) from the contents of
        # Makefile.PL. Don't edit this file, edit Makefile.PL instead.
        #
        # ANY CHANGES MADE HERE WILL BE LOST!
        #

     Now, why running "perl Makefile.PL" produces different output in the
first place is a mystery to me! However, I decided to try copying the
Makefile from the development server to the production server and
rerunning the "make". The "make" failed with:

        ld: fatal: library -ldisam: not found
        ld: fatal: File processing errors. No output written to
blib/arch/auto/CIsam/CIsam.so
        *** Error code 1
        make: Fatal error: Command failed for target
`blib/arch/auto/CIsam/CIsam.so'

     I'm stuck. Does anyone have any ideas why this might be failing on
the production server? I'd really appreciate any help anyone can give me,
as I am supposed to leave on vacation Friday afternoon and need to get
this working before then! Thanks everyone; summary to come...

==================================

Kevin Buterbaugh - Systems Engineer
LifeWay - www.lifeway.com

"We administer the Unix servers; the Windows team administers the Eunuch
servers."
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:26:27 EDT