Building OpenLDAP from sources and missing BerkelyDB [closed]
Asked Answered
B

5

26

I'm building OpenLDAP on a RHEL 5; I used instructions found at http://www.linux.com/archive/feature/113607.

All went well, until running './configure' for OpenLDAP - the following error was recorded:

*<earlier output snipped>*
checking for gethostbyaddr_r... yes
checking number of arguments of ctime_r... 2
checking number of arguments of gethostbyname_r... 6
checking number of arguments of gethostbyaddr_r... 8
checking db.h usability... yes
checking db.h presence... yes
checking for db.h... yes
checking for Berkeley DB major version in db.h... 5
checking for Berkeley DB minor version in db.h... 1
checking if Berkeley DB version supported by BDB/HDB backends... yes
**checking for Berkeley DB link (default)... no
configure: error: BDB/HDB: BerkeleyDB not available**

I have Googled like a maniac but have been unsuccessful to find a resolution - any tips on areas to explore?

Thanks

Buonomo answered 3/10, 2010 at 0:31 Comment(2)
Sorry - the terminal output seems to wrap around. I' not sure why. Hope the output is still legible. Thank you for all help.Buonomo
I think you should reconsider your accepted answer. Naveen provided one consistent with Stack Overflow (and not Super User).Thereunder
H
16

do yum install db4-devel

(or just install the prepackaged openldap, yum install openldap-servers openldap-clients

Hell answered 3/10, 2010 at 0:31 Comment(2)
I used yum install openldap-servers and ran into problems with Mozilla NSS. More details can be found here. This is why I build OpenLDAP from scratch.Animatism
I'm catching an error that BDB is tool old for the version of OpenLDAP being built. Is there a way to disable BerkleyDB?Thereunder
C
16

Seems you are using tarball installation, first you should install Berkeley DB. You can find it from oracle website at Oracle Berkeley DB Downloads. Compile and install it.

cd db-4.7.25.NC
. ./dist/configure
make
make install
cd /usr/local/BerkeleyDB.4.7/

This will install BerkeleyDB. Now you need to provide the location to successfully compile OpenLDAP.

export CPPFLAGS="-I/usr/local/BerkeleyDB.4.7/include"
export LDFLAGS="-L/usr/local/BerkeleyDB.4.7/lib -Wl,-R,/usr/local/BerkeleyDB.4.7/lib -Wl,--enable-new-dtags"
# Build OpenLDAP
... 

If you don't set RPATH then you should add LD_LIBRARY_PATH to /etc/profile.

export LD_LIBRARY_PATH="/usr/local/BerkeleyDB.4.7/lib"

After this compile OpenLDAP, let me know if you face any issue.

Cambric answered 3/10, 2010 at 0:31 Comment(2)
Can I safely add CPPFLAGS and LDFLAGS to /etc/profile? Otherwise, after adding LD_LIBRARY_PATH and restarting the prompt, the two previous variables will be lost.Overtire
+1 for providing instructions to build and install the library from sources.Thereunder
H
16

do yum install db4-devel

(or just install the prepackaged openldap, yum install openldap-servers openldap-clients

Hell answered 3/10, 2010 at 0:31 Comment(2)
I used yum install openldap-servers and ran into problems with Mozilla NSS. More details can be found here. This is why I build OpenLDAP from scratch.Animatism
I'm catching an error that BDB is tool old for the version of OpenLDAP being built. Is there a way to disable BerkleyDB?Thereunder
H
8

For CentOS 7, do yum install libdb-devel. libdb4-devel did not work for me.

Hildegaard answered 3/10, 2010 at 0:31 Comment(1)
Yes. db4-devel is CentOS <= 6Chanel
C
6

debian try:

aptitude install libdb5.1 libdb5.1-dev libdb5.1-dbg

Chubb answered 3/10, 2010 at 0:31 Comment(0)
P
3

apt-get install libdb-dev worked for me in Ubuntu Server.

Praemunire answered 3/10, 2010 at 0:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.