I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2006-01-19 15:50:23-08 by consultmac2
Cant load ...BerkeleyDB.so for module BerkeleyDB: libdb-4.4.so
I'm having trouble getting the BerkeleyDB perl plug-in (0.27) to work in a specific case.
Here is my configuration: Fedora Core 4 on an HP OmniBook XE3 laptop.

The Berkeley database (v4.4.16) is sucessfully installed and accessible via C++ programs that we've tried. BerkeleyDB builds and installs without incident up to the point of doing the 'make test' operation.
Here's the first screenful of output from the process (much more than that is generated):

**** start of quote ****
[root@localhost BerkeleyDB-0.27]# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/btree........Can't load '/root/berkeley/BerkeleyDB-0.27/blib/arch/auto/BerkeleyDB/BerkeleyDB.so' for module BerkeleyDB: libdb-4.4.so: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.6/i386-linux-thread-multi/DynaLoader.pm line 230.
at t/btree.t line 6
Compilation failed in require at t/btree.t line 6.
BEGIN failed--compilation aborted at t/btree.t line 6.
Undefined subroutine &BerkeleyDB::Term::close_everything called at /root/berkeley/BerkeleyDB-0.27/blib/lib/BerkeleyDB.pm line 1675.
END failed--call queue aborted at t/btree.t line 6.
t/btree........dubious
Test returned status 255 (wstat 65280, 0xff00)
t/cds..........Can't load '/root/berkeley/BerkeleyDB-0.27/blib/arch/auto/BerkeleyDB/BerkeleyDB.so' for module BerkeleyDB: libdb-4.4.so: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.6/i386-linux-thread-multi/DynaLoader.pm line 230.
at t/cds.t line 8
Compilation failed in require at t/cds.t line 8.
BEGIN failed--compilation aborted at t/cds.t line 8.
Undefined subroutine &BerkeleyDB::Term::close_everything called at /root/berkeley/BerkeleyDB-0.27/blib/lib/BerkeleyDB.pm line 1675.
END failed--call queue aborted at t/cds.t line 8.
t/cds..........dubious
Test returned status 255 (wstat 65280, 0xff00)
**** end of quote ****

We have two such laptops configured nearly identically and we have the same error symptoms on both. On another computer, a Dell Precision 360, I have SUSE 9.something installed and have been sucessful with building and using BerkeleyDB perl plug-in (0.27) with the Berkeley database (v4.4.16)

I don't see this problem described in the troubleshooting section of the documentation associated with the plug-in. There is a slight mention of problems with this plug-in when used with Redhat... and it points to a bugtracker report on redhat.com, but I can't tell if that applies to my situation or not. Googling "fedora perl BerkeleyDB cannot open shared object" hasn't found me the answer yet.

Help would be much appreciated.

Thanks in advance.

-bC
Direct Responses: 1656 | 1661 | Write a response
Posted on 2006-01-19 19:00:02-08 by consultmac2 in response to 1655
Re: Cant load ...BerkeleyDB.so for module BerkeleyDB: libdb-4.4.so
addendum:

After searching usenet group comp.lang.perl.modules and others, the only concrete suggestion that I thought would be helpful was to edit /etc/ld.so.conf and add the path where libdb-4.4.so is found. I did that and followed up with the recommended action of running /sbin/ldconfig .

"make test"
continues to produce the very same errors as stated above, even after completely rebooting the computer.

-bC
Direct Responses: 2365 | Write a response
Posted on 2006-01-20 09:23:21-08 by pmarquess in response to 1655
Re: Cant load ...BerkeleyDB.so for module BerkeleyDB: libdb-4.4.so
This is the fundamental error in your log

libdb-4.4.so: cannot open shared object file: No such file or directory <br><br>

Basically my module cannot find the Berkeley DB library.

On a Unix box this is sorted out by setting the LIB variable in the config.in file. For Windows (which isn't a development environment I use), I believe you need to include this directory in your PATH as well. Start by setting the LIB variable in config.in. If that doesn't work, try the PATH.

Paul
Direct Responses: 1665 | Write a response
Posted on 2006-01-20 14:53:25-08 by consultmac2 in response to 1661
Re: Cant load ...BerkeleyDB.so for module BerkeleyDB: libdb-4.4.so
Paul,

I have the LIB variable set to the actual location of libdb-4.4.so in the config.in file in both locations that I've found it:
/BerkeleyDB-0.27/ (which is where i've been doing the make and install commands from)
and
/db-4.4.16.NC/perl/BerkeleyDB/ (which is where I installed the DB from).

rebooted.

Still no change in the symptoms (the errors generated when attempting "make test"). Then I added that location to the PATH variable and after rebooting verified that it was set correctly. Still no change in the symptoms, though.

Have you a box with Fedora Core on it that you tested it with? Like I said, I had no such trouble with SUSE 9.x However, SUSE is not an approved deployment platform here and I have to make most things work on Fedora Core 4 instead.

Strange.

Thanks for your time.

-bC
Direct Responses: 1676 | Write a response
Posted on 2006-01-22 11:51:57-08 by pmarquess in response to 1665
Re: Cant load ...BerkeleyDB.so for module BerkeleyDB: libdb-4.4.so
Try including the directory where the berkeley DB library lives in the environment variable LD_LIBRARY_PATH. If you've not used this before, it works just like the PATH environment variable - so if you already have one you need to add it without destroying any existing entries. No, I haven't personally tested it with the FEDORA core bout I know that it runs on practically every Unix that is available. Paul
Direct Responses: 1689 | Write a response
Posted on 2006-01-23 13:45:59-08 by consultmac2 in response to 1676
Re: Cant load ...BerkeleyDB.so for module BerkeleyDB: libdb-4.4.so
Paul,
That was the ticket. That made it work for me. I was talking to someone on Friday that didn't know BerkeleyDB or your plug-in, but told me that Fedora Core 4 is essentially an alpha of Red Hat's Enterprise product. Considering all that changed and is new in FC 4 versus FC 3, he speculated that perhaps something in FC 4 was breaking the BerkeleyDB plug-in stuff and that perhaps I should back-up to FC 3.

I'm glad that I don't have to do that at this point.


Thanks again.

-bC
Direct Responses: Write a response
Posted on 2006-05-27 00:33:53-07 by emilio4 in response to 1656
Re: Cant load ...BerkeleyDB.so for module BerkeleyDB: libdb-4.4.so
I am having some trouble with the Berkeley DB interface. This is what I have done: downloaded Berkeley DB, compiled Berkeley DB succesfully (did not run make install because i am running locally), edited config.in in BerekeleyDB perl directory to point to local copies of include and lib, perl Makefile.PL, make, make test. everything is OK - no issues here. when i try to import the BerkeleyDB package into a perl script I get the error below. Any clues on what I am doing wrong? Undefined subroutine &BerkeleyDB::Term::close_everything called at /db-4.4.20/perl/BerkeleyDB/BerkeleyDB.pm line 1675.
Direct Responses: 2366 | Write a response
Posted on 2006-05-27 13:41:56-07 by pmarquess in response to 2365
Re: Cant load ...BerkeleyDB.so for module BerkeleyDB: libdb-4.4.so
Hi, the error you are getting means that you script cannot find the file BerkeleyDB.so (this gets built when with my module). If you don't intend making use of the module long term, try putting the line use blib "xxx"; at the top of your script. Substitute the string "xxx" for the full path to the blib directory where you built my moduule. Longer term I would advise installing the module properly. Paul
Direct Responses: 5451 | Write a response
Posted on 2007-06-16 19:34:41-07 by maxkhalilov in response to 2366
Re: Cant load ...BerkeleyDB.so for module BerkeleyDB: libdb-4.4.so
Hello, I've tried all the tricks suggested in this forum to install BerkeleyDB 4.50.20.NC perl module on my Fedora 6 system (perl, v5.8.8 built for i386-linux-thread-multi). However, nothing worked for me. I still have the error message making test [root@d5214k BerkeleyDB]# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/btree........Can't load '/home/khalilov/Desktop/SAMT/db-4.5.20.NC/perl/BerkeleyDB/blib/arch/auto/BerkeleyDB/BerkeleyDB.so' for module BerkeleyDB: /home/khalilov/Desktop/SAMT/db-4.5.20.NC/perl/BerkeleyDB/blib/arch/auto/BerkeleyDB/BerkeleyDB.so: cannot restore segment prot after reloc: Permission denied at /usr/lib/perl5/vendor_perl/5.8.8/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230. at t/btree.t line 6 Compilation failed in require at t/btree.t line 6. BEGIN failed--compilation aborted at t/btree.t line 6. Undefined subroutine &BerkeleyDB::Term::close_everything called at /home/khalilov/Desktop/SAMT/db-4.5.20.NC/perl/BerkeleyDB/blib/lib/BerkeleyDB.pm line 1675. END failed--call queue aborted at t/btree.t line 6. t/btree........dubious Test returned status 2 (wstat 512, 0x200) etc................................. FAILED--23 test scripts could be run, alas--no output ever seen make: *** [test_dynamic] Error 2 I've edited the config.in file and LD_LIBRARY_PATH points to the Berkeley lib directory. Is it impossible to install perl module on my system or there is a trick?? Thank you in advance. Max
Direct Responses: 5452 | Write a response
Posted on 2007-06-17 00:35:27-07 by pmarquess in response to 5451
Re: Cant load ...BerkeleyDB.so for module BerkeleyDB: libdb-4.4.so
This message you are getting
cannot restore segment prot after reloc
suggests you are running with SELinux (i.e. enhanced security) enabled. I've never run SELinux, but http://www.linuxquestions.org/questions/showthread.php?t=338231 thread suggests that you can "Allow the use of shared libraries with Text Relocation".

Paul
Direct Responses: 5463 | Write a response
Posted on 2007-06-19 08:41:57-07 by maxkhalilov in response to 5452
Re: Cant load ...BerkeleyDB.so for module BerkeleyDB: libdb-4.4.so
Thank you! that was it (Fedora 6: System - Administration - Security level and Firewall - SELinux - disabled).
Direct Responses: Write a response