Bug 297

Summary: Python Binding Compilation error with Cygwin
Product: ns-3 Reporter: Gavin Weng <gavinweng>
Component: python bindingsAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: gjcarneiro, mathieu.lacage
Priority: P1    
Version: pre-release   
Hardware: PC   
OS: Windows   

Description Gavin Weng 2008-08-28 12:34:34 UTC
With the new rev 564 of pybindgen in Cygwin(Python 2.5.1), the errors are listed as following:
 
[456/509] cxx: build/debug/bindings/python/ns3_module_common.cc -> build/debug/bindings/python/ns3_module_common_3.o
debug/bindings/python/ns3_module_common.cc: In function `PyObject* _wrap_PyNs3ListErrorModel_GetList(PyNs3ListErrorModel*)':
debug/bindings/python/ns3_module_common.cc:5571: error: no match for 'operator=' in 'retval = ns3::ListErrorModel::GetList() const()'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/list.tcc:121: note: candidates are: std::list<_Tp, _Alloc>& std::list<_Tp, _Alloc>::operator=(const std::list<_Tp, _Alloc>&) [with _Tp = unsigned int, _Alloc = std::allocator<unsigned int>]
debug/bindings/python/ns3_module_common.cc: In function `PyObject* _wrap_PyNs3ListErrorModel_SetList(PyNs3ListErrorModel*, PyObject*, PyObject*)':
debug/bindings/python/ns3_module_common.cc:5589: error: no matching function for call to `ns3::ListErrorModel::SetList(std::list<unsigned int, std::allocator<unsigned int> >&)'
debug/ns3/error-model.h:215: note: candidates are: void ns3::ListErrorModel::SetList(const std::list<uint32_t, std::allocator<uint32_t> >&)
Build failed
 -> task failed (err #129): [bld:///cygdrive/d/Study/WirelessCommunication/NS-3/
repos/ns-3-dev/bindings/python/ns3_module_common_3.o]
Comment 1 Craig Dowell 2008-08-29 17:33:01 UTC
*** Bug 298 has been marked as a duplicate of this bug. ***
Comment 2 Mathieu Lacage 2008-09-03 17:15:02 UTC
I don't think that this bug is fixable. I would like to suggest that we disable python bindings on cygwin unless the user installs gccxml.
Comment 3 Gustavo J. A. M. Carneiro 2008-09-04 06:57:30 UTC
*** Bug 310 has been marked as a duplicate of this bug. ***
Comment 4 Gustavo J. A. M. Carneiro 2008-09-06 09:32:51 UTC
(In reply to comment #2)
> I don't think that this bug is fixable. I would like to suggest that we disable
> python bindings on cygwin unless the user installs gccxml.
 
Python bindings are disabled now on cygwin.

Should we really enable Python bindings if (py)gccxml are installed?  They would be arbitrary versions, and in my experience things might easily go wrong if the wrong versions are used.  For instance, pygccxml svn trunk works works well with gccxml cvs head, but pygccxml 0.9.5 doesn't work well with gccxml head, only with gccxml cvs from around the date 2008-04-20, neither does pygccxml trunk work well gccxml cvs from 2008-04-20, only with HEAD.

At least for NS-3.2 I see no better solution than this: when on CygWin disable python bindings with a warning suggesting the use of MingW in order to get Python bindings on Win32.  Anything else sounds too complicated and error prone to work, especially in such a short time frame.
Comment 5 Gustavo J. A. M. Carneiro 2008-09-06 10:24:23 UTC
One problem I forgot with MingW is that it is not compiling atm (bug #296) :-(
Comment 6 Tom Henderson 2008-09-07 23:57:44 UTC
(In reply to comment #4)
> (In reply to comment #2)
> > I don't think that this bug is fixable. I would like to suggest that we disable
> > python bindings on cygwin unless the user installs gccxml.
> 
> Python bindings are disabled now on cygwin.
> 
> Should we really enable Python bindings if (py)gccxml are installed?  They
> would be arbitrary versions, and in my experience things might easily go wrong
> if the wrong versions are used.  For instance, pygccxml svn trunk works works
> well with gccxml cvs head, but pygccxml 0.9.5 doesn't work well with gccxml
> head, only with gccxml cvs from around the date 2008-04-20, neither does
> pygccxml trunk work well gccxml cvs from 2008-04-20, only with HEAD.
> 
> At least for NS-3.2 I see no better solution than this: when on CygWin disable
> python bindings with a warning suggesting the use of MingW in order to get
> Python bindings on Win32.  Anything else sounds too complicated and error prone
> to work, especially in such a short time frame.

I would be fine with this.

Comment 7 Mathieu Lacage 2008-09-08 14:40:50 UTC
this bug is fixed now too: we disable python on cygwin.