libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Link problem with libtool on AIX with OpenMP


From: Charlie Zender
Subject: Link problem with libtool on AIX with OpenMP
Date: Fri, 02 Jul 2004 11:38:46 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040622 Debian/1.7-1

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.,

address@hidden:~/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:

address@hidden:~/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.,

address@hidden:~/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, address@hidden, (949) 824-2987, Department of Earth
System Science, University of California, Irvine CA 92697-3100






reply via email to

[Prev in Thread] Current Thread [Next in Thread]