|
Bugzilla – Full Text Bug Listing |
| Summary: | OSX: test.py reports dyld: Library not loaded: | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | John Abraham <john.abraham.in> |
| Component: | build system | Assignee: | Gustavo J. A. M. Carneiro <gjcarneiro> |
| Status: | RESOLVED FIXED | ||
| Severity: | blocker | CC: | mathieu.lacage, ns-bugs |
| Priority: | P5 | ||
| Version: | pre-release | ||
| Hardware: | Mac Intel | ||
| OS: | Mac OS | ||
| Attachments: |
Config.log
test logs output of ./waf -d debug configure --enable-examples -v output of ./waf -v output of ./waf --run "hello-simulator" output of ls -l build/debug patch |
||
|
Description
John Abraham
2011-08-24 15:43:19 UTC
Created attachment 1225 [details]
test logs
output of test.py -v
Forgot to mention: this is what test.py reports
---------- begin standard out ----------
---------- begin standard err ----------
Traceback (most recent call last):
File "/Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/src/flow-monitor/examples/wifi-olsr-flowmon.py", line 21, in <module>
import ns.applications
ImportError: dlopen(/Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug/bindings/python/ns/applications.so, 2): Library not loaded: /usr/local/lib/libns3-core.3.12-RC1.dylib
Referenced from: /Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug/bindings/python/ns/applications.so
Reason: image not found
From your log file I see that: os.environ["DYLD_LIBRARY_PATH"] == :/Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug Synchronously execute /Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug/utils/test-runner --print-test-name-list Return code = -5 stderr = dyld: Library not loaded: /usr/local/lib/libns3-core.3.12-RC1.dylib Referenced from: /Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug/utils/test-runner Reason: image not found So, if DYLD_LIBRARY_PATH is being set correctly, why doesn't the dynamic linker find the library in /Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug ? Can you check what files have been created inside? Another useful input would be the output of "./waf -v", to see all the low level build commands that are being issued (after a waf clean, of course). I am surprised Snow Leopard also has problems, did ns-3.11 not work in Snow Leopard, or is something new been broken? Created attachment 1227 [details]
output of ./waf -d debug configure --enable-examples -v
./waf -d debug configure --enable-examples -v
Created attachment 1228 [details]
output of ./waf -v
./waf -v
Created attachment 1229 [details]
output of ./waf --run "hello-simulator"
./waf --run "hello-simulator"
Created attachment 1230 [details]
output of ls -l build/debug
ls -l build/debug
14:17:36 runner system command -> ['/usr/bin/g++', [...bunch of objects...], '-o', '/Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug/libns3-core.dylib', '-dynamiclib', '-install_name', '/usr/local/lib/libns3-core.3.12-RC1.dylib'] 14:17:48 runner system command -> ['/usr/bin/g++', 'debug/examples/tutorial/hello-simulator_1.o', '-o', '/Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug/examples/tutorial/hello-simulator', '-Ldebug', '-lns3-core'] I guess the linker finds the libns3-core.dylib alright, but the dynamic loader (at runtime) tries to look for /usr/local/lib/libns3-core.3.12-RC1.dylib, which of course doesn't exist yet. The reason is the -install_name parameter that waf gives to the linker. My theory (maybe you could check that) is that after "waf install" the ns-3 examples will run fine. The next question then is how to fix it, and this is where I have no good idea. Apparently, if we tell waf the library will be installed, then it will supply the parameters '-install_name /usr/local/lib/libns3-core.3.12-RC1.dylib', wheres if install_path is missing, then the parameters will be '-install_name libns3-core.3.12-RC1.dylib'. The second form is what we had in ns-3.11 and it worked for uninstalled ns-3. So, for now, I guess we have to choose what we want OSX build to work, either ns-3 needs to be installed or it cannot be installed at all, choose one *sigh* yes "./waf install" allowed the executable to run. ns-3.11 does not have this issue on Snow leopard ns-3.11 won't build on my OSX lion (In reply to comment #8) > 14:17:36 runner system command -> ['/usr/bin/g++', [...bunch of objects...], > '-o', > '/Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug/libns3-core.dylib', > '-dynamiclib', '-install_name', '/usr/local/lib/libns3-core.3.12-RC1.dylib'] > > 14:17:48 runner system command -> ['/usr/bin/g++', > 'debug/examples/tutorial/hello-simulator_1.o', '-o', > '/Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug/examples/tutorial/hello-simulator', > '-Ldebug', '-lns3-core'] > > I guess the linker finds the libns3-core.dylib alright, but the dynamic loader > (at runtime) tries to look for /usr/local/lib/libns3-core.3.12-RC1.dylib, which > of course doesn't exist yet. The reason is the -install_name parameter that > waf gives to the linker. > > My theory (maybe you could check that) is that after "waf install" the ns-3 > examples will run fine. The next question then is how to fix it, and this is > where I have no good idea. > > Apparently, if we tell waf the library will be installed, then it will supply > the parameters '-install_name /usr/local/lib/libns3-core.3.12-RC1.dylib', > wheres if install_path is missing, then the parameters will be '-install_name > libns3-core.3.12-RC1.dylib'. The second form is what we had in ns-3.11 and it > worked for uninstalled ns-3. So, for now, I guess we have to choose what we > want OSX build to work, either ns-3 needs to be installed or it cannot be > installed at all, choose one *sigh* Created attachment 1231 [details]
patch
Maybe this patch helps?...
I get the same results with the patch 82 ./waf distclean 83 cd .. 84 ls 85 ./build.py --enable-tests --enable-examples 86 ./waf --run "hello-simulator" 87 cd ns-3.12-RC1/ 88 ./waf --run "hello-simulator" Waf: Entering directory `/Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build' Waf: Leaving directory `/Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build' 'build' finished successfully (1.226s) dyld: Library not loaded: /usr/local/lib/libns3-core.3.12-RC1.dylib Referenced from: /Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug/examples/tutorial/hello-simulator Reason: image not found Command ['/Users/john/ns-3.12-rc1/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug/examples/tutorial/hello-simulator'] terminated with signal SIGTRAP. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>"). (In reply to comment #10) > Created attachment 1231 [details] > patch > > Maybe this patch helps?... man dyld says that you should use DYLD_FALLBACK_LIBRARY_PATH in this case but it does not work: bash-3.2$ DYLD_FALLBACK_LIBRARY_PATH=/Users/mathieu/code/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug ./build/debug/scratch/scratch-simulator dyld: Library not loaded: /usr/local/lib/libns3-core.3.12-RC1.dylib Referenced from: /Users/mathieu/code/ns-allinone-3.12-RC1/ns-3.12-RC1/./build/debug/scratch/scratch-simulator Reason: image not found Trace/BPT trap DYLD_FALLBACK_LIBRARY_PATH=/Users/mathieu/code/ns-allinone-3.12-RC1/ns-3.12-RC1/build/debug dtrace -o out ./build/debug/scratch/scratch-simulator dtrace: failed to initialize dtrace: DTrace requires additional privileges tom: can you give my account proper privs ? It seems that OSX library version numbers trigger this problem, so I disabled them altogether (in OSX only). Should be fixed now. changeset: 7463:53b784adf3f4 tag: tip user: Gustavo J. A. M. Carneiro <gjc@inescporto.pt> date: Fri Aug 26 12:31:04 2011 +0100 summary: Bug 1251 - OSX: test.py reports dyld: Library not loaded works on RC2 image after the fix (In reply to comment #13) > It seems that OSX library version numbers trigger this problem, so I disabled > them altogether (in OSX only). Should be fixed now. > > > changeset: 7463:53b784adf3f4 > tag: tip > user: Gustavo J. A. M. Carneiro <gjc@inescporto.pt> > date: Fri Aug 26 12:31:04 2011 +0100 > summary: Bug 1251 - OSX: test.py reports dyld: Library not loaded |