OpenSuse 11.3 and compiling Perl 5.12.3

I was trying to compile Perl 5.12.3 on OpenSuse 11.3 for catalyst framework environment. However, during compilation of Perl source code, it exited at ODBM_File.xs (below is small snip from the session, not pasting whole compilation…)

----------------------START------------------------->

./miniperl -Ilib make_ext.pl lib/auto/ODBM_File/ODBM_File.so MAKE=make LIBPERL_A=libperl.a LINKTYPE=dynamic
    Making ODBM_File (all)

Running Makefile.PL in ext/ODBM_File
../../miniperl Makefile.PL INSTALLDIRS=perl INSTALLMAN1DIR=none INSTALLMAN3DIR=none PERL_CORE=1 LIBPERL_A=libperl.a

LINKTYPE=dynamic
Processing hints file hints/linux.pl
Writing Makefile for ODBM_File
make[1]: Entering directory `/home/catalyst/perl-5.12.3/ext/ODBM_File'
make[1]: Leaving directory `/home/catalyst/perl-5.12.3/ext/ODBM_File'
Making all in ext/ODBM_File
make all PERL_CORE=1 LIBPERL_A=libperl.a LINKTYPE=dynamic
make[1]: Entering directory `/home/catalyst/perl-5.12.3/ext/ODBM_File'
cp ODBM_File.pm ../../lib/ODBM_File.pm
../../miniperl "-I../../lib" "-I../../lib" ../../lib/ExtUtils/xsubpp -noprototypes -typemap

../../lib/ExtUtils/typemap -typemap typemap  ODBM_File.xs > ODBM_File.xsc && mv ODBM_File.xsc ODBM_File.c
cc -c   -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

-O2   -DVERSION=\"1.07\" -DXS_VERSION=\"1.07\" -fPIC "-I../.."   ODBM_File.c
ODBM_File.xs: In function ‘XS_ODBM_File_DESTROY’:
ODBM_File.xs:124:2: error: too few arguments to function ‘dbmclose’
/usr/include/dbm.h:62:12: note: declared here
make[1]: *** [ODBM_File.o] Error 1
make[1]: Leaving directory `/home/catalyst/perl-5.12.3/ext/ODBM_File'
Unsuccessful make(ext/ODBM_File): code=512 at make_ext.pl line 449.
make: *** [lib/auto/ODBM_File/ODBM_File.so] Error 25
catalyst@linux-bk68:~/perl-5.12.3> vi /usr/include/dbm.h

<------------------------END---------------------------

It was observed that ‘dbmclose’ call in ODBM_File.xs is dbmclose(void) to that specified in /usr/include/dbm.h dbmclose __P((DBM *)) on OpenSuse 11.3. Below is snip from session for ODM_FIle.xs and dbm.h file.

--------------------------START--------------------->

catalyst@linux-bk68:~/perl-5.12.3> grep -n dbmclose /home/catalyst/perl-5.12.3/ext/ODBM_File/ODBM_File.xs
15:int    dbmclose(void);
25: * DBM on at least Ultrix and HPUX call dbmclose() from dbminit(),
26: * resulting in duplicate free() because dbmclose() does *not*
28: * If some malloc/free calls have been done between dbmclose() and
35:#define dbmclose()    ((void) dbminit("/non/exist/ent"))
124:    dbmclose();
catalyst@linux-bk68:~/perl-5.12.3>

linux-bk68:/home/catalyst/perl-5.12.3 # grep dbmclose /usr/include/dbm.h
/*extern int    dbmclose __P((DBM *));*/
extern int    dbmclose __P((void));
linux-bk68:/home/catalyst/perl-5.12.3 #

<-------------------------END-------------------------

This has corrected the problem. However, keeping fingers crossed. Hope it doesn’t break my current system configuration.

Note: We at TechSutram take our ethics very seriously. More information about it can be found here.
Mandar Pise Opinions expressed by techsutram contributors are their own. More details

Mandar is a seasoned software professional for more than a decade. He is Cloud, AI, IoT, Blockchain and Fintech enthusiast. He writes to benefit others from his experiences. His overall goal is to help people learn about the Cloud, AI, IoT, Blockchain and Fintech and the effects they will have economically and socially in the future.

8 comments:

  1. You should report this bug and patch with perlbug utility.

    ReplyDelete
  2. hi, I have encountered a similar error when installing perl-5.16.2 on suseLES 11.1, and the error encountered by make is:

    Making all in ext/ODBM_File
    make all PERL_CORE=1 LIBPERL_A=libperl.a LINKTYPE=dynamic
    make[1]: Entering directory `/localdata/samba/perl-5.16.2/ext/ODBM_File'
    cc -c -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"1.12\" -DXS_VERSION=\"1.12\" -fPIC "-I../.." ODBM_File.c
    ODBM_File.xs: In function âXS_ODBM_File_DESTROYâ:
    ODBM_File.xs:128: error: too few arguments to function âdbmcloseâ
    make[1]: *** [ODBM_File.o] Error 1
    make[1]: Leaving directory `/localdata/samba/perl-5.16.2/ext/ODBM_File'
    Unsuccessful make(ext/ODBM_File): code=512 at make_ext.pl line 466.
    make: *** [lib/auto/ODBM_File/ODBM_File.so] Error 2

    I have overcome this error by opening the file ODBM_File.xs at line 128 and adding "db" to the dbmclose function. this sorted the problem and also make test gave 100% success on all tests.

    ReplyDelete
    Replies
    1. Eu testei no SLES 11 SP2, a solução do fransesco funcionou!!!

      Francesco, thank's!!!

      Delete
    2. It also worked for me in SLES 11 SP2 and perl 5.18.2.
      Thanks a lot!

      Delete
    3. LOL. Also work here. for the latest perl distribution.

      Delete
    4. Had SLES11SP4. Also the db change work for me on the latest perl SW.

      Delete
  3. Hi I just tested on SLES 11 SP3 compiling perl 5.16.3 and this approach also solved my problem. Thanks to Franceso

    ReplyDelete
  4. That really helped me out, migrating from HPUX with Perl 5.10.0 --> SLES 11 :-)

    Thanks Francesco !

    ReplyDelete

    Your valuable comments are welcome. (Moderated)