Author

Topic: MAC OS X 10.9 Mavericks / Compile Hints / ALL *COIND AFFECTED (Read 2183 times)

legendary
Activity: 1024
Merit: 1004
What I've found is that if you install Boost via Brew or MacPorts you're likely going to have issues.

Apple's new compiler and linking tools is having fits with code compiled by the GCC system from what I can tell.

I've started rebuilding Boost from source and have been able to eliminate "boost::filesystem" link errors.  

Still wrestling with the program_options library for some reason.

Building your own libraries is definitely a key step in setting up a compiler environment for both OS X and Windows (especially Boost). As far as the undefined symbols for x86_64 errors go, are you sure that the file you're checking is the one that's actually being linked?

Totally agree here -- just wait until you get to packaging up a wallet for release ;-)

Oh the fun you'll have fixing and patching up the dylibs you will need to bundle with it

-dvd
legendary
Activity: 1024
Merit: 1004
Thanks for this info. Have you had any luck getting the x11 coins compiled?

Nothing on native 10.9

Though we did clean up a bunch of X11 related code that was missing function call typedefs Tongue

The solution was acquiring a 32-bit iMac and loading 10.6.8 on it -- that's how were able to build any and all wallets ATM.

-dvd
full member
Activity: 123
Merit: 104
What I've found is that if you install Boost via Brew or MacPorts you're likely going to have issues.

Apple's new compiler and linking tools is having fits with code compiled by the GCC system from what I can tell.

I've started rebuilding Boost from source and have been able to eliminate "boost::filesystem" link errors.  

Still wrestling with the program_options library for some reason.

Building your own libraries is definitely a key step in setting up a compiler environment for both OS X and Windows (especially Boost). As far as the undefined symbols for x86_64 errors go, are you sure that the file you're checking is the one that's actually being linked?
sr. member
Activity: 437
Merit: 250
Thanks for this info. Have you had any luck getting the x11 coins compiled?

legendary
Activity: 1024
Merit: 1004
What I've found is that if you install Boost via Brew or MacPorts you're likely going to have issues.

Apple's new compiler and linking tools is having fits with code compiled by the GCC system from what I can tell.

I've started rebuilding Boost from source and have been able to eliminate "boost::filesystem" link errors.  

Still wrestling with the program_options library for some reason.
legendary
Activity: 1024
Merit: 1004
So close...

I'm having linking issues and it affects both LITECOIND & GIVECOIND for 64bit on Mac OS X 10.9

Here's the error for LITECOIND:

Undefined symbols for architecture x86_64:
  "boost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option::enum_type, boost::system::error_code*)", referenced from:
      boost::filesystem::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option::enum_type) in walletdb.o
  "boost::program_options::to_internal(std::string const&)", referenced from:
      boost::program_options::detail::basic_config_file_iterator::getline(std::string&) in util.o
  "boost::program_options::detail::common_config_file_iterator::common_config_file_iterator(std::set, std::allocator > const&, bool)", referenced from:
      boost::program_options::detail::basic_config_file_iterator::basic_config_file_iterator(std::istream&, std::set, std::allocator > const&, bool) in util.o
  "Db::verify(char const*, char const*, std::ostream*, unsigned int)", referenced from:
      CDBEnv::Verify(std::string, bool (*)(CDBEnv&, std::string)) in db.o
      CDBEnv::Salvage(std::string, bool, std::vector >, std::vector > >, std::allocator >, std::vector > > > >&) in db.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: *** [litecoind] Error 1

AND THE ERROR FOR GIVECOIND:

Undefined symbols for architecture x86_64:
  "boost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option::enum_type, boost::system::error_code*)", referenced from:
      boost::filesystem::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option::enum_type) in walletdb.o
  "boost::program_options::to_internal(std::string const&)", referenced from:
      boost::program_options::detail::basic_config_file_iterator::getline(std::string&) in util.o
  "boost::program_options::detail::common_config_file_iterator::common_config_file_iterator(std::set, std::allocator > const&, bool)", referenced from:
      boost::program_options::detail::basic_config_file_iterator::basic_config_file_iterator(std::istream&, std::set, std::allocator > const&, bool) in util.o
  "Db::verify(char const*, char const*, std::ostream*, unsigned int)", referenced from:
      CDBEnv::Verify(std::string, bool (*)(CDBEnv&, std::string)) in db.o
      CDBEnv::Salvage(std::string, bool, std::vector >, std::vector > >, std::allocator >, std::vector > > > >&) in db.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: *** [Givecoind] Error 1

You can see that the 'file' command is showing that the boost library was built to x86_64

% file /usr/local/lib/libboost_filesystem-mt.dylib
/usr/local/lib/libboost_filesystem-mt.dylib: Mach-O 64-bit dynamically linked shared library x86_64
legendary
Activity: 1024
Merit: 1004
What a PITA this was!  For all of the following X11 hash functions:

bmw.c      echo.c      jh.c      luffa.c      simd.c
blake.c      cubehash.c   groestl.c   keccak.c   shavite.c   skein.c

I had to run in and put in explicit typecasts in front of a boatload of calls -- converted (void *) into the very specific type structures expected.  

EXAMPLE:

   blake32_init(cc, IV224, salt_zero_small);

INTO

   blake32_init((sph_blake_small_context *) cc, IV224, salt_zero_small);

-dvd
legendary
Activity: 1024
Merit: 1004
also need to do make this script executable if pulling from GIT

chmod 755 build_detect_platform

prior to running make -f makefile.osx

if you get link errors then

cd leveldb
make clean
cd ..
make -f makefile.osx

that will rebuild the level db correctly
legendary
Activity: 1024
Merit: 1004
I think I've fixed the leveldb problem by adding in "-arch x86_64" to the OPT line in the Makefile

OPT ?= -O2 -DNDEBUG -arch x86_64         # (A) Production use (optimized mode)

Now to deal with what looks like a problem finding BOOST
legendary
Activity: 1024
Merit: 1004
[NOTE: This was originally posted to the Bitcoin thread but just got moved to ALTS because I have NOW included the ADDITIONAL X11 hash suite changes required to get them to compile on Mac OS X 10.9 Mavericks.]

Having a deuce of a time getting ANY *COIND to compile on Mac OS X

This is about as far as I get:

ld: warning: ignoring file leveldb/libleveldb.a, file was built for archive which is not the architecture being linked (x86_64): leveldb/libleveldb.a


I have gone into the sub dir and run make separately and it will produce .dylib versions

Have also tried this route (lots of errors building boost from source)

http://techspry.com/how-to/how-to-install-litecoind-bitcoind-dogecoind-on-os-x-10-9-mavericks/

Any hints or links would be appreciated!

-dvd
Jump to: