[Nfd-dev] Compiling NFD on MacOS

Davide Pesavento davide.pesavento at lip6.fr
Fri Oct 27 15:07:53 PDT 2017


On Fri, Oct 27, 2017 at 3:16 PM, Md Ashiqur Rahman
<marahman at email.arizona.edu> wrote:
> Hello,
>
> I'm trying to compile NFD on MacOS without root access and getting error. I
> have never tried nfd on macos before.
>
> Here are the steps I'm following:
>
> # ndn-cxx
> git clone https://github.com/named-data/ndn-cxx.git
> cd ndn-cxx
> ./waf configure --prefix=/Users/marahman/ndn-lib/ndn-cxx/ --debug
> --with-tests --with-examples
> ./waf
> ./waf install
> cd ..
>
> # nfd
> git clone ssh://Ashiq@gerrit.named-data.net:29418/NFD
> cd NFD
> export PKG_CONFIG_PATH=/Users/marahman/ndn-lib/ndn-cxx/lib/pkgconfig
> export LD_LIBRARY_PATH=/Users/marahman/ndn-lib/ndn-cxx/lib:$LD_LIBRARY_PATH

macOS has DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH, but this is
irrelevant at build time anyway. You can/should specify it when you
run nfd or other binaries linked against ndn-cxx though.

> CXXFLAGS="-I/Users/marahman/ndn-lib/ndn-cxx/include"
> LDFLAGS="-L/Users/marahman/ndn-lib/ndn-cxx/lib" ./waf configure --debug

These two variables should _not_ be needed. PKG_CONFIG_PATH should be enough.

> --with-tests
> ./waf
>
> I get the following error when compiling NFD:
>
> [287/297] Linking build/bin/ndn-autoconfig
> Undefined symbols for architecture x86_64:
>   "ndn::ip::addressFromString(std::__1::basic_string<char,
> std::__1::char_traits<char>, std::__1::allocator<char> > const&)",
> referenced from:
>       nfd::operator>>(std::__1::basic_istream<char,
> std::__1::char_traits<char> >&, nfd::Network&) in network.cpp.2.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
> Undefined symbols for architecture x86_64:
>   "ndn::ip::addressFromString(std::__1::basic_string<char,
> std::__1::char_traits<char>, std::__1::allocator<char> > const&)",
> referenced from:
>       nfd::operator>>(std::__1::basic_istream<char,
> std::__1::char_traits<char> >&, nfd::Network&) in network.cpp.2.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
>

Make sure you don't have old copies of the library lying around.

Best,
Davide


More information about the Nfd-dev mailing list