> The problem with py-numpy is rtld is responsible for parsing DT_RPATH > python does not have a DT_RPATH for our gfortran libs so it never gets +preloaded eww > the moment python loads numpy > even if numpy .so *had* a RPATH > the python loader has no DT_RPATH parsing code * db_ ponders > going around and setting RPATH in every module python uses if fortran is +used is a pita > and will not presently work anyway for the reasons I outlined above well .. the python loader could theoretically be taught to +understand DT_RPATH *** You are now talking to channel #bsdports > aDe: yes > but rtld is preloaded by the kernel and does the actual symbol resolving > so if a DT_RPATH is present, the python loader is still going to have to +punt to the rtld and tell it something is up > and that means *every* single python load module needs to be checked for a +fortran lib > so I need to debug more ;) or get fortran support for clang? ;) > That would be nicer > but still leaves us probems with mixed modules > if someone wants to try gcc instead of clang f'r instance sure .. that's the core problem db_: 18:57:51 <@xmj> 184775 (old) 188114 188327 fblas.so from scipy d_tag: DT_RPATH d_val: /usr/local/lib/gcc47 entry: 8 d_tag: DT_INIT d_ptr: 0x7f58 entry: 9 d_tag: DT_FINI d_ptr: 0x241f8 entry: 10 d_tag: DT_HASH d_ptr: 0x158 entry: 11 d_tag: DT_STRTAB zsh: done elfdump -a /usr/local/lib/python2.7/site-packages/scipy/lib/blas/fblas.so | zsh: suspended more night% elfdump -a /usr/local/lib/python2.7/site-packages/scipy/lib/blas/fblas.so cc: numpy/random/mtrand/mtrand.c cc -shared -Wl,-rpath=/usr/local/lib/gcc47 -L/usr/local/lib/gcc47 -B/usr/local/bin -O2 -pipe -fno-strict-aliasing build/temp.freebsd-9.1-STABLE-amd64-2.7/numpy/random/mtrand/mtrand.o build/temp.freebsd-9.1-STABLE-amd64-2.7/numpy/random/mtrand/randomkit.o build/temp.freebsd-9.1-STABLE-amd64-2.7/numpy/random/mtrand/initarray.o build/temp.freebsd-9.1-STABLE-amd64-2.7/numpy/random/mtrand/distributions.o -Lbuild/temp.freebsd-9.1-STABLE-amd64-2.7 -o build/lib.freebsd-9.1-STABLE-amd64-2.7/numpy/random/mtrand.so % ldd -a /usr/local/lib/python2.7/site-packages/numpy/random/mtrand.so /usr/local/lib/python2.7/site-packages/numpy/random/mtrand.so: libc.so.7 => /lib/libc.so.7 (0x80081b000) ldd -a /usr/local/lib/python2.7/site-packages//numpy/core/_dummy.so|more /usr/local/lib/python2.7/site-packages//numpy/core/_dummy.so: libm.so.5 => /lib/libm.so.5 (0x801601000) libc.so.7 => /lib/libc.so.7 (0x80081f000) /lib/libm.so.5: libc.so.7 => /lib/libc.so.7 (0x80081f000) db_: or never? > ldd -a /usr/local/lib/python2.7/site-packages/numpy/random/mtrand.so > /usr/local/lib/python2.7/site-packages/numpy/random/mtrand.so: > libc.so.7 => /lib/libc.so.7 (0x80081b000) > ho ho ho! > The linker see's no reference to a gcc lib so it ignores the rpath > later on when python loads numpy it fails to see an rpath as well DLOPEN(3) FreeBSD Library Functions Manual DLOPEN(3) NAME dlopen, fdlopen, dlsym, dlfunc, dlerror, dlclose -- programmatic inter- face to the dynamic linker LIBRARY Standard C Library (libc, -lc) DESCRIPTION These functions provide a simple programmatic interface to the services of the dynamic linker. Operations are provided to add new shared objects to a program's address space, to obtain the address bindings of symbols defined by such objects, and to remove such objects when their use is no longer required. void * dlopen(const char *name, int mode) { return (rtld_dlopen(name, -1, mode)); } This works... export LD_PRELOAD=/usr/local/lib/gcc47/libgfortran.so % more hello.c #include int main(void) { printf("Hello world!\n"); } % cc -c hello.c cc -Wl,-rpath=/usr/local/lib/gcc47/libgfortran.so -o hello hello.o elfdump -a hello |more ... entry: 1 d_tag: DT_RPATH d_val: /usr/local/lib/gcc47/libgfortran.so ...