[Python-Dev] Extensions that depend on .so's on Solaris

Thomas Wouters thomas@xs4all.net
Thu, 1 Mar 2001 23:04:22 +0100


On Thu, Mar 01, 2001 at 04:11:32PM -0500, Barry A. Warsaw wrote:

>     | 1. Do I have to do something special to allow Python to load
>     |    .so's that extensions depend on?  If so, what?

> Greg, it's been a while since I've worked on Solaris, but here's what
> I remember.  This is all circa Solaris 2.5/2.6.

It worked the same way in SunOS 4.x, I believe.

> I'm of the opinion that if you are specifying -L to the compiler, you
> should always also specify -R, and that using -L/-R is always better than
> LD_LIBRARY_PATH/LD_RUN_PATH (because the former is done by the person
> doing the install and the latter is a burden imposed on all your users).

FWIW, I concur with the entire story. In my experience it's pretty
SunOS/Solaris specific (in fact, I long wondered why one of my C books spent
so much time explaining -R/-L, even though it wasn't necessary on my
platforms of choice at that time ;) but it might also apply to other
Solaris-inspired shared-library environments (HP-UX ? AIX ? IRIX ?)

> IIRC, distutils had a problem in this regard a while back, but these
> days it seems to Just Work for me on Linux.  However, Linux is
> slightly different in that there's a file /etc/ld.so.conf that you can
> use to specify additional directories for ld.so to search at run-time,
> so it can be fixed "after the fact".

BSDI uses the same /etc/ld.so.conf mechanism. However, LD_LIBRARY_PATH does
get used on linux, BSDI and IIRC FreeBSD as well, but as a runtime
environment variable. The /etc/ld.so.conf file gets compiled into a cache of
available libraries using 'ldconf'. On FreeBSD, there is no
'/etc/ld.so.conf' file; instead, you use 'ldconfig -m <path>' to add <path>
to the current cache, and add or modify the definition of
${ldconfig_path} in /etc/rc.conf. (which is used in the bootup procedure to
create a new cache, in case the old one was f'd up.)

I imagine OpenBSD and NetBSD are based off of FreeBSD, not BSDI. (BSDI was
late in adopting ELF, and obviously based most of it on Linux, for some
reason.)

I-wonder-how-it-works-on-Windows-ly y'rs,

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!