[Top][All Lists]

[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


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/, 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`
/u/zender/lib/AIX/ <----- libtool-built library including OpenMP code
/u/zender/bin/AIX/ncra <---- OpenMP executable

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`
/u/zender/lib/AIX/ <----- libtool-built library including OpenMP code
/u/zender/bin/AIX/ncks <---- non-OpenMP executable

Much of the backend library code,, contains OpenMP code.
So the library should always link to
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).

1. How do I force the back end shared library,, to always
require any code that links to it to also link to
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*

Any help appreciated,
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]