Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error on OSX 10.9 (Homebrew) using a clean system #148

Open
brossi opened this issue Jan 22, 2015 · 3 comments
Open

Build error on OSX 10.9 (Homebrew) using a clean system #148

brossi opened this issue Jan 22, 2015 · 3 comments

Comments

@brossi
Copy link

brossi commented Jan 22, 2015

I've tried this a couple of different ways now using a clean VM of OSX 10.9 each time. In a few of the attempts I followed the "standard" set of instructions and compiled my own build of Boost 1.55.0, in others I used the version that Homebrew installs from its own package manager (Boost 1.57.0). In all cases I also took the steps needed to symlink the /usr/local/lib and /opt/local/lib directories when specified in @bitpar's "build-osx-brew-mavericks.txt instructions.

Ultimately, however, I end up with one common error, that I've added into a gist. When testing the compilation of the Peerunity daemon (peerunityd), running the command make -f makefile.osx-mavericks RELEASE=true 64BIT=true results in this error:

/bin/sh ../share/genbuild.sh obj/build.h
llvm-g++ -mmacosx-version-min=10.9 -O3 -arch x86_64 -w -Wextra -Wno-sign-compare -Wno-invalid-offsetof -Wformat-security  -DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -DUSE_IPV6 -DUSE_UPNP=1 -DHAVE_BUILD_INFO -I"/Users/mavbuild/Crypto/Peerunity/src" -I"/Users/mavbuild/Crypto/Peerunity/src/obj" -I"/usr/local/opt/berkeley-db4/include" -I"/usr/local/opt/boost/include" -o peerunityd -L"/lib" -L"/usr/local/opt/berkeley-db4/lib" -L"/usr/local/opt/boost/lib"  obj/version.o obj/checkpoints.o obj/netbase.o obj/addrman.o obj/crypter.o obj/key.o obj/db.o obj/init.o obj/irc.o obj/keystore.o obj/main.o obj/net.o obj/protocol.o obj/kernelrecord.o obj/bitcoinrpc.o obj/rpcdump.o obj/script.o obj/util.o obj/wallet.o obj/walletdb.o obj/noui.o obj/kernel.o -dead_strip -ldb_cxx-4.8 -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt -lssl -lcrypto -lz -lminiupnpc
Undefined symbols for architecture x86_64:
  "boost::program_options::detail::common_config_file_iterator::common_config_file_iterator(std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool)", referenced from:
      boost::program_options::detail::basic_config_file_iterator<char>::basic_config_file_iterator(std::__1::basic_istream<char, std::__1::char_traits<char> >&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool) in util.o
  "boost::program_options::to_internal(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      boost::program_options::detail::basic_config_file_iterator<char>::getline(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) in util.o
  "_TLSv1_1_method", referenced from:
      boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in bitcoinrpc.o
  "_TLSv1_1_client_method", referenced from:
      boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in bitcoinrpc.o
  "_TLSv1_1_server_method", referenced from:
      boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in bitcoinrpc.o
  "_TLSv1_2_server_method", referenced from:
      boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in bitcoinrpc.o
  "_TLSv1_2_method", referenced from:
      boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in bitcoinrpc.o
  "_TLSv1_2_client_method", referenced from:
      boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in bitcoinrpc.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: *** [peerunityd] Error 1

Curiously, when I compile Peershares using the "standard" set of environmental configurations (Homebrew; force linked OpenSSL and Berkeley-DB; self-compiled Boost 1.55.0, etc.) I do not experience this problem and I'm able to successfully create the daemon; both for local use and a statically-built version.

@brossi
Copy link
Author

brossi commented Jan 22, 2015

In case anyone runs into a different problem while attempting to replace this, I noticed an issue with net.cpp:56 that I'll submit a PR to fix:

array<int, THREAD_MAX> vnThreadsRunning;

Replace with:

boost::array<int, THREAD_MAX> vnThreadsRunning;

@brossi
Copy link
Author

brossi commented Jan 22, 2015

Update: The MacPorts instructions allow me to build the Peerunity daemon, so that's an improvement. I'm going to see if it compiles the QT application next.

Update 2: The QT application built successfully, so for the short-term, it looks like the way to go is to use the MacPorts instructions to set up an OSX build environment. I'd like to figure out why Homebrew isn't working any longer, but I'll need assistance digging into the configuration for that.

@brossi
Copy link
Author

brossi commented Mar 3, 2015

Source: http://redmine.webtoolkit.eu/boards/2/topics/8863

It turned out that I had two versions of ssl library. One under /usr/lib, while other being inside /opt/local/lib (which was installed via macports). The cmake discovered one under /usr/lib. I changed both include and lib to /opt/local/include and /opt/local/lib/libssl.dylib respectively. Thereafter compilation was smooth.

I'm going to see if this suggestion helps. I also just upgraded one of my OSX systems to 10.10 and will attempt to build from a clean system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant