Bugzilla – Bug 1298
Undefined click symbols
Last modified: 2011-12-19 03:31:15 UTC
I just installed a new buildslave on osx Lion. I get the following undefined symbols. I followed the instructions at http://lalith.in/2011/05/22/howto-getting-started-with-ns-3-click-part-i/ Is there another click repository? if yes let me know, I can try that one out. Undefined symbols for architecture x86_64: "ns3::TestCase::TestCase(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)", referenced from: ns3::ClickIfidFromNameTest::ClickIfidFromNameTest()in ipv4-click-routing-test.cc.3.o ns3::ClickTrivialTest::ClickTrivialTest()in ipv4-click-routing-test.cc.3.o ns3::ClickTrivialTest::ClickTrivialTest()in ipv4-click-routing-test.cc.3.o ns3::ClickIpMacAddressFromNameTest::ClickIpMacAddressFromNameTest()in ipv4-click-routing-test.cc.3.o ns3::ClickIpMacAddressFromNameTest::ClickIpMacAddressFromNameTest()in ipv4-click-routing-test.cc.3.o ns3::ClickIfidFromNameTest::ClickIfidFromNameTest()in ipv4-click-routing-test.cc.3.o To get the full buildlog see. http://ns-buildmaster.ee.washington.edu:8010/job/TestThree/14/consoleFull
tried with click-2.0.1 as well, with instructions from http://read.cs.ucla.edu/click/nsclick. Ubuntu seems to work. see http://ns-buildmaster.ee.washington.edu:8010/job/OSX-Lion%20Comprehensive/20/console
(In reply to comment #1) > tried with click-2.0.1 as well, with instructions from > http://read.cs.ucla.edu/click/nsclick. > Ubuntu seems to work. > see > http://ns-buildmaster.ee.washington.edu:8010/job/OSX-Lion%20Comprehensive/20/console This is strange. Seems like a problem with the osx Lion g++ compiler. It doesn't happen on my Ubuntu 10.04 - x86. Unfortunately, I have no way of testing this right now. Maybe Ruben can shed some light on this since he uses a Mac. Meanwhile, I'll see if I can find a osx lion box x86_64 around here.
(In reply to comment #2) > (In reply to comment #1) > > tried with click-2.0.1 as well, with instructions from > > http://read.cs.ucla.edu/click/nsclick. > > Ubuntu seems to work. > > see > > http://ns-buildmaster.ee.washington.edu:8010/job/OSX-Lion%20Comprehensive/20/console > > This is strange. Seems like a problem with the osx Lion g++ compiler. It > doesn't happen on my Ubuntu 10.04 - x86. > > Unfortunately, I have no way of testing this right now. Maybe Ruben can shed > some light on this since he uses a Mac. Meanwhile, I'll see if I can find a osx > lion box x86_64 around here. I just tried it on my laptop with OSX Lion . I still see linker errors. Here is the history 5 hg clone http://code.nsnam.org/ns-3-dev 6 cp /Users/john/Downloads/click-2.0.1.tar . 7 tar -xvf click-2.0.1.tar 8 cd click-2.0.1 9 ./configure --enable-userlevel --disable-linuxmodule --enable-nsclick 10 make 11 cd .. 12 cd ns-3-dev/ 13 ./waf -d debug configure --with-nsclick=../click-2.0.1 --enable-tests --enable-examples 14 ./waf sorry the previous build links may be stale now, as I am still setting up build slaves. Here is the latest link http://ns-buildmaster.ee.washington.edu:8010/job/OSX-Lion-Comprehensive/21/console
Found the why... (not yet how to fix it, arghhh, I hate waf) For model, and helper, instead of having the object files built in build/src/click/*, they are being built in src/click/* See the following very ugly waf output Waf: Entering directory `/Users/ruben/src/ns-3-dev/build' [ 970/1598] cxx: src/click/examples/nsclick-raw-wlan.cc -> build/src/click/examples/nsclick-raw-wlan.cc.2.o 10:58:41 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-Ibuild', '-I.', '-I.', '-I/Users/ruben/src', '-I/Users/ruben/src/click-2.0.1/include', '-I/opt/local/include', '-I/opt/local/include/gtk-2.0', '-I/opt/local/lib/gtk-2.0/include', '-I/opt/local/include/atk-1.0', '-I/opt/local/include/cairo', '-I/opt/local/include/gdk-pixbuf-2.0', '-I/opt/local/include/pango-1.0', '-I/opt/local/include/gio-unix-2.0', '-I/opt/local/include/glib-2.0', '-I/opt/local/lib/glib-2.0/include', '-I/opt/local/include/pixman-1', '-I/opt/local/include/freetype2', '-I/opt/local/include/libpng14', '-I/opt/local/include/libxml2', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DPYTHONDIR="/usr/local/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/site-packages"', '-DHAVE_PYTHON_H=1', '-DENABLE_GSL', '-DNS3_CLICK', '-D_REENTRANT', '../src/click/examples/nsclick-raw-wlan.cc', '-c', '-o', 'src/click/examples/nsclick-raw-wlan.cc.2.o'] [ 971/1598] cxx: src/click/examples/nsclick-simple-lan.cc -> build/src/click/examples/nsclick-simple-lan.cc.1.o 10:58:41 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-Ibuild', '-I.', '-I.', '-I/Users/ruben/src', '-I/Users/ruben/src/click-2.0.1/include', '-I/opt/local/include', '-I/opt/local/include/gtk-2.0', '-I/opt/local/lib/gtk-2.0/include', '-I/opt/local/include/atk-1.0', '-I/opt/local/include/cairo', '-I/opt/local/include/gdk-pixbuf-2.0', '-I/opt/local/include/pango-1.0', '-I/opt/local/include/gio-unix-2.0', '-I/opt/local/include/glib-2.0', '-I/opt/local/lib/glib-2.0/include', '-I/opt/local/include/pixman-1', '-I/opt/local/include/freetype2', '-I/opt/local/include/libpng14', '-I/opt/local/include/libxml2', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DPYTHONDIR="/usr/local/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/site-packages"', '-DHAVE_PYTHON_H=1', '-DENABLE_GSL', '-DNS3_CLICK', '-D_REENTRANT', '../src/click/examples/nsclick-simple-lan.cc', '-c', '-o', 'src/click/examples/nsclick-simple-lan.cc.1.o'] [1354/1598] cxx: src/click/test/ipv4-click-routing-test.cc -> build/src/click/test/ipv4-click-routing-test.cc.3.o 10:58:43 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-I../src/click', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-Ibuild', '-I.', '-I/Users/ruben/src/click-2.0.1/include', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DPYTHONDIR="/usr/local/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/site-packages"', '-DHAVE_PYTHON_H=1', '-DENABLE_GSL', '-DNS3_CLICK', '-DNS_TEST_SOURCEDIR="src/click/test"', '../src/click/test/ipv4-click-routing-test.cc', '-c', '-o', 'src/click/test/ipv4-click-routing-test.cc.3.o'] [1355/1598] cxx: src/click/model/ipv4-click-routing.cc -> src/click/model/ipv4-click-routing.cc.1.o 10:58:43 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-Ibuild', '-I.', '-I/Users/ruben/src/click-2.0.1/include', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DPYTHONDIR="/usr/local/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/site-packages"', '-DHAVE_PYTHON_H=1', '-DENABLE_GSL', '-DNS3_CLICK', '../src/click/model/ipv4-click-routing.cc', '-c', '-o', '../src/click/model/ipv4-click-routing.cc.1.o'] [1356/1598] cxx: src/click/model/ipv4-l3-click-protocol.cc -> src/click/model/ipv4-l3-click-protocol.cc.1.o 10:58:44 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-Ibuild', '-I.', '-I/Users/ruben/src/click-2.0.1/include', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DPYTHONDIR="/usr/local/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/site-packages"', '-DHAVE_PYTHON_H=1', '-DENABLE_GSL', '-DNS3_CLICK', '../src/click/model/ipv4-l3-click-protocol.cc', '-c', '-o', '../src/click/model/ipv4-l3-click-protocol.cc.1.o'] [1357/1598] cxx: src/click/helper/click-internet-stack-helper.cc -> src/click/helper/click-internet-stack-helper.cc.1.o 10:58:45 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-Ibuild', '-I.', '-I/Users/ruben/src/click-2.0.1/include', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DPYTHONDIR="/usr/local/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/site-packages"', '-DHAVE_PYTHON_H=1', '-DENABLE_GSL', '-DNS3_CLICK', '../src/click/helper/click-internet-stack-helper.cc', '-c', '-o', '../src/click/helper/click-internet-stack-helper.cc.1.o'] [1358/1598] cxx: src/click/examples/nsclick-udp-client-server-csma.cc -> build/src/click/examples/nsclick-udp-client-server-csma.cc.3.o 10:58:46 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-Ibuild', '-I.', '-I.', '-I/Users/ruben/src', '-I/Users/ruben/src/click-2.0.1/include', '-I/opt/local/include', '-I/opt/local/include/gtk-2.0', '-I/opt/local/lib/gtk-2.0/include', '-I/opt/local/include/atk-1.0', '-I/opt/local/include/cairo', '-I/opt/local/include/gdk-pixbuf-2.0', '-I/opt/local/include/pango-1.0', '-I/opt/local/include/gio-unix-2.0', '-I/opt/local/include/glib-2.0', '-I/opt/local/lib/glib-2.0/include', '-I/opt/local/include/pixman-1', '-I/opt/local/include/freetype2', '-I/opt/local/include/libpng14', '-I/opt/local/include/libxml2', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DPYTHONDIR="/usr/local/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/site-packages"', '-DHAVE_PYTHON_H=1', '-DENABLE_GSL', '-DNS3_CLICK', '-D_REENTRANT', '../src/click/examples/nsclick-udp-client-server-csma.cc', '-c', '-o', 'src/click/examples/nsclick-udp-client-server-csma.cc.3.o'] [1359/1598] cxx: src/click/examples/nsclick-udp-client-server-wifi.cc -> build/src/click/examples/nsclick-udp-client-server-wifi.cc.4.o 10:58:47 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-Ibuild', '-I.', '-I.', '-I/Users/ruben/src', '-I/Users/ruben/src/click-2.0.1/include', '-I/opt/local/include', '-I/opt/local/include/gtk-2.0', '-I/opt/local/lib/gtk-2.0/include', '-I/opt/local/include/atk-1.0', '-I/opt/local/include/cairo', '-I/opt/local/include/gdk-pixbuf-2.0', '-I/opt/local/include/pango-1.0', '-I/opt/local/include/gio-unix-2.0', '-I/opt/local/include/glib-2.0', '-I/opt/local/lib/glib-2.0/include', '-I/opt/local/include/pixman-1', '-I/opt/local/include/freetype2', '-I/opt/local/include/libpng14', '-I/opt/local/include/libxml2', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DPYTHONDIR="/usr/local/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/site-packages"', '-DHAVE_PYTHON_H=1', '-DENABLE_GSL', '-DNS3_CLICK', '-D_REENTRANT', '../src/click/examples/nsclick-udp-client-server-wifi.cc', '-c', '-o', 'src/click/examples/nsclick-udp-client-server-wifi.cc.4.o'] [1360/1598] cxx: src/click/examples/nsclick-routing.cc -> build/src/click/examples/nsclick-routing.cc.5.o 10:58:48 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-Ibuild', '-I.', '-I.', '-I/Users/ruben/src', '-I/Users/ruben/src/click-2.0.1/include', '-I/opt/local/include', '-I/opt/local/include/gtk-2.0', '-I/opt/local/lib/gtk-2.0/include', '-I/opt/local/include/atk-1.0', '-I/opt/local/include/cairo', '-I/opt/local/include/gdk-pixbuf-2.0', '-I/opt/local/include/pango-1.0', '-I/opt/local/include/gio-unix-2.0', '-I/opt/local/include/glib-2.0', '-I/opt/local/lib/glib-2.0/include', '-I/opt/local/include/pixman-1', '-I/opt/local/include/freetype2', '-I/opt/local/include/libpng14', '-I/opt/local/include/libxml2', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DPYTHONDIR="/usr/local/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/site-packages"', '-DHAVE_PYTHON_H=1', '-DENABLE_GSL', '-DNS3_CLICK', '-D_REENTRANT', '../src/click/examples/nsclick-routing.cc', '-c', '-o', 'src/click/examples/nsclick-routing.cc.5.o'] [1361/1598] cxxshlib: build/src/core/model/time.cc.1.o build/src/core/model/event-id.cc.1.o build/src/core/model/scheduler.cc.1.o build/src/core/model/list-scheduler.cc.1.o build/src/core/model/map-scheduler.cc.1.o build/src/core/model/heap-scheduler.cc.1.o build/src/core/model/calendar-scheduler.cc.1.o build/src/core/model/ns2-calendar-scheduler.cc.1.o build/src/core/model/event-impl.cc.1.o build/src/core/model/simulator.cc.1.o build/src/core/model/simulator-impl.cc.1.o build/src/core/model/default-simulator-impl.cc.1.o build/src/core/model/timer.cc.1.o build/src/core/model/watchdog.cc.1.o build/src/core/model/synchronizer.cc.1.o build/src/core/model/make-event.cc.1.o build/src/core/model/log.cc.1.o build/src/core/model/breakpoint.cc.1.o build/src/core/model/type-id.cc.1.o build/src/core/model/attribute-construction-list.cc.1.o build/src/core/model/object-base.cc.1.o build/src/core/model/ref-count-base.cc.1.o build/src/core/model/object.cc.1.o build/src/core/model/test.cc.1.o build/src/core/model/random-variable.cc.1.o build/src/core/model/rng-stream.cc.1.o build/src/core/model/command-line.cc.1.o build/src/core/model/type-name.cc.1.o build/src/core/model/attribute.cc.1.o build/src/core/model/boolean.cc.1.o build/src/core/model/integer.cc.1.o build/src/core/model/uinteger.cc.1.o build/src/core/model/enum.cc.1.o build/src/core/model/double.cc.1.o build/src/core/model/int64x64.cc.1.o build/src/core/model/string.cc.1.o build/src/core/model/pointer.cc.1.o build/src/core/model/object-ptr-container.cc.1.o build/src/core/model/object-factory.cc.1.o build/src/core/model/global-value.cc.1.o build/src/core/model/trace-source-accessor.cc.1.o build/src/core/model/config.cc.1.o build/src/core/model/callback.cc.1.o build/src/core/model/names.cc.1.o build/src/core/model/vector.cc.1.o build/src/core/model/fatal-impl.cc.1.o build/src/core/model/system-path.cc.1.o build/src/core/model/unix-system-wall-clock-ms.cc.1.o build/src/core/model/int64x64-128.cc.1.o build/src/core/model/unix-fd-reader.cc.1.o build/src/core/model/unix-system-thread.cc.1.o build/src/core/model/unix-system-mutex.cc.1.o build/src/core/model/unix-system-condition.cc.1.o -> build/libns3-core.dylib 10:58:49 runner ['/usr/bin/g++', 'src/core/model/time.cc.1.o', 'src/core/model/event-id.cc.1.o', 'src/core/model/scheduler.cc.1.o', 'src/core/model/list-scheduler.cc.1.o', 'src/core/model/map-scheduler.cc.1.o', 'src/core/model/heap-scheduler.cc.1.o', 'src/core/model/calendar-scheduler.cc.1.o', 'src/core/model/ns2-calendar-scheduler.cc.1.o', 'src/core/model/event-impl.cc.1.o', 'src/core/model/simulator.cc.1.o', 'src/core/model/simulator-impl.cc.1.o', 'src/core/model/default-simulator-impl.cc.1.o', 'src/core/model/timer.cc.1.o', 'src/core/model/watchdog.cc.1.o', 'src/core/model/synchronizer.cc.1.o', 'src/core/model/make-event.cc.1.o', 'src/core/model/log.cc.1.o', 'src/core/model/breakpoint.cc.1.o', 'src/core/model/type-id.cc.1.o', 'src/core/model/attribute-construction-list.cc.1.o', 'src/core/model/object-base.cc.1.o', 'src/core/model/ref-count-base.cc.1.o', 'src/core/model/object.cc.1.o', 'src/core/model/test.cc.1.o', 'src/core/model/random-variable.cc.1.o', 'src/core/model/rng-stream.cc.1.o', 'src/core/model/command-line.cc.1.o', 'src/core/model/type-name.cc.1.o', 'src/core/model/attribute.cc.1.o', 'src/core/model/boolean.cc.1.o', 'src/core/model/integer.cc.1.o', 'src/core/model/uinteger.cc.1.o', 'src/core/model/enum.cc.1.o', 'src/core/model/double.cc.1.o', 'src/core/model/int64x64.cc.1.o', 'src/core/model/string.cc.1.o', 'src/core/model/pointer.cc.1.o', 'src/core/model/object-ptr-container.cc.1.o', 'src/core/model/object-factory.cc.1.o', 'src/core/model/global-value.cc.1.o', 'src/core/model/trace-source-accessor.cc.1.o', 'src/core/model/config.cc.1.o', 'src/core/model/callback.cc.1.o', 'src/core/model/names.cc.1.o', 'src/core/model/vector.cc.1.o', 'src/core/model/fatal-impl.cc.1.o', 'src/core/model/system-path.cc.1.o', 'src/core/model/unix-system-wall-clock-ms.cc.1.o', 'src/core/model/int64x64-128.cc.1.o', 'src/core/model/unix-fd-reader.cc.1.o', 'src/core/model/unix-system-thread.cc.1.o', 'src/core/model/unix-system-mutex.cc.1.o', 'src/core/model/unix-system-condition.cc.1.o', '-o', '/Users/ruben/src/ns-3-dev/build/libns3-core.dylib', '-L/opt/local/lib', '-lgsl', '-lgslcblas', '-lm', '-dynamiclib'] [1362/1598] cxxshlib: build/src/click/test/ipv4-click-routing-test.cc.3.o -> build/libns3-click-test.dylib 10:58:50 runner ['/usr/bin/g++', 'src/click/test/ipv4-click-routing-test.cc.3.o', '-o', '/Users/ruben/src/ns-3-dev/build/libns3-click-test.dylib', '-L/Users/ruben/src/click-2.0.1/ns', '-lnsclick', '-ldl', '-dynamiclib'] [1363/1598] cxxshlib: src/click/model/ipv4-click-routing.cc.1.o src/click/model/ipv4-l3-click-protocol.cc.1.o src/click/helper/click-internet-stack-helper.cc.1.o -> build/libns3-click.dylib 10:58:50 runner ['/usr/bin/g++', '../src/click/model/ipv4-click-routing.cc.1.o', '../src/click/model/ipv4-l3-click-protocol.cc.1.o', '../src/click/helper/click-internet-stack-helper.cc.1.o', '-o', '/Users/ruben/src/ns-3-dev/build/libns3-click.dylib', '-L/Users/ruben/src/click-2.0.1/ns', '-lnsclick', '-ldl', '-dynamiclib'] Undefined symbols for architecture x86_64:
(In reply to comment #4) > Found the why... (not yet how to fix it, arghhh, I hate waf) > > For model, and helper, instead of having the object files built in > build/src/click/*, they are being built in src/click/* > I think you are jumping to a conclusion. It is not true that waf object files are in the source directory. At least it shouldn't be; at least isn't in Ubuntu. When interpreting the waf -v output of commands, keep in mind that waf does a chdir("build") before running the compilation commands, therefore all the paths printed are relative to the build dir.
Hi, thanks for looking into it. I'm not "jumping to a conclusion", I'm observing it. See [ruben@mbpruben ns-3-dev]$ pwd /Users/ruben/src/ns-3-dev [ruben@mbpruben ns-3-dev]$ ./waf ... Things horribly fail ... [ruben@mbpruben ns-3-dev]$ find src/ -iname *.o src//click/helper/click-internet-stack-helper.cc.1.o src//click/model/ipv4-click-routing.cc.1.o src//click/model/ipv4-l3-click-protocol.cc.1.o Now, if I cd into build, and myself execute the g++ commands, I actually manage to make it work. Here is a short log that indeed shows what waf is doing [729/893] cxx: src/click/model/ipv4-click-routing.cc -> src/click/model/ipv4-click-routing.cc.1.o 14:42:27 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-Ibuild', '-I.', '-I/Users/ruben/src/click-2.0.1/include', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DPYTHONDIR="/usr/local/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/site-packages"', '-DHAVE_PYTHON_H=1', '-DENABLE_GSL', '-DNS3_CLICK', '../src/click/model/ipv4-click-routing.cc', '-c', '-o', '../src/click/model/ipv4-click-routing.cc.1.o'] See towards the end? The source file is taken from ../src/click/model/ipv4-click-routing.cc (good), but the object file is put in ../src/click/model/ipv4-click-routing.cc.1.o (not good). To my current understanding, it should be src/click/model/ipv4-click-routing.cc.1.o (without the ../). R
Ah, and I know it is not happening in Ubuntu. This bug is happening on OS X Lion.
(In reply to comment #6) > Hi, thanks for looking into it. > > I'm not "jumping to a conclusion", I'm observing it. See > > [ruben@mbpruben ns-3-dev]$ pwd > /Users/ruben/src/ns-3-dev > [ruben@mbpruben ns-3-dev]$ ./waf > ... > Things horribly fail > ... > [ruben@mbpruben ns-3-dev]$ find src/ -iname *.o > src//click/helper/click-internet-stack-helper.cc.1.o > src//click/model/ipv4-click-routing.cc.1.o > src//click/model/ipv4-l3-click-protocol.cc.1.o > > Now, if I cd into build, and myself execute the g++ commands, I actually manage > to make it work. > > Here is a short log that indeed shows what waf is doing > > [729/893] cxx: src/click/model/ipv4-click-routing.cc -> > src/click/model/ipv4-click-routing.cc.1.o > 14:42:27 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', > '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', > '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-Ibuild', > '-I.', '-I/Users/ruben/src/click-2.0.1/include', '-DNS3_ASSERT_ENABLE', > '-DNS3_LOG_ENABLE', '-DSQLITE3=1', > '-DPYTHONDIR="/usr/local/lib/python2.7/site-packages"', > '-DPYTHONARCHDIR="/usr/local/lib/python2.7/site-packages"', > '-DHAVE_PYTHON_H=1', '-DENABLE_GSL', '-DNS3_CLICK', > '../src/click/model/ipv4-click-routing.cc', '-c', '-o', > '../src/click/model/ipv4-click-routing.cc.1.o'] > > See towards the end? The source file is taken from > ../src/click/model/ipv4-click-routing.cc (good), but the object file is put in > ../src/click/model/ipv4-click-routing.cc.1.o (not good). To my current > understanding, it should be src/click/model/ipv4-click-routing.cc.1.o (without > the ../). > It seems you are right. If so, it is a WAF bug. I'll have to reproduce, then try a newer WAF release to see if it fixes the problem.
What I find (very) strange, is that this is happening only for the click module... Argghhh. Tomh says he has a machine available. Let me reply to his email.
I find it strange that the build fails with undefined symbols, but when I list the files under src/click, recursively, I find no object files whatsoever. So, again I doubt your initial diagnosis...
In darwin build host I see: [1235/1353] cxx: src/click/test/ipv4-click-routing-test.cc -> build/src/click/test/ipv4-click-routing-test.cc.3.o 06:08:24 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-I../src/click', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-Ibuild', '-I.', '-I/Users/gjc/ns-3-allinone/click-2.0.1/include', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DNS3_CLICK', '-DNS_TEST_SOURCEDIR="src/click/test"', '../src/click/test/ipv4-click-routing-test.cc', '-c', '-o', 'src/click/test/ipv4-click-routing-test.cc.3.o'] So, the -o option is correct, it is outputting object files to the build dir, not source dir. So, in both OSX versions we have undefined symbols, but maybe for different reasons.
06:15:27 runner ['/usr/bin/g++', 'src/click/model/ipv4-click-routing.cc.1.o', 'src/click/model/ipv4-l3-click-protocol.cc.1.o', 'sr c/click/helper/click-internet-stack-helper.cc.1.o', '-o', '/Users/gjc/ns-3-allinone/ns-3-dev/build/libns3-click.dylib', '-L/Users/ gjc/ns-3-allinone/click-2.0.1/ns', '-lnsclick', '-ldl', '-dynamiclib'] Undefined symbols: "ns3::Node::RegisterProtocolHandler(ns3::Callback<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, n s3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>, unsigned short, ns3::Ptr <ns3::NetDevice>, bool)", referenced from: ns3::Ipv4L3ClickProtocol::AddInterface(ns3::Ptr<ns3::NetDevice>) in ipv4-l3-click-protocol.cc.1.o What I can see from here is simply that the link command is missing the other ns-3 modules that this module depends on. It should have -lns3-network, for instance, but it is not there. Hence the undefined symbols.
Please check if this fixes it: changeset: 7640:f048c64c18b7 tag: tip user: Gustavo J. A. M. Carneiro <gjc@inescporto.pt> date: Fri Dec 16 14:24:30 2011 +0000 summary: Bug 1298 - Undefined click symbols
Yes, I agree and I missed it. Your change fixes the build issue. Thanks, nice. But, on my host, I still have the object files for the click module showing up in $TOPDIR/src instead of $TOPDIR/build/src.
(In reply to comment #14) > Yes, I agree and I missed it. Your change fixes the build issue. Thanks, nice. > But, on my host, I still have the object files for the click module showing up > in $TOPDIR/src instead of $TOPDIR/build/src. On OS X Lion (just checked with this patch), it works for me and I do not have object files showing up in $TOPDIR/src. Is it possible that these object files are left around from before the patch?
Indeed, my bad. I was definitely too tired last week. Everything looks good.