Hi,
I'm using xlc_r to compile a backend library and multiple front-end executables to the library under AIX 5.1. The library, and _some_ of the front end executables (i.e., some of the main() functions) contains SMP/OpenMP code so I make sure to compile and link with -qsmp=omp. All of this, by the way, is built with autoconf/automake/libtool so the backend library is actually a shared library and everything is linked with -brtl. Everything is hunky dori with the SMP executables---they work great.
However, the non-SMP executables do not execute because of run time linking errors, e.g.,
[EMAIL PROTECTED]:~/nco$ ncks
exec(): 0509-036 Cannot load program ncks because of the following errors:
rtld: 0712-001 Symbol _xlsmpGetDefaultSLock was referenced
from module /u/zender/lib/AIX/libnco.so(), but a runtime definition
of the symbol was not found.We installed ldd on our AIX system and, sure enough, the executables with OpenMP code (not just headers) in the front-end main() have the correct dependency on libxlsmp.a, the AIX library that implements OpenMP functionality:
[EMAIL PROTECTED]:~/nco$ ldd `which ncra`
/usr/lib/libxlsmp.a(smprt_64.o)
/usr/lib/libpthread.a(shr_xpg5_64.o)
/u/zender/lib/AIX/libnco.so <----- libtool-built library including OpenMP code
/u/zender/bin/AIX/ncra <---- OpenMP executable
/usr/lib/libcrypt.a(shr_64.o)
/usr/lib/libc.a(shr_64.o)
BUT the executables without OpenMP code in the front-end main() lack the dependency on libxlsmp.a, e.g.,
[EMAIL PROTECTED]:~/nco$ ldd `which ncks`
/usr/lib/libpthread.a(shr_xpg5_64.o)
/u/zender/lib/AIX/libnco.so <----- libtool-built library including OpenMP code
/u/zender/bin/AIX/ncks <---- non-OpenMP executable
/usr/lib/libcrypt.a(shr_64.o)
/usr/lib/libc.a(shr_64.o)
Much of the backend library code, libnco.so, contains OpenMP code. So the libnco.so library should always link to /usr/lib/libxlsmp.a(smprt_64.o). When it does not, it causes the observed run-time-linking errors. The ugly workaround is to place some bogus non-needed OpenMP code in the front end main()---this works and establishes the required dependency on /usr/lib/libxlsmp.a(smprt_64.o).
Questions: 1. How do I force the back end shared library, libnco.so, to always require any code that links to it to also link to /usr/lib/libxlsmp.a(smprt_64.o)? 2. Is there a way to force a dynamically-linked executable to depend on a given library without having to place code that refers to the library in the executable? 3. Is this somehow a libtool issue where libtool can be told to retain all libraries that linked-to libraries depend on?
Further information: All the output of configure, and make are at http://dust.ess.uci.edu/nco/rgr/*.powerpc-ibm-aix5.1.0.0.foo
Any help appreciated, Charlie -- Charlie Zender, [EMAIL PROTECTED], (949) 824-2987, Department of Earth System Science, University of California, Irvine CA 92697-3100
_______________________________________________ Libtool mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/libtool
