LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   install openldap berkley version errors (https://www.linuxquestions.org/questions/linux-newbie-8/install-openldap-berkley-version-errors-920859/)

fwellers 12-28-2011 06:20 AM

install openldap berkley version errors
 
I hope this is the right place to post this and that I can get some help. I pretty much suck at troubleshooting build issues.
we are running oracle red-hat linux 2.6.32-200.20.1.el5uek #1 SMP Fri Oct 7 02:29:42 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

trying to build the latest stable version of openldap ( 2.4.23 )

When running configure I keep getting a version error for berkely db.
checking for db.h... yes
checking for Berkeley DB major version in db.h... 4
checking for Berkeley DB minor version in db.h... 3
checking if Berkeley DB version supported by BDB/HDB backends... no
configure: error: BerkeleyDB version incompatible with BDB/HDB backends

I've read what I can on the forums but with my limited knowledge of how configure works I am still at a loss.

I downloaded and built the lastest version of berkley db (5.3.15). It still failed.
I exported LD_LIBRARY_PATH to point to the berkely db lib directory. It still failed.

Can someone help me or point me in the right direction please ?

Thanks,
floyd

bathory 12-28-2011 07:08 AM

Hi and welcome to LQ,

For the ./configure script to find the correct BerkeleyDB, you need to add the following:
Code:

LDFLAGS=-L/usr/local/BerkeleyDB.5.3/lib CPPFLAGS="-D_GNU_SOURCE -I/usr/local/BerkeleyDB.5.3/include" ./configure --(add any options you want)
Of course you must change the path to BerkeleyBD accordingly if it's not installed under /usr/local/BerkeleyDB.5.3

Regards

fwellers 12-28-2011 07:30 AM

Quote:

Originally Posted by bathory (Post 4559965)
Hi and welcome to LQ,

For the ./configure script to find the correct BerkeleyDB, you need to add the following:
Code:

LDFLAGS=-L/usr/local/BerkeleyDB.5.3/lib CPPFLAGS="-D_GNU_SOURCE -I/usr/local/BerkeleyDB.5.3/include" ./configure --(add any options you want)
Of course you must change the path to BerkeleyBD accordingly if it's not installed under /usr/local/BerkeleyDB.5.3

Regards

Thank you very much. I think that helped, as I got a bit farther now but still complaining about Berkley.
Here's my message now.

checking for db.h... yes
checking for Berkeley DB major version in db.h... 5
checking for Berkeley DB minor version in db.h... 3
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

Do I have to do some linking of the berkely db I installed ?

Thank You !
Floyd

bathory 12-28-2011 08:00 AM

Hi,

According to this, you need a 4.x version of BerkeleyDB.
FYI, I'm using 4.8.24 with the latest openldap 2.4.28 and it works fine.

Regards

fwellers 12-28-2011 08:10 AM

Quote:

Originally Posted by bathory (Post 4560010)
Hi,

According to this, you need a 4.x version of BerkeleyDB.
FYI, I'm using 4.8.24 with the latest openldap 2.4.28 and it works fine.

Regards

Much obliged. I will give that a try and report back.

Thank you,
Floyd

fwellers 12-28-2011 08:34 AM

Quote:

Originally Posted by bathory (Post 4560010)
Hi,

According to this, you need a 4.x version of BerkeleyDB.
FYI, I'm using 4.8.24 with the latest openldap 2.4.28 and it works fine.

Regards

Oh well, still doesn't work.
I downloaded and installed Berkeley DB 4.7.25, and ran LDFLAGS=-L/usr/local/BerkeleyDB.4.7/lib CPPFLAGS="-D_GNU_SOURCE -I/usr/local/BerkeleyDB.4.7/include" ./configure

Now I am getting this:
checking for db.h... yes
checking for Berkeley DB major version in db.h... 4
checking for Berkeley DB minor version in db.h... 7
checking if Berkeley DB version supported by BDB/HDB backends... yes
checking for Berkeley DB link (-ldb-4.7)... yes
checking for Berkeley DB library and header version match... no
configure: error: Berkeley DB version mismatch


I see in the configure log that it's failing here.

./conftest: error while loading shared libraries: libdb-4.7.so: cannot open shared object file: No such file or directory
configure:28943: $? = 127


Wonder why that .so file isn't found , since it's there, as evidenced by this:
ls -lL /usr/local/BerkeleyDB.4.7/lib
total 8760
-rw-r--r-- 1 root root 2272180 Dec 28 09:20 libdb-4.7.a
-rw-r--r-- 1 root root 821 Dec 28 09:19 libdb-4.7.la
-rwxr-xr-x 1 root root 1463493 Dec 28 09:19 libdb-4.7.so
-rwxr-xr-x 1 root root 1463493 Dec 28 09:19 libdb-4.so
-rw-r--r-- 1 root root 2272180 Dec 28 09:20 libdb.a
-rwxr-xr-x 1 root root 1463493 Dec 28 09:19 libdb.so


Thank you,
Floyd

bathory 12-28-2011 08:53 AM

Quote:

configure: error: Berkeley DB version mismatch
I guess you have a /usr/include/db.h that is a symlink pointing to a different BerkeleyDB (maybe the one came with your system).
You can change the symlink to point to /usr/local/BerkeleyDB.4.7include/db.h. After the build is finished you should undo that change, because it may harm other system components

Regards

fwellers 12-28-2011 09:05 AM

Quote:

Originally Posted by bathory (Post 4560067)
I guess you have a /usr/include/db.h that is a symlink pointing to a different BerkeleyDB (maybe the one came with your system).
You can change the symlink to point to /usr/local/BerkeleyDB.4.7include/db.h. After the build is finished you should undo that change, because it may harm other system components

Regards

Thanks. That's not it.
I relinked the db.h in /usr/include to point to the 4.7 one. Same exact error.
Then I even replaced the original link and copied over the newer db.h to that location, just to see.
Same exact error.

Why can't it find that lib.so file ?

Must be something simple that I'm missing.

Thank you !

Floyd

bathory 12-28-2011 09:20 AM

The version mismatch is because it's reading the version from the db.h and the symlink trick should have worked.
Anyway, you can add /usr/local/BerkeleyDB.4.7/lib on top of /etc/ld.so.conf and run as root
Code:

ldconfig
Also check your LD_LIBRARY_PATH and make sure it points to the correct BerkeleyDB

fwellers 12-28-2011 09:24 AM

Quote:

Originally Posted by bathory (Post 4560085)
The version mismatch is because it's reading the version from the db.h and the symlink trick should have worked.
Anyway, you can add /usr/local/BerkeleyDB.4.7/lib on top of /etc/ld.so.conf and run as root
Code:

ldconfig
Also check your LD_LIBRARY_PATH and make sure it points to the correct BerkeleyDB

OOOOH Yeaaaaaa!!!

Thanks so so much.
Can't say that I won't have more issues, but adding the Berkely path back to the LD_LIBRARY_PATH got me through the configure.
I had it there before, when under the 5.3 version.

Thanks for sticking with me Bathory.

bathory 12-28-2011 11:04 AM

Glad to see it worked
You may mark the thread "Solve" using the "Thread Tools" on top of the page.

Regards

fwellers 12-28-2011 11:33 AM

help starting slapd
 
Hello,
I'm pretty new to openldap. We have had an instance of slap running for Aix in the past, using symas version of ldap.
Now I am trying to get openldap version 2.4.23 running on Linux.
we are running oracle red-hat linux 2.6.32-200.20.1.el5uek #1 SMP Fri Oct 7 02:29:42 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

I built the openldap with the default options for configure ( except for pointing it to a new Berkley db.

I went into /usr/openldap-2.4.23/servers/slapd and edited the slapd.conf file to tell it about our database and the schema we want to use.

I would think that I just need to run slapd now in order to initialize the database, but when I run /usr/openldap-2.4.23/servers/slapd/slapd nothing happens.

Can someone point me in the right direction here ?

Thank you,
Floyd

bathory 12-28-2011 11:54 AM

Quote:

I would think that I just need to run slapd now in order to initialize the database, but when I run /usr/openldap-2.4.23/servers/slapd/slapd nothing happens.
Are you sure it's not running? What gives:
Code:

ps -ef|grep slapd
BTW, you should run "make install" after running "make" to install the various openldap files in their correct location.

fwellers 12-28-2011 12:36 PM

Quote:

Originally Posted by bathory (Post 4560195)
Are you sure it's not running? What gives:
Code:

ps -ef|grep slapd
BTW, you should run "make install" after running "make" to install the various openldap files in their correct location.

Thanks.
I did run make install, now I went and started everything again.
I did a make clean and a rebuild of berkley bd,
then I did a configure, make depend on ldap.
Now I am running a make test and it hangs right here:
>>>>> Starting test001-slapadd for bdb...
running defines.sh
Running slapadd to build slapd database...

a ps -ef|grep make yields this

root 10569 25153 0 13:25 pts/1 00:00:00 make test
root 10570 10569 0 13:25 pts/1 00:00:00 /bin/sh -c cd tests; make test
root 10571 10570 0 13:25 pts/1 00:00:00 make test
root 10572 10571 0 13:25 pts/1 00:00:00 make bdb

a ps -ef|grep ldap, yields this:
root 10841 10591 0 13:25 pts/1 00:00:00 /bin/sh ./scripts/test001-slapadd
root 10857 10841 0 13:25 pts/1 00:00:00 /usr/openldap-2.4.23/tests/../servers/slapd/slapd -Ta -d 0 -f /usr/openldap-2.4.23/tests/testrun/slapadd.conf -l ./testdata/test-ordered.ldif


I tried an strace on all those processes. They all say:
Process 10570 attached - interrupt to quit
wait4(-1,

The only one that says something a little different is process 10857 which shows this:

[root@prod-meteor1v4 floydw]# strace -p 10857
Process 10857 attached - interrupt to quit
futex(0x7f7d1fbfd924, FUTEX_WAIT, 1, NULL


So something is hanging, but why I don't know.

Thank you !
Floyd

bathory 12-28-2011 12:58 PM

make test can take a good amount of time to complete, so I tend to skip this step ;)
Quote:

I did run make install, now I went and started everything again.
I did a make clean and a rebuild of berkley bd,
then I did a configure, make depend on ldap.
Now I am running a make test and it hangs right here:
If you want to rebuild a program compiled from sources, it's always better to run "make distclean" and if that's not available to run "make clean". And you should do this for both BerkeleyDB and openldap.
BTW since you're doing all this, I suggest you to use the latest openldap-2.4.28


All times are GMT -5. The time now is 03:42 PM.