named-data-ndnSIM / ndnSIM

ndnSIM: NS-3 based NDN simulator
GNU General Public License v3.0
107 stars 163 forks source link

CryptoPP is present, but is not usable #81

Open boaerosuke opened 6 years ago

boaerosuke commented 6 years ago

After following the instructions here: http://ndnsim.net/2.3/getting-started.html

./waf configure fails with

CryptoPP is present, but is not usable

and makes it impossible to use ndnSIM

the error appears regardless the installation with macports or brew on a mac 10.12.5. In the logs, the error says Undefined symbols for architecture x86_64. There is also a deprecation hint regarding libstdc++

err: clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
Undefined symbols for architecture x86_64:

"CryptoPP::HashFilter::HashFilter(CryptoPP::HashTransformation&, CryptoPP::BufferedTransformation*, bool, int, std::string const&, std::string const&)", referenced from:
      _main in test.cpp.1.o

...
ld: symbol(s) not found for architecture x86_64

Is this a bug with the installation?

cawka commented 6 years ago

This error is very suspicious:

err: clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]

Are you somehow using clang with libstdc++? This combination is known not to work, you should use standard clang's libraries.


macOS is known for a bit confusing dependency management. Recently, I have been using only homebrew installation of dependencies (a few things are missing, which make visualizer not usable; other things are working). I would recommend switching to homebrew if you use macports. If you need visualizer, I would recommend using a Linux VM. You would spend way less time to do set up.

boaerosuke commented 6 years ago

First of all thank you very much for answering :)

Are you somehow using clang with libstdc++? This combination is known not to work, you should use standard clang's libraries. Is there a way to change this for the installation of ndnSIM?

I managed to download build and install crypto++ by hand. I have build the source with specific flags regarding libc++. The make was successfull, also the test was successful which means that I can use the library since it works.

But when I want to configure ndnSIM with ./waf confiugre --with-cryptopp=/path/to/my/testedcryptopp It still fails with: Checking Crypto++ lib : 6.0.0 Checking if CryptoPP library works : no Checking if CryptoPP library works : no CryptoPP is present, but is not usable

This is the log when it tries to check if CryptoPP (which I tested ) works https://pastebin.com/X6yZBdzQ

any ideas?

cawka commented 6 years ago

The error suggesting that you are linking to some other version of libcrypto++.dylib installed on your system. You need to find and delete all other versions.

I would also not use non-released version of the library. The latest release is 5.6.5 and I would use homebrew to install it.

boaerosuke commented 6 years ago

Hi @cawka ! I really appreciate your help and I had a look on your assumptions. I tried the configuration with multiple versions of cryptopp and as you mentioned used the installation based on homebrew. Eventhough I checkt the other versions of libcrypto and tried to delete them, I still have the same problem. I tried a build on another mac system and faced the same error.

Therefore I will try to set it up on a linux machine.

Here is my last log. I think there must be something wrong with the test.cpp.1.o. Because it only fails on the testingphase of ./waf config. I can´t actually see where this file comes from and how I could analyse it´s behaviour.

`Undefined symbols for architecture x86_64: "std::1::basic_string<char, std::__1::char_traits, std::1::allocator >::init(char const, unsigned long)", referenced from: _main in test.cpp.1.o CryptoPP::AlgorithmImpl<CryptoPP::IteratedHash<unsigned int, CryptoPP::EnumToType<CryptoPP::ByteOrder, 1>, 64u, CryptoPP::HashTransformation>, CryptoPP::SHA256>::AlgorithmName() const in test.cpp.1.o CryptoPP::Clonable::Clone() const in test.cpp.1.o CryptoPP::Algorithm::AlgorithmName() const in test.cpp.1.o CryptoPP::memcpy_s(void, unsigned long, void const, unsigned long) in test.cpp.1.o CryptoPP::AlgorithmParametersBase::ParameterNotUsed::ParameterNotUsed(char const) in test.cpp.1.o CryptoPP::NameValuePairs::ThrowIfTypeMismatch(char const*, std::type_info const&, std::type_info const&) in test.cpp.1.o ... "std::1::basic_string<char, std::1::char_traits, std::1::allocator >::init(char const*, unsigned long, unsigned long)", referenced from: std::__1::basic_string<char, std::1::char_traits, std::1::allocator > std::1::operator+<char, std::1::char_traits, std::1::allocator >(std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, char const*) in test.cpp.1.o std::1::basic_string<char, std::1::char_traits, std::1::allocator > std::1::operator+<char, std::__1::char_traits, std::1::allocator >(char const, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) in test.cpp.1.o "std::1::basic_string<char, std::__1::char_traits, std::1::allocator >::append(char const, unsigned long)", referenced from: std::1::basic_string<char, std::__1::char_traits, std::1::allocator > std::1::operator+<char, std::1::char_traits, std::1::allocator >(std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, char const*) in test.cpp.1.o std::1::basic_string<char, std::1::char_traits, std::1::allocator > std::1::operator+<char, std::1::char_traits, std::1::allocator >(char const*, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&) in test.cpp.1.o "std::1::basic_string<char, std::1::char_traits, std::__1::allocator >::basic_string(std::1::basic_string<char, std::1::char_traits, std::__1::allocator > const&)", referenced from: CryptoPP::Clonable::Clone() const in test.cpp.1.o CryptoPP::memcpy_s(void, unsigned long, void const, unsigned long) in test.cpp.1.o CryptoPP::AlgorithmParametersBase::ParameterNotUsed::ParameterNotUsed(char const*) in test.cpp.1.o CryptoPP::NameValuePairs::ValueTypeMismatch::ValueTypeMismatch(std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::type_info const&, std::type_info const&) in test.cpp.1.o CryptoPP::InputRejecting::InputRejected::InputRejected() in test.cpp.1.o "std::1::basic_string<char, std::1::char_traits, std::1::allocator >::~basic_string()", referenced from: _main in test.cpp.1.o CryptoPP::Clonable::Clone() const in test.cpp.1.o CryptoPP::NotImplemented::~NotImplemented() in test.cpp.1.o CryptoPP::NotImplemented::~NotImplemented() in test.cpp.1.o CryptoPP::Exception::~Exception() in test.cpp.1.o CryptoPP::Exception::~Exception() in test.cpp.1.o CryptoPP::memcpy_s(void, unsigned long, void const, unsigned long) in test.cpp.1.o ... "std::__1::cout", referenced from: _main in test.cpp.1.o "typeinfo for std::1::ios_base", referenced from: typeinfo for std::__1::basic_ios<char, std::__1::char_traits > in test.cpp.1.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

from /Users/elu/Thesis/ndnSIM/ns-3/src/ndnSIM: Test does not build: Traceback (most recent call last): File "/Users/elu/Thesis/ndnSIM/ns-3/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Configure.py", line 339, in run_build bld.compile() File "/Users/elu/Thesis/ndnSIM/ns-3/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Build.py", line 182, in compile raise Errors.BuildError(self.producer.error) BuildError: Build failed -> task in 'testprog' failed (exit status 1): {task 4393292944: cxxprogram test.cpp.1.o -> testprog} ['/usr/bin/clang++', 'test.cpp.1.o', '-o', '/Users/elu/Thesis/ndnSIM/ns-3/build/.conf_check_38b7c50181d00abd8c740113bb210d8d/testbuild/testprog', '-L/usr/local/lib', '-lcryptopp', '-lpthread']

no from /Users/elu/Thesis/ndnSIM/ns-3/src/ndnSIM: The configuration failed from /Users/elu/Thesis/ndnSIM/ns-3/src/ndnSIM: CryptoPP is present, but is not usable sis/ndnSIM/ns-3/src/ndnSIM: The configuration failed `

PS: If you happen to be affected by the hurricane Irma, good luck to you!!