Our website would like to use cookies to store information on your computer. You may delete and block all cookies from this site, but parts of the site will not work as a result. Find out more about how we use cookies.

Login or Register

Powered by
Powered by Novacaster
 
Netatalk 2 and Berkeley DB
by Simon at 17:42 07/11/04 (Forum::Technical Advice::General)
If you follow the instructions for installing Netatalk 2.01 and BerkeleyDB 4.2.52 as written, netatalk's configure will (in some cases) fail, complaining about either wrong or missing versions of bdb.

This message is purely a shorthand record of the process I went through to resolve this problem under RH8.

Building BerkeleyDB:

[sb@webdev build_unix]$ ../dist/configure --with-mutex="x86/gcc-assembly" --prefix=/usr/local --with-uniquename

[sb@webdev build_unix]$ make

[sb@webdev build_unix]$ sudo make install

... switch to Netatalk build dir:

[sb@webdev netatalk-2.0.1]$ ./configure --enable-redhat

[snip]

checking for Berkeley DB headers in /usr/local/include/db4.2... no
checking for Berkeley DB headers in /usr/local/include/db42... no
checking for Berkeley DB headers in /usr/local/include/db4.1... no
checking for Berkeley DB headers in /usr/local/include/db41... no
checking for Berkeley DB headers in /usr/local/include/db4... no
checking for Berkeley DB headers in /usr/local/include/... yes
checking /usr/local/include//db.h version >= 4.1.0... 4.2.52, yes
checking for Berkeley DB link (-ldb-4.2)... yes
checking Berkeley DB library version >= 4.1.0... no
checking for Berkeley DB headers in /usr/include/db4.2... no
checking for Berkeley DB headers in /usr/include/db42... no
checking for Berkeley DB headers in /usr/include/db4.1... no
checking for Berkeley DB headers in /usr/include/db41... no
checking for Berkeley DB headers in /usr/include/db4... no
checking for Berkeley DB headers in /usr/include/... no

Make sure you have the required Berkeley DB libraries AND headers installed.
You can download the latest version from http://www.sleepycat.com.
If you have installed BDB in a non standard location use the
--with-bdb=/path/to/bdb configure option and make sure
your linker is configured to check for libraries there.
configure: error: Berkeley DB library required but not found!

From config.log:

configure:15188: checking for Berkeley DB link (-ldb-4.2)
configure:15219: gcc -o conftest -I/usr/local/include/ -g -O2 -L/usr/local/lib conftest.c -ldb-4.2 -lnsl -ldl >&5
cc1: warning: changing search order for system directory "/usr/local/include"
cc1: warning: as it has already been specified as a non-system directory
configure:15222: $? = 0
configure:15225: test -s conftest
configure:15228: $? = 0
configure:15239: result: yes
configure:15853: checking Berkeley DB library version >= 4.1.0
configure:15897: gcc -o conftest -I/usr/local/include/ -g -O2 -L/usr/local/lib conftest.c -ldb-4.2 -lnsl -ldl >&5
cc1: warning: changing search order for system directory "/usr/local/include"
cc1: warning: as it has already been specified as a non-system directory
configure:15900: $? = 0
configure:15902: ./conftest
./conftest: error while loading shared libraries: libdb-4.2.so: cannot open shared object file: No such file or directory
configure:15905: $? = 127
configure: program exited with status 127
configure: failed program was:
| #line 15858 "configure"
| /* confdefs.h. */

[snip]

But:

[sb@webdev netatalk-2.0.1]$ ll /usr/local/lib/libdb-4.2.so
-rwxrwxr-x 1 sb sb 790425 Nov 7 15:52 /usr/local/lib/libdb-4.2.so

Solution

Either -
# ln -s /usr/local/lib/libdb-4.2.so /lib/libdb-4.2.so

Or -
# echo /usr/local/lib >> /etc/ld.so.conf && /sbin/ldconfig

--
simon

<< Creating favicons on non-Windo... Email blacklisting >>
View Comments (Threaded Mode) Printer Version
Netatalk 2 and Berkeley DB Simon - 17:42 07/11/04
Re: Netatalk 2 and Berkeley DB Simon - 11:00 10/11/04
If you install Berkeley DB into its default location (ie you don't supply a --prefix):

[sb@webdev build_unix]$ ../dist/configure --with-mutex="x86/gcc-assembly" --with-uniquename

...then it gets installed into: /usr/local/BerkeleyDB.4.x where x is the subversion number.

You therefore need to add this path to /etc/ld.so.conf and then run /sbin/ldconfig as root.

This is what my /etc/ld.so.conf file looks like now:

[sb@webdev netatalk-2.0.1]$ cat /etc/ld.so.conf

/usr/kerberos/lib
/usr/X11R6/lib
/usr/local/BerkeleyDB.4.x/lib

... once that's done, then the options for netatalk become:

[sb@webdev netatalk-2.0.1]$ ./configure --enable-redhat --with-bdb=/usr/local/BerkeleyDB.4.x

--
simon

Re: Netatalk 2 and Berkeley DB Simon - 15:27 26/04/06
18 months later, I find myself needing to rebuild Netatalk once more - version 2.0.3 on a fresh and clean, minimally-installed CentOS 4.2 machine.

The magic incantation this time around, having built and installed BDB 4.2.52 in /usr/local/BerkeleyDB.4.2 is:

LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.2/lib/ ./configure --enable-redhat --with-bdb=/usr/local/BerkeleyDB.4.2

... because the alleged solution --with-bdb=/usr/local/BerkeleyDB.4.2 from my previous comment evidently isn't sufficient to enable configure to correctly locate the newly installed libraries.

I suspect this may be to do with the fact that the default db installed with CentOS itself is 4.2.52, and some kind of library precedence issue is involved.

In any event, next time I grab the sources for netatalk and run into configure complaining about configure: error: Berkeley DB library required but not found! I'll be able to look in here and remind myself of this particular gotcha.

Addendum


[root@khufu netatalk-2.0.3]# ldd /usr/local/sbin/afpd
libdb-4.2.so => /usr/local/BerkeleyDB.4.2/lib/libdb-4.2.so (0x00e91000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00d49000)
libdl.so.2 => /lib/libdl.so.2 (0x00cb7000)
libwrap.so.0 => /usr/lib/libwrap.so.0 (0x00cbd000)
libc.so.6 => /lib/tls/libc.so.6 (0x00b8b000)
/lib/ld-linux.so.2 (0x00b72000)

... this build and install was done WITHOUT changing ld.so.conf to add a pointer to the new BerkeleyDB libraries, and WITHOUT running ldconfig.

--
simon