[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: LD_LIBRARY_PATH for make test



Michael Ströder wrote:
HI!

I'm running make test on a system where older OpenLDAP libs are
installed from the Linux distribution packages (here RPMs of openSUSE
11.1). This leads to problems during 'make test':

LDAP vendor version mismatch: library 20413, header 20416
Test failed
./scripts/test000-rootdse failed (exit 1)
make[2]: *** [bdb-yes] Error 1
make[2]: Leaving directory
`/usr/src/michael/openldap/OPENLDAP_REL_ENG_2_4/openldap/tests'
make[1]: *** [test] Error 2
make[1]: Leaving directory
`/usr/src/michael/openldap/OPENLDAP_REL_ENG_2_4/openldap/tests'
make: *** [test] Error 2

$ grep -r LD_LIBRARY_PATH tests/
tests/scripts/defines.sh:LD_LIBRARY_PATH=$TESTWD/../libraries:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

Hmm...

find libraries/ -name "*.so"
libraries/libldap_r/.libs/libldap_r.so
libraries/liblber/.libs/liblber.so
libraries/libldap/.libs/libldap.so

Does setting LD_LIBRARY_PATH in tests/scripts/defines.sh have any effect?

Not any more. It used to, when we were using a much older version of libtool. The current version of libtool that we use sets LD_LIBRARY_PATH in the wrapper script that it generates for each dynamically linked binary that it produces, so that line in defines.sh is obsolete.


Are you using a different version of libtool? I've got several versions of OpenLDAP installed on my build machines, and have never encountered this problem. The libtool script always explicitly sets the path to the libraries that it linked with.

I've changed this line to (line wrapped)

LD_LIBRARY_PATH=$TESTWD/../libraries/liblber/.libs:$TESTWD/../libraries/libldap/.libs:$TESTWD/../libraries/libldap_r/.libs:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

and now it works as expected.

This might also be the reason that some tests failed in the past
although gdb reported that the right libs were used. But the symbols
were missing in gdb's stack trace.

Ciao, Michael.

-- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/