Bugzilla – Bug 1620
installing ns 3
Last modified: 2013-04-24 09:17:14 UTC
Hi, I'm installing ns-3 on Mac and I have tried everything to do so, yet it fails to build the ns-3. after running ./download.py the output is : # # Get NS-3 # Updating ns-3 branch => hg --cwd ns-3-dev pull -u pulling from http://code.nsnam.org/ns-3-dev searching for changes no changes found # # Get PyBindGen # Required pybindgen version: 0.15.0.809 Trying to fetch pybindgen; this will fail if no network connection is available. Hit Ctrl-C to skip. => bzr checkout -rrevno:809 https://launchpad.net/pybindgen pybindgen *** Did not fetch pybindgen; python bindings will not be available. # # Get NetAnim # Required NetAnim version: netanim-3.103 Pulling NetAnim updates from http://code.nsnam.org/netanim => hg --cwd netanim pull -u http://code.nsnam.org/netanim pulling from http://code.nsnam.org/netanim searching for changes no changes found # # Get NSC # Architecture (darwin) does not support NSC... skipping *** Did not fetch NSC; NSC will not be available. --------------------------------------------------------------------------- And after ./build.py I get the following: # Skip NSC (platform not supported) # Build NetAnim Entering directory `netanim' => qmake -v Could not find qmake in the default path => qmake-qt4 -v Could not find qmake-qt4 in the default path => qmake -spec macx-g++ NetAnim.pro Error building NetAnim. Ensure the path to qmake is correct. Could not find qmake or qmake-qt4 in the default PATH. Use ./build.py --qmake-path <Path-to-qmake>, if qmake is installed in a non-standard location Note: Some systems use qmake-qt4 instead of qmake Skipping NetAnim .... Leaving directory `netanim' # Build NS-3 Entering directory `./ns-3-dev' Note: configuring ns-3 without pybindgen Note: configuring ns-3 without NSC => /usr/bin/python waf configure Setting top to : /Users/miladmahdian/Downloads/ns-3-allinone/ns-3-dev Setting out to : /Users/miladmahdian/Downloads/ns-3-allinone/ns-3-dev/build Checking for 'gcc' (c compiler) : /opt/local/bin/gcc Checking for 'g++' (c++ compiler) : /opt/local/bin/g++ Checking for program python : /usr/bin/python Checking for python version : (2, 7, 2, 'final', 0) Checking for library python2.7 in LIBDIR : not found Checking for library python2.7 in python_LIBPL : not found Checking for library python2.7 in $prefix/libs : not found Checking for library python2.7m in LIBDIR : not found Checking for library python2.7m in python_LIBPL : not found Checking for library python2.7m in $prefix/libs : not found Checking for library python27 in LIBDIR : not found Checking for library python27 in python_LIBPL : not found Checking for library python27 in $prefix/libs : not found Checking for program /usr/bin/python-config,python2.7-config,python-config-2.7,python2.7m-config : /usr/bin/python-config Checking for header Python.h : :-( Asking python-config for pyembed --cflags flags : yes Asking python-config for pyembed --libs flags : yes Asking python-config for pyembed --ldflags flags : yes Getting pyembed flags from python-config : Could not build a python embedded interpreter Checking boost includes : 1_53 Checking boost libs : ok Checking for boost linkage : ok Checking for click location : not found Checking for program pkg-config : /opt/local/bin/pkg-config Checking for 'gtk+-2.0' >= 2.12 : yes Checking for 'libxml-2.0' >= 2.7 : yes Checking for type uint128_t : not found Checking for type __uint128_t : yes Checking high precision time implementation : 128-bit integer Checking for header stdint.h : yes Checking for header inttypes.h : yes Checking for header sys/inttypes.h : not found Checking for header sys/types.h : yes Checking for header sys/stat.h : yes Checking for header dirent.h : yes Checking for header stdlib.h : yes Checking for header signal.h : yes Checking for header pthread.h : yes Checking for header stdint.h : yes Checking for header inttypes.h : yes Checking for header sys/inttypes.h : not found Checking for library rt : not found Checking for header netpacket/packet.h : not found Checking for header sys/ioctl.h : yes Checking for header net/if.h : not found Checking for header linux/if_tun.h : not found Checking for header netpacket/packet.h : not found Checking for NSC location : not found Checking for OpenFlow location : not found Checking for 'sqlite3' : yes Checking for header linux/if_tun.h : not found Checking for program sudo : /usr/bin/sudo Checking for program valgrind : not found Checking for 'gsl' : not found Checking for compilation flag -Wno-error=deprecated-d... support : ok Checking for compilation flag -Wno-error=deprecated-d... support : ok Checking for compilation flag -fstrict-aliasing... support : ok Checking for compilation flag -fstrict-aliasing... support : ok Checking for compilation flag -Wstrict-aliasing... support : ok Checking for compilation flag -Wstrict-aliasing... support : ok Checking for program doxygen : not found ---- Summary of optional NS-3 features: Python Bindings : not enabled (Python library or headers missing) BRITE Integration : not enabled (BRITE not enabled (see option --with-brite)) NS-3 Click Integration : not enabled (nsclick not enabled (see option --with-nsclick)) GtkConfigStore : enabled XmlIo : enabled Threading Primitives : enabled Real Time Simulator : not enabled (librt is not available) Emulated Net Device : not enabled (<netpacket/packet.h> include not detected) File descriptor NetDevice : enabled Tap FdNetDevice : not enabled (needs linux/if_tun.h) Emulation FdNetDevice : not enabled (needs netpacket/packet.h) PlanetLab FdNetDevice : not enabled (PlanetLab operating system not detected) Network Simulation Cradle : not enabled (NSC not found (see option --with-nsc)) MPI Support : not enabled (option --enable-mpi not selected) NS-3 OpenFlow Integration : not enabled (OpenFlow not enabled (see option --with-openflow)) SQlite stats data output : enabled Tap Bridge : not enabled (<linux/if_tun.h> include not detected) PyViz visualizer : not enabled (Python Bindings are needed but not enabled) Use sudo to set suid bit : not enabled (option --enable-sudo not selected) Build tests : not enabled (defaults to disabled) Build examples : not enabled (defaults to disabled) GNU Scientific Library (GSL) : not enabled (GSL not found) 'configure' finished successfully (3.303s) => /usr/bin/python waf build Waf: Entering directory `/Users/miladmahdian/Downloads/ns-3-allinone/ns-3-dev/build' [ 659/1370] cxx: scratch/scratch-simulator.cc -> build/scratch/scratch-simulator.cc.1.o [ 661/1370] cxx: utils/test-runner.cc -> build/utils/test-runner.cc.1.o [ 662/1370] cxx: utils/bench-simulator.cc -> build/utils/bench-simulator.cc.2.o . . . [1077/1370] cxx: src/energy/model/device-energy-model-container.cc -> build/src/energy/model/device-energy-model-container.cc.1.o [1079/1370] cxx: src/energy/helper/basic-energy-source-helper.cc -> build/src/energy/helper/basic-energy-source-helper.cc.1.o [1080/1370] cxx: src/energy/helper/rv-battery-model-helper.cc -> build/src/energy/helper/rv-battery-model-helper.cc.1.o [1081/1370] cxx: src/fd-net-device/helper/creator-utils.cc -> build/src/fd-net-device/helper/creator-utils.cc.1.o ../src/fd-net-device/helper/creator-utils.cc: In function 'void ns3::SendSocket(const char*, int, int)': ../src/fd-net-device/helper/creator-utils.cc:60:3: error: 'strerror' was not declared in this scope ../src/fd-net-device/helper/creator-utils.cc:74:3: error: 'strerror' was not declared in this scope ../src/fd-net-device/helper/creator-utils.cc:78:3: error: 'strerror' was not declared in this scope ../src/fd-net-device/helper/creator-utils.cc:170:3: error: 'strerror' was not declared in this scope Waf: Leaving directory `/Users/miladmahdian/Downloads/ns-3-allinone/ns-3-dev/build' Build failed -> task in 'ns3-fd-net-device' failed (exit status 1): {task 4512072400: cxx creator-utils.cc -> creator-utils.cc.1.o} ['/opt/local/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-I.', '-I..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_SQLITE3=1', '../src/fd-net-device/helper/creator-utils.cc', '-c', '-o', 'src/fd-net-device/helper/creator-utils.cc.1.o'] Traceback (most recent call last): File "./build.py", line 216, in <module> sys.exit(main(sys.argv)) File "./build.py", line 207, in main build_ns3(config, build_examples, build_tests, args, build_options) File "./build.py", line 100, in build_ns3 run_command([sys.executable, "waf", "build"] + build_options) File "/Users/miladmahdian/Downloads/ns-3-allinone/util.py", line 24, in run_command raise CommandError("Command %r exited with code %i" % (argv, retval)) util.CommandError: Command ['/usr/bin/python', 'waf', 'build'] exited with code 1 -------------------------------------------------------------------------------- Can anyone help me? P.S: I have almost no experience with terminal. Regards,
This seems to be an issue with the fd-net-device module; reassigning this bug to that module.
Try to delete (move it) the fd-model and recompile. Do a configure and compilation from within the ns-3-dev directory (with and without rd-module). This will assess if it's the fd-module or not. My guess it that the error will remain. strerror is used also somewhere else, and it's a function available in MacOS C++. Hence we have the following options: 1) it's a script bug, or 2) it's a forgotten include, or 3) something else. By the way, I'm not using all-in-one, and in my Mac everything is working as intended.
Thank you for your response. can you please tell me how to delete or move the fd-model? Regards,
Simply move the "fd-netdevice" folder out of "ns-3-dev/src" folder. This will do. T.
Alina is working on this. I agree with Tommaso's suggestion for a workaround.
I deleted the fd-netdevice from the src folder. yet after building, I run the ./test.py -c core and the output is : [ 4/857] cxx: src/antenna/model/cosine-antenna-model.cc -> build/debug/src/antenna/model/cosine-antenna-model.cc.1.o ../../src/antenna/model/angles.cc:22:21: fatal error: ns3/log.h: No such file or directory compilation terminated. ../../src/antenna/model/antenna-model.cc:22:21: fatal error: ns3/log.h: No such file or directory compilation terminated. ../../src/antenna/model/isotropic-antenna-model.cc:22:21: fatal error: ns3/log.h: No such file or directory compilation terminated. ../../src/antenna/model/cosine-antenna-model.cc:22:21: fatal error: ns3/log.h: No such file or directory compilation terminated. Waf: Leaving directory `/Users/miladmahdian/repos/ns-3-allinone/ns-3-dev/build/debug' Build failed -> task in 'ns3-antenna' failed (exit status 1): {task 4508190992: cxx angles.cc -> angles.cc.1.o} ['/opt/local/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-I.', '-I../..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SQLITE3=1', '../../src/antenna/model/angles.cc', '-c', '-o', 'src/antenna/model/angles.cc.1.o'] -> task in 'ns3-antenna' failed (exit status 1): {task 4508191184: cxx antenna-model.cc -> antenna-model.cc.1.o} ['/opt/local/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-I.', '-I../..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SQLITE3=1', '../../src/antenna/model/antenna-model.cc', '-c', '-o', 'src/antenna/model/antenna-model.cc.1.o'] -> task in 'ns3-antenna' failed (exit status 1): {task 4508191248: cxx isotropic-antenna-model.cc -> isotropic-antenna-model.cc.1.o} ['/opt/local/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-I.', '-I../..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SQLITE3=1', '../../src/antenna/model/isotropic-antenna-model.cc', '-c', '-o', 'src/antenna/model/isotropic-antenna-model.cc.1.o'] -> task in 'ns3-antenna' failed (exit status 1): {task 4508191440: cxx cosine-antenna-model.cc -> cosine-antenna-model.cc.1.o} ['/opt/local/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-I.', '-I../..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SQLITE3=1', '../../src/antenna/model/cosine-antenna-model.cc', '-c', '-o', 'src/antenna/model/cosine-antenna-model.cc.1.o'] Waf died. Not running tests
(In reply to comment #6) > I deleted the fd-netdevice from the src folder. yet after building, I run the > ./test.py -c core > > and the output is : > > > [ 4/857] cxx: src/antenna/model/cosine-antenna-model.cc -> > build/debug/src/antenna/model/cosine-antenna-model.cc.1.o > ../../src/antenna/model/angles.cc:22:21: fatal error: ns3/log.h: No such file > or directory > compilation terminated. > ../../src/antenna/model/antenna-model.cc:22:21: fatal error: ns3/log.h: No such > file or directory > compilation terminated. > ../../src/antenna/model/isotropic-antenna-model.cc:22:21: fatal error: > ns3/log.h: No such file or directory > compilation terminated. > ../../src/antenna/model/cosine-antenna-model.cc:22:21: fatal error: ns3/log.h: > No such file or directory > compilation terminated. > Waf: Leaving directory > `/Users/miladmahdian/repos/ns-3-allinone/ns-3-dev/build/debug' > Build failed > -> task in 'ns3-antenna' failed (exit status 1): > {task 4508190992: cxx angles.cc -> angles.cc.1.o} > ['/opt/local/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', > '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', > '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-I.', > '-I../..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SQLITE3=1', > '../../src/antenna/model/angles.cc', '-c', '-o', > 'src/antenna/model/angles.cc.1.o'] > -> task in 'ns3-antenna' failed (exit status 1): > {task 4508191184: cxx antenna-model.cc -> antenna-model.cc.1.o} > ['/opt/local/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', > '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', > '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-I.', > '-I../..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SQLITE3=1', > '../../src/antenna/model/antenna-model.cc', '-c', '-o', > 'src/antenna/model/antenna-model.cc.1.o'] > -> task in 'ns3-antenna' failed (exit status 1): > {task 4508191248: cxx isotropic-antenna-model.cc -> > isotropic-antenna-model.cc.1.o} > ['/opt/local/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', > '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', > '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-I.', > '-I../..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SQLITE3=1', > '../../src/antenna/model/isotropic-antenna-model.cc', '-c', '-o', > 'src/antenna/model/isotropic-antenna-model.cc.1.o'] > -> task in 'ns3-antenna' failed (exit status 1): > {task 4508191440: cxx cosine-antenna-model.cc -> > cosine-antenna-model.cc.1.o} > ['/opt/local/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', > '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', > '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-I.', > '-I../..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SQLITE3=1', > '../../src/antenna/model/cosine-antenna-model.cc', '-c', '-o', > 'src/antenna/model/cosine-antenna-model.cc.1.o'] > Waf died. Not running tests I haven't been able to reproduce the problem. I am testing in a OS X Darwin Kernel Version 12.3.0. Milad, could you please provide information on the Mac OS version you are using? You can get this information by executing 'uname -a' in a terminal.
Hi, My Mac version is Darwin Kernel Version 12.3.0. I did re-install NS3 and now it's working well.