Cross-references between dynamically loaded modules under AIX

Randall Hopper aa8vb at vislab.epa.gov
Tue Apr 27 08:11:09 EDT 1999


Jakob Schiotz:
 |I wrote a small function to convert a C pointer to a NumPy array (I am
 |using SWIG), ... it coredumps under AIX ... the dynamical loader under
 |AIX cannot resolve symbols in one module that refers to another module.

Not knowing NumPy, my assumption is you are failing on a .so-to-.so module
dynamic link.  If so...

I did something like this with SWIG recently myself, albeit on IRIX.  Does
AIX have the equivalent of an RPATH (check the ld man page, and search for
rpath)?  If so, just augment RPATH for the wraper module (.so) to point to
the directory where your wrapped C shared libraries (.so's) live.

FWIW, here is what I use to build my SWIG wrapper libraries.  Note that the
core C libraries they wrap live (or rather, are linked) to the current
directory, so adding the current directory ($PWD) to the rpath is
sufficient for my case:

LINK_SO       = ld -shared -rdata_shared -w -o32 -KPIC -rpath $(PWD) -L $(PWD)

You can also use LD_LIBRARY_PATH, but for a number of reasons, it's better
to use RPATH when you can.

Randall




More information about the Python-list mailing list