Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Answer to RE: Where's the library? Building Perl with alternate libdb probs!

by jlawrenc (Scribe)
on Sep 16, 2000 at 20:11 UTC ( [id://32807]=note: print w/replies, xml ) Need Help??


in reply to Where's the library? Building Perl with alternate libdb probs!

1 - Thanks to Randal for pointing me to Perl Porters Mailing List - this is the source for all of your Perl building answers.

2 - The problem is that they have added a whole pack of "libswanted" to Configure in Perl 5.6. This means that when Configure runs it is going to scan through the lib path and link perl against any of those libs that are found. I anticipate this will change again for 5.7 as the amount of linking libs to the main perl binary is excessive for most platforms.

So what? You ask. Well if you have different instances of a library you might not get the instance you want. In my case I am building on a RedHat 6.2 box. Why RedHat felt it a smart idea to symlink libdb-3.0 to libdb-2.0 and then link programs against libdb-3 when they really wanted libdb-2 is beyond me.

788401 Feb 29 2000 /lib/libdb-2.1.3.so 15 Aug 1 16:28 /lib/libdb.so.2 -> libdb1-2.1.3.so 14 Aug 1 16:28 /lib/libdb.so.3 -> libdb-2.1.3.so 221411 Feb 29 2000 /lib/libdb1-2.1.3.so 15 Aug 1 16:28 /lib/libdb1.so.2 -> libdb1-2.1.3.so
I want all of the glamour that BerkeleyDB 3 has to offer. Transactions, locking, yadda, yadda. So trying to one-up RedHat I download db-3.1.17 and, successfully, make it. All of my attempts to make Perl 5.6 NOT link against RedHat's funky /lib/libdb-3 and against my wonderful /opt/lib/libdb-3 fail fail fail. Why???? This worked with Perl 5.005*! Leave that damn lib alone.

Alas, finally getting my answer, I remove "db" from a libswanted assignment in Configure and rebuild my perl (*again*) this time holding my breath the entire time. (If I was building on a 386 I might not be alive to write this ... thank god for faster processors).

ldd happily reports that the main perl binary is NOT linking against any libdb. (YES!) So I run off and build the BerkeleyDB module and make test works!!!! Yaaaah.

Now, how did I do all of this?????

My build for BerkeleyDB 3.1.17 shared lib:

cd ../db/dist; make distclean >/dev/null; ./configure --enable-shared \ --prefix=/opt >/opt/src/config/logs/db-config; make >/opt/src/config/logs/db.shared; make test >/opt/src/config/logs/db.shared-test; make install >/opt/src/config/logs/db.shared-install
My build for perl on Linux:
make distclean >/dev/null sh Configure -de -Dprefix=/opt -Duselargefiles='undef' \ >/opt/src/config/logs/perl-config make depend >/dev/null make >/opt/src/config/logs/perl-build make test >/opt/src/config/logs/perl-test make install >/opt/src/config/logs/perl-install
My build for BerkeleyDB module:
BERKELEYDB_INCLUDE=/opt/include; export BERKELEYDB_INCLUDE BERKELEYDB_LIB=/opt/include; export BERKELEYDB_LIB /opt/bin/perl -MCPAN -e 'install BerkeleyDB'
Why I am taking so much time and detail to explain this? Well I have burned HOURS of my time trying to get this software combo to work and build properly. I hope I can save someone else that time in the future. That someone I save will burn HOURS on another problem but will remember this and do the same thing when they finally solve that other issue.

Jay

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://32807]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-23 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found