|
Bugzilla – Full Text Bug Listing |
| Summary: | ns-3 fails to build if librt is not found | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Sam Jansen <sam.jansen> |
| Component: | build system | Assignee: | Gustavo J. A. M. Carneiro <gjcarneiro> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | gjcarneiro, ns-bugs |
| Priority: | P3 | ||
| Version: | pre-release | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
Sam Jansen
2008-09-13 14:10:48 UTC
A little bit of extra information: I do actually have librt installed, it's just in a non-standard place (/lib32 for 32-bit compat libs). Perhaps the resolution to this bug is that librt should be mandatory? I'm not sure. My next problem is that I don't know how to make waf add /lib32 to the search path from the command line. The documentation, of course, isn't helping. If /lib32 was important it would be already found by the tools, no need to set it. To compile with non-standard link path, use the environment variable LINKFLAGS. Example: LINKFLAGS="-L/tmp" ./waf configure Please don't mark a bug as resolved if you are unable to test it yourself, which I assume you haven't done here. Because this doesn't quite work as advertised. Also, what you suggest doesn't actually solve the problem reported: ns-3 should either build on a machine without librt (it doesn't); or configure should tell the user they need librt installed to build ns-3 (it doesn't). Back to my particular issue: I did actually try LINKFLAGS in my earlier tests and assumed it did nothing, but I see now it does pass in the LINKFLAGS, but there is another problem underlying this. What happens is this (from build/config.log): ...etc...-g++ debug/test_11.o -o debug/testprog -L/lib32 -L/usr/lib/ -Wl,-Bdynamic -lrt collect2: ld terminated with signal 11 [Segmentation fault] ...etc.../i686-unknown-linux-gnu/bin/ld: /usr/lib//librt.so: not configured to support 64-bit little-endian object The problem here is that something in the build is adding -L/usr/lib into the link line; which doesn't work if you're using a cross compiler. So basically the real issue is "ns-3 cross-compiling is not working" (and please retitle the bug if you agree with me). That does not surprise me: no one ever claimed ns-3 could be cross-compiled or that it was supported. Personally I think it would be nice to support cross-compilation. However, making it work is not trivial as you are finding out, and I am not willing to devote much of my time to getting it to work. But if anyone wants to devote some time to it and come up with a patch, I'll be happy to review it. Well, I understand if ns-3 people don't want to spend too much time on supporting cross-compiling -- it's not something I've done a lot myself in the past. But the bug I'm reporting is just a missing library causing configure / the build to not work in a rational way. If a user had an installation where librt could not be found or did not exist, they would get the same error, irrespective of whether a cross compiler is being used. I think its reasonable to fix that (and I completely understand if the fix is to make librt a required component). I think/hope this is fixed in trunk. Can you check? Great! I just built a 32-bit binary on my 64-bit machine using a cross compiler. The build works perfectly. Thanks a lot. |