Issues building Peercoind for the Mac (Fuzzy's branch)

I’m running into a snag while attempting to compile the Peercoin daemon (peercoind) using the most recent branch of Fuzzy’s. I’m pretty sure this is environment related, rather than an issue in the make file, but in case someone has any advice, I wanted to put it out there.

The machine that I’m using to build it is running OS X 10.9.1, and I think I’ve got all of the dependencies loaded correctly. Here’s the build error:

llvm-g++ -mmacosx-version-min=10.5 -O3 -arch x86_64 -Wextra -Wno-sign-compare -Wno-invalid-offsetof -Wformat-security  -DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -DUSE_UPNP=1 -DHAVE_BUILD_INFO -I"/Users/benrossi/Sites/crypto/ppcoin/src" -I"/Users/benrossi/Sites/crypto/ppcoin/src"/obj -I"/opt/local/include" -I"/opt/local/include/db48" -o peercoind -L"/opt/local/lib" -L"/opt/local/lib/db48" 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/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::set<std::string, std::less<std::string>, std::allocator<std::string> > const&, bool)", referenced from:
      boost::program_options::detail::basic_config_file_iterator<char>::basic_config_file_iterator(std::istream&, std::set<std::string, std::less<std::string>, std::allocator<std::string> > const&, bool) in util.o
  "boost::program_options::to_internal(std::string const&)", referenced from:
      boost::program_options::detail::basic_config_file_iterator<char>::getline(std::string&) in util.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: *** [peercoind] Error 1

hey ben is it related to this??

http://www.peercointalk.org/index.php?topic=2093.msg17548#msg17548

Fuzzybear

[quote=“FuzzyBear, post:2, topic:1918”]hey ben is it related to this??

http://www.peercointalk.org/index.php?topic=2093.msg17548#msg17548

Fuzzybear[/quote]

I thought it might be, so I made the change in my local branch, but still am running into the same issue.

My best guess is that it’s related to the Boost library attempting to use the 32-bit version, instead of the 64-bit like it should be. I’ve tried to force it, and from the logs, I can see that it’s loading with the “-mt” flag (which appears to be an indicator that it’s using the right ones).

I don’t know enough about the build process or the makefile to troubleshoot it, unfortunately.

u building on a 32 bit machine or 64? sounds like its missing the 64 libraries… so u on a 32 bit ?

Fuzzybear

[quote=“FuzzyBear, post:4, topic:1918”]u building on a 32 bit machine or 64? sounds like its missing the 64 libraries… so u on a 32 bit ?

Fuzzybear[/quote]

Nope, it’s a Mac Mini running 10.9.1. All of the dependencies have been loaded via MacPorts after I upgraded to 10.9.1, so it’s most likely not the case where I’m trying to load old libraries from some pre-64-bit time. I’ve tried to recompile Boost with the Boost::Program_Options add-on forced into 64-bit, but that didn’t help, either.

I’ve reached out to Jeff Larkin via a PM, so I’m hoping that he’s still checking that email address and that he has an option for me to try.

When I get home tonight I’m going to try to compile it on the new MacBook Pro that I have from work. If that throws up the same error, I’ll go down the path of trying to understand what the makefile is doing to see if there’s a latent 32-bit library call that is hard-coded.

Thanks Ben for PMing me, I hadn’t seen this thread. I suspect that the issue is coming from the build system using 32bit by default (legacy from bitcoin for maximum compatibility) and 10.9 switching to 64-bit only. I’m at work right now, I’ll look at it again tonight when I can get to my Mac, I think I put an option into the build system to build 64-bit. I remember having issues with boost when I first did the port and had to choose a very particular version. That may also be the issue. I’ve not upgraded to 10.9, so it may take us some back and forth to figure this out.

Looking back through my github commits, can you please try adding 64BIT=true to your make command?

Thanks, Jeff. I’ve been following your notes in the docs section of the build, and here’s the command that I’ve been invoking:

make -f makefile.osx RELEASE=true 64BIT=true

Running the make command with Clang’s -v invocation argument shows me what the problem is, I think, now it’s a matter of figuring out why it is trying to build it under the i386 architecture:

server:src benrossi$ make -f makefile.osx RELEASE=true 64BIT=true -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

Take two, with a manually compiled version of Berkeley DB vs. one pulled in from Homebrew or MacPorts:

In file included from checkpoints.cpp:12:
In file included from /Users/brossi/Sites/crypto/ppcoin-FuzzyBear/src/db.h:15:
/usr/local/include/db_cxx.h:60:10: fatal error: ‘exception.h’ file not found
#include <exception.h>
^
28 warnings and 1 error generated.
make: *** [obj/checkpoints.o] Error 1

Edit: Fixed with correct version of Berkeley DB 4.8.30.NC

Next error:

llvm-g++ -mmacosx-version-min=10.5 -O3 -arch x86_64 -Wextra -Wno-sign-compare -Wno-invalid-offsetof -Wformat-security  -DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -DUSE_UPNP=1 -DHAVE_BUILD_INFO -I"/Users/brossi/Sites/crypto/ppcoin-FuzzyBear/src" -I"/Users/brossi/Sites/crypto/ppcoin-FuzzyBear/src"/obj -I"/opt/local/include" -I"/opt/local/include/db48" -o peercoind -L"/opt/local/lib" -L"/opt/local/lib/db48" 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/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
ld: warning: directory not found for option '-L/opt/local/lib'
ld: warning: directory not found for option '-L/opt/local/lib/db48'
Undefined symbols for architecture x86_64:
  "boost::program_options::detail::common_config_file_iterator::common_config_file_iterator(std::set<std::string, std::less<std::string>, std::allocator<std::string> > const&, bool)", referenced from:
      boost::program_options::detail::basic_config_file_iterator<char>::basic_config_file_iterator(std::istream&, std::set<std::string, std::less<std::string>, std::allocator<std::string> > const&, bool) in util.o
  "boost::program_options::to_internal(std::string const&)", referenced from:
      boost::program_options::detail::basic_config_file_iterator<char>::getline(std::string&) 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: *** [peercoind] Error 1