Alex Afanasyev wrote:
Can you provide more information on what exactly failed or this is all the output you're seeing? sudo
should be used only for installation stage (e.g., for sudo ./waf install
), all other stages should be run without.
We have seen something remotely related to this and it was because of different versions of python picked up by the system without and with python (e.g., you may be using pyenv
which is not used after sudo). You can try to run /usr/bin/python waf
and sudo /usr/bin/python waf
to check whether it fixes the issue.
Hi Alex,
Thanks for replying.
Now there are two cases, of which the first is:
If run waf configure without sudo, then it can't detect libndn-cxx, but I already include the path to libndn-cxx.pc in PKG_CONFIG_PATH, as following shows:
$ echo $PKG_CONFIG_PATH
/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:
$ sudo ls /usr/local/lib/pkgconfig/
libcdt.pc libcgraph.pc libgvc.pc libgvpr.pc liblab_gamut.pc libndn-cxx.pc libpathplan.pc libxdot.pc
so second case is run waf configure with sudo ( or with sudo /usr/bin/python):
then configure can be successfully done, but failure comes still in running waf ( with sudo /usr/bin/python):
[157/158] Linking build/bin/nfd-autoreg
tools/nfd-autoreg.cpp.2.o: In function `AutoregServer':
/home/pengzhou/git/NFD/build/../tools/nfd-autoreg.cpp:61: undefined reference to `ndn::nfd::FaceMonitor::FaceMonitor(ndn::Face&)'
collect2: error: ld returned 1 exit status
tools/nfdc/find-face.cpp.5.o: In function `nfd::tools::nfdc::FindFace::query()':
/home/pengzhou/git/NFD/build/../tools/nfdc/find-face.cpp:140: undefined reference to `ndn::nfd::FaceQueryFilter::empty() const'
collect2: error: ld returned 1 exit status
Waf: Leaving directory `/home/pengzhou/git/NFD/build'
Build failed
-> task in '../bin/nfd-autoreg' failed (exit status 1):
{task 140737297377040: cxxprogram nfd-autoreg.cpp.2.o,city-hash.cpp.2.o,config-file.cpp.2.o,global-io.cpp.2.o,manager-base.cpp.2.o,network-interface-predicate.cpp.2.o,network-interface.cpp.2.o,network.cpp.2.o,privilege-helper.cpp.2.o,random.cpp.2.o,rtt-estimator.cpp.2.o,scheduler.cpp.2.o,logger-factory.cpp.2.o,logger.cpp.2.o -> nfd-autoreg}
['/usr/bin/g++', '-pthread', '-pthread', '-pthread', 'tools/nfd-autoreg.cpp.2.o', 'core/city-hash.cpp.2.o', 'core/config-file.cpp.2.o', 'core/global-io.cpp.2.o', 'core/manager-base.cpp.2.o', 'core/network-interface-predicate.cpp.2.o', 'core/network-interface.cpp.2.o', 'core/network.cpp.2.o', 'core/privilege-helper.cpp.2.o', 'core/random.cpp.2.o', 'core/rtt-estimator.cpp.2.o', 'core/scheduler.cpp.2.o', 'core/logger-factory.cpp.2.o', 'core/logger.cpp.2.o', '-o', '/home/pengzhou/git/NFD/build/bin/nfd-autoreg', '-Wl,-Bstatic', '-L/usr/lib/x86_64-linux-gnu', '-Wl,-Bdynamic', '-L/usr/local/lib', '-L/usr/lib/x86_64-linux-gnu', '-lndn-cxx', '-lboost_system', '-lboost_filesystem', '-lboost_date_time', '-lboost_iostreams', '-lboost_regex', '-lboost_program_options', '-lboost_chrono', '-lboost_thread', '-lboost_log', '-lboost_log_setup', '-lboost_unit_test_framework', '-lcryptopp', '-lssl', '-lcrypto', '-lsqlite3', '-lrt', '-lpthread', '-lboost_system', '-lboost_chrono', '-lboost_program_options', '-lboost_thread', '-lboost_log', '-lboost_log_setup', '-lrt', '-lresolv']
-> task in '../bin/nfdc' failed (exit status 1):
{task 140737297434576: cxxprogram main.cpp.6.o,available-commands.cpp.5.o,channel-module.cpp.5.o,command-definition.cpp.5.o,command-parser.cpp.5.o,execute-command.cpp.5.o,face-id-fetcher.cpp.5.o,face-module.cpp.5.o,fib-module.cpp.5.o,find-face.cpp.5.o,format-helpers.cpp.5.o,forwarder-general-module.cpp.5.o,help.cpp.5.o,legacy-nfdc.cpp.5.o,legacy-status.cpp.5.o,rib-module.cpp.5.o,status-report.cpp.5.o,status.cpp.5.o,strategy-choice-module.cpp.5.o,city-hash.cpp.2.o,config-file.cpp.2.o,global-io.cpp.2.o,manager-base.cpp.2.o,network-interface-predicate.cpp.2.o,network-interface.cpp.2.o,network.cpp.2.o,privilege-helper.cpp.2.o,random.cpp.2.o,rtt-estimator.cpp.2.o,scheduler.cpp.2.o,logger-factory.cpp.2.o,logger.cpp.2.o -> nfdc}
['/usr/bin/g++', '-pthread', '-pthread', '-pthread', 'tools/nfdc/main.cpp.6.o', 'tools/nfdc/available-commands.cpp.5.o', 'tools/nfdc/channel-module.cpp.5.o', 'tools/nfdc/command-definition.cpp.5.o', 'tools/nfdc/command-parser.cpp.5.o', 'tools/nfdc/execute-command.cpp.5.o', 'tools/nfdc/face-id-fetcher.cpp.5.o', 'tools/nfdc/face-module.cpp.5.o', 'tools/nfdc/fib-module.cpp.5.o', 'tools/nfdc/find-face.cpp.5.o', 'tools/nfdc/format-helpers.cpp.5.o', 'tools/nfdc/forwarder-general-module.cpp.5.o', 'tools/nfdc/help.cpp.5.o', 'tools/nfdc/legacy-nfdc.cpp.5.o', 'tools/nfdc/legacy-status.cpp.5.o', 'tools/nfdc/rib-module.cpp.5.o', 'tools/nfdc/status-report.cpp.5.o', 'tools/nfdc/status.cpp.5.o', 'tools/nfdc/strategy-choice-module.cpp.5.o', 'core/city-hash.cpp.2.o', 'core/config-file.cpp.2.o', 'core/global-io.cpp.2.o', 'core/manager-base.cpp.2.o', 'core/network-interface-predicate.cpp.2.o', 'core/network-interface.cpp.2.o', 'core/network.cpp.2.o', 'core/privilege-helper.cpp.2.o', 'core/random.cpp.2.o', 'core/rtt-estimator.cpp.2.o', 'core/scheduler.cpp.2.o', 'core/logger-factory.cpp.2.o', 'core/logger.cpp.2.o', '-o', '/home/pengzhou/git/NFD/build/bin/nfdc', '-Wl,-Bstatic', '-L/usr/lib/x86_64-linux-gnu', '-Wl,-Bdynamic', '-L/usr/local/lib', '-L/usr/lib/x86_64-linux-gnu', '-lndn-cxx', '-lboost_system', '-lboost_filesystem', '-lboost_date_time', '-lboost_iostreams', '-lboost_regex', '-lboost_program_options', '-lboost_chrono', '-lboost_thread', '-lboost_log', '-lboost_log_setup', '-lboost_unit_test_framework', '-lcryptopp', '-lssl', '-lcrypto', '-lsqlite3', '-lrt', '-lpthread', '-lboost_system', '-lboost_chrono', '-lboost_program_options', '-lboost_thread', '-lboost_log', '-lboost_log_setup', '-lrt', '-lresolv']
Appreciate your help!