Comment 3 for bug 319048

Jan (jan-ellenbeck) wrote :

As suggsted offline by Karsten, I tried setting the"sandboxDir" option in config/options.py. This indeed makes him install the sandbox into a different directory. The the RPATH and RUNPATH entries are also updated to that new location. But still the libraries are not found there.

I then had a further look using strace to see where it looks for libraries. It turns out that normal system libraries (boost, cppunit etc) as listed under "NEEDED" above are indeed searched for in the sandbox directory as indicated by RPATH/RUNPATH. But the simulator looks for its own libraries (ofdmaphy, wns etc) only in standard library directories.openWNS's own shared libraries are only.

I guess the difference is that the simulator application itself is linked against the standard libraries and the rpath is honored. But the openWNS libraries are loaded using dlopen in library/module/Base.cpp

I wonder if the absolutePath feature in that function could help somehow. It would probably help on MacOS where loading libofdmaphy.so fails because the libraries are called xyz.dylib (e.g., libofdmaphy.dylib) but it wants to load a .so file.

libofdmaphy.so is only searched here:

open("tls/x86_64/libofdmaphy.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("tls/libofdmaphy.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("x86_64/libofdmaphy.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("libofdmaphy.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib64/tls/x86_64/libofdmaphy.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib64/tls/libofdmaphy.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib64/x86_64/libofdmaphy.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib64/libofdmaphy.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib64/tls/x86_64/libofdmaphy.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib64/tls/libofdmaphy.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib64/x86_64/libofdmaphy.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib64/libofdmaphy.so", O_RDONLY) = -1 ENOENT (No such file or directory)
write(1, "Loading libofdmaphy.so\n", 23) = 23

Normal stuff is also searched in the sandbox:

pen("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/tls/x86_64/libboost_signals.so", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/tls/x86_64", 0x7fff84c21270) = -1 ENOENT (No such file or directory)
open("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/tls/libboost_signals.so", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/tls", 0x7fff84c21270) = -1 ENOENT (No such file or directory)
open("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/x86_64/libboost_signals.so", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/x86_64", 0x7fff84c21270) = -1 ENOENT (No such file or directory)
open("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/libboost_signals.so", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/libpython2.5.so.1.0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/libwns.so", O_RDONLY) = 3
open("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/libboost_program_options.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/libboost_date_time.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/libcppunit-1.12.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/libgcc_s.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/data/jan/clean/sdk--main--1.0/sandbox/dbg/lib/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)