Bugzilla – Full Text Bug Listing |
Summary: | python bindings not portable to OS X | ||
---|---|---|---|
Product: | ns-3 | Reporter: | Tom Henderson <tomh> |
Component: | python bindings | Assignee: | Gustavo J. A. M. Carneiro <gjcarneiro> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | craigdo, mathieu.lacage, ns-bugs |
Priority: | P1 | ||
Version: | ns-3-dev | ||
Hardware: | Mac Intel | ||
OS: | Mac OS | ||
Attachments: | darwin-ppc build fix |
Description
Tom Henderson
2008-11-17 17:13:22 EST
I don't get it. Neither the NS-3 library nor the NS-3 Python module use any kind of '_environ' symbol. Moreover I am no longer able to ssh into darwin-ppc like I used to, so I am not able to test this. Created attachment 311 [details]
darwin-ppc build fix
This patch fixes build errors on the darwin-ppc regression host. It builds fine there and runs Python unit tests. Still no idea about this _environ issue reported here.
Comment on attachment 311 [details]
darwin-ppc build fix
I am waiting for approval from whoever owns the icmpv4 code to commit this.
(In reply to comment #2) > Created an attachment (id=311) [details] > darwin-ppc build fix > > This patch fixes build errors on the darwin-ppc regression host. It builds > fine there and runs Python unit tests. Still no idea about this _environ issue > reported here. > I really don't like this patch: the code should be fine without it. Would you mind show me the compiler error message together with compiler version ? (In reply to comment #4) > (In reply to comment #2) > > Created an attachment (id=311) [details] [details] > > darwin-ppc build fix > > > > This patch fixes build errors on the darwin-ppc regression host. It builds > > fine there and runs Python unit tests. Still no idea about this _environ issue > > reported here. > > > > I really don't like this patch: the code should be fine without it. Would you > mind show me the compiler error message together with compiler version ? The bug happens because the python headers include /usr/include/sys/termios.h which defines the macro ECHO to 0x000008 This is really butt-ugly, especially since if you grep for ICMP_ECHO in /usr/include/*, you will find netinet/ip_icmp.h which defines it so, adding the ICMP prefix is not bullet-proof. I don't really know what to do: the C preprocessor is a killer. (In reply to comment #5) > The bug happens because the python headers include /usr/include/sys/termios.h > which defines the macro ECHO to 0x000008 > > This is really butt-ugly, especially since if you grep for ICMP_ECHO in > /usr/include/*, you will find netinet/ip_icmp.h which defines it so, adding the > ICMP prefix is not bullet-proof. Similar approach was followed by e.g. SocketError. > > I don't really know what to do: the C preprocessor is a killer. If it were up to me I would still commit this patch as is. It may not be bullet proof, but it fixes our immediate problem. I don't like fixing potential/unlikely problems. Another approach would be to #ifdef ECHO #undef ECHO #endif, after including <Python.h> but before including ns-3 headers. (In reply to comment #6) > Another approach would be to #ifdef ECHO #undef ECHO #endif, after including > <Python.h> but before including ns-3 headers. If that works, I would very much prefer this. (In reply to comment #7) > (In reply to comment #6) > > > Another approach would be to #ifdef ECHO #undef ECHO #endif, after including > > <Python.h> but before including ns-3 headers. > > If that works, I would very much prefer this. > In that case, let's not argue about it. Committed. Only problem remaining is the _environ issue, which I cannot reproduce on darwin-ppc unfortunately. (In reply to comment #8) > (In reply to comment #7) > > (In reply to comment #6) > > > > > Another approach would be to #ifdef ECHO #undef ECHO #endif, after including > > > <Python.h> but before including ns-3 headers. > > > > If that works, I would very much prefer this. > > > > In that case, let's not argue about it. Committed. > > Only problem remaining is the _environ issue, which I cannot reproduce on > darwin-ppc unfortunately. > I cannot reproduce the _environ issue anymore either, so please mark as fixed if it passes the overnight tests. |