ns-3.6 does not build on Mac OS 10.6

53 views
Skip to first unread message

Bob

unread,
Oct 26, 2009, 1:11:02 AM10/26/09
to ns-3-users

Using the ns-allinone-3.6.tar.bz2 I try to build using the build.py
from the terminal on Mac OS 10.6, but get the following error...

[quote]
debug/bindings/python/ns3_module_flow_monitor.cc: In function
‘PyObject* _wrap_PyNs3FlowProbeFlowStats__get_bytesDropped
(PyNs3FlowProbeFlowStats*)’:
debug/bindings/python/ns3_module_flow_monitor.cc:749: error: no
matching function for call to ‘std::vector<long unsigned int,
std::allocator<long unsigned int> >::vector(std::vector<long long
unsigned int, std::allocator<long long unsigned int> >&)’
/usr/include/c++/4.2.1/bits/stl_vector.h:231: note: candidates are:
std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&)
[with _Tp = long unsigned int, _Alloc = std::allocator<long unsigned
int>]
/usr/include/c++/4.2.1/bits/stl_vector.h:214: note:
std::vector<_Tp, _Alloc>::vector(size_t, const _Tp&, const _Alloc&)
[with _Tp = long unsigned int, _Alloc = std::allocator<long unsigned
int>]
/usr/include/c++/4.2.1/bits/stl_vector.h:201: note:
std::vector<_Tp, _Alloc>::vector(const _Alloc&) [with _Tp = long
unsigned int, _Alloc = std::allocator<long unsigned int>]
debug/bindings/python/ns3_module_flow_monitor.cc: In function
‘PyObject* _wrap_PyNs3FlowMonitorFlowStats__get_bytesDropped
(PyNs3FlowMonitorFlowStats*)’:
debug/bindings/python/ns3_module_flow_monitor.cc:2675: error: no
matching function for call to ‘std::vector<long unsigned int,
std::allocator<long unsigned int> >::vector(std::vector<long long
unsigned int, std::allocator<long long unsigned int> >&)’
/usr/include/c++/4.2.1/bits/stl_vector.h:231: note: candidates are:
std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&)
[with _Tp = long unsigned int, _Alloc = std::allocator<long unsigned
int>]
/usr/include/c++/4.2.1/bits/stl_vector.h:214: note:
std::vector<_Tp, _Alloc>::vector(size_t, const _Tp&, const _Alloc&)
[with _Tp = long unsigned int, _Alloc = std::allocator<long unsigned
int>]
/usr/include/c++/4.2.1/bits/stl_vector.h:201: note:
std::vector<_Tp, _Alloc>::vector(const _Alloc&) [with _Tp = long
unsigned int, _Alloc = std::allocator<long unsigned int>]
Waf: Leaving directory `/Users/neptune/sim/ns-allinone-3.6/ns-3.6/
build'
Build failed
-> task failed (err #1):
{task: cxx ns3_module_flow_monitor.cc -> ns3_module_flow_monitor_3.o}
'/Users/neptune/sim/ns-allinone-3.6/ns-3.6/bindings/python/ns3/
__init__.py' -> '/Users/neptune/sim/ns-allinone-3.6/ns-3.6/build/debug/
bindings/python/ns3/__init__.py'
# Skip NSC (platform not supported)
# Build NS-3
Entering directory `./ns-3.6'
Note: configuring ns-3 without NSC (architecture not supported)
=> python waf configure --with-regression-traces ../ns-3.6-ref-
traces --with-pybindgen ../pybindgen-0.12.0.703
=> python waf
Traceback (most recent call last):
File "./build.py", line 117, in <module>
sys.exit(main(sys.argv))
File "./build.py", line 108, in main
build_ns3(config)
File "./build.py", line 56, in build_ns3
run_command(["python", "waf"])
File "/Users/neptune/sim/ns-allinone-3.6/util.py", line 24, in
run_command
raise CommandError("Command %r exited with code %i" % (argv,
retval))
util.CommandError: Command ['python', 'waf'] exited with code 1
[/quote]

$ gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646)
Copyright (C) 2007 Free Software Foundation, Inc.


Is ns-3.6 not working on Mac OS 10.6? Is there a way around this?

ns-3.5 builds perfectly and runs all following test correctly.

Your help or advise is greatly appreciated.

Thanks, Bob

Gustavo Carneiro

unread,
Oct 26, 2009, 11:25:11 AM10/26/09
to ns-3-...@googlegroups.com


2009/10/26 Bob <bobqu...@googlemail.com>

If you don't mind, run the attached script and show the result:

$ python test.py

 


Is ns-3.6 not working on Mac OS 10.6?  Is there a way around this?

If you are not using python, you can build with python bindings disabled: ./waf configure --disable-python


ns-3.5 builds perfectly and runs all following test correctly.

Your help or advise is greatly appreciated.

Thanks, Bob





--
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert
test.py

Bob

unread,
Oct 26, 2009, 1:10:25 PM10/26/09
to ns-3-users
Gustavo,

test.py gives...

4
8
8
8


I was intending to use the python bindings as I was playing with
previously in ns-3.5

Any other tests I can run? Your help is greatly appreciated.


Cheers,
- el Bobbo

Gustavo Carneiro

unread,
Oct 28, 2009, 12:37:27 PM10/28/09
to ns-3-...@googlegroups.com


2009/10/26 Bob <bobqu...@googlemail.com>


Gustavo,

test.py gives...

4
8
8
8


I was intending to use the python bindings as I was playing with
previously in ns-3.5

Any other tests I can run?  Your help is greatly appreciated.

Your platform is strange.  It is a 64-bit platform, but the compiler considers uint64_t == "long long unsigned int", while the pybindgen-generated code is for the assumption that uint64_t == "long unsigned int".  On the Linux 64-bit systems, this would work out well enough because on Linux64 "long unsigned int" and "long long unsigned int" are the same type.  They both have the same number of bits (64), your compiler is just being picky about this.

I am not sure how to fix this.  For the time being my only advice can be either one of:

  1. to install the recommended versions of gccxml and pygccxml and run ./waf --python-scan

  2. Try to hardcode compiling with apidefs='gcc-ILP32'.  I'm not 100% sure this works, but it's worth a shot.

diff -r c2ebfa5f4e6d bindings/python/wscript
--- a/bindings/python/wscript    Mon Oct 26 10:15:22 2009 +0000
+++ b/bindings/python/wscript    Wed Oct 28 11:36:01 2009 +0000
@@ -438,6 +438,7 @@
             else:
                 print "Cannot build python bindings for unsupported data model"
                 return
+        apidefs = 'gcc-ILP32'
         #print "Will build python bindings for target:", apidefs
 
         ## Get a list of scanned modules; the set of scanned modules

Regards,

Bob

unread,
Nov 1, 2009, 9:27:17 PM11/1/09
to ns-3-users
Gustavo,

thank you for your help.

The second ("hardcode compiling with apidefs='gcc-ILP32'") works and
passes all tests etc.
I'll continue in 32 bit as it works.

As for the first, I installed gccxml 0.6.0 and pygccxml 1.0.0 but
can't get waf to find them:
Cannot re-scan python bindings: (py)gccxml not available

I'm not sure what the "recommended" versions are and there doesn't
seem to be anything in the Tutorial or Manual.


Anyway, working well in 32 bit. Thanks, Bob

Gustavo Carneiro

unread,
Nov 2, 2009, 11:51:57 AM11/2/09
to ns-3-...@googlegroups.com
OK, great, in that case I added a bug report and I'll be sure to fix this eventually:

http://www.nsnam.org/bugzilla/show_bug.cgi?id=734

2009/11/1 Bob <bobqu...@googlemail.com>
Reply all
Reply to author
Forward
0 new messages