Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: TheLittleDuke on August 10, 2014, 03:36:23 PM



Title: MAC OS X 10.9 Mavericks / Compile Hints / ALL *COIND AFFECTED
Post by: TheLittleDuke on August 10, 2014, 03:36:23 PM
[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


Title: leveldb / partial solve
Post by: TheLittleDuke on August 10, 2014, 08:53:31 PM
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


Title: Re: MAC OS X 10.9 Mavericks / leveldb chmod needed
Post by: TheLittleDuke on August 11, 2014, 01:17:18 AM
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


Title: X11 / source / function call clean up...
Post by: TheLittleDuke on August 11, 2014, 01:41:55 AM
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


Title: BOOST ISSUES / AFFECTS LITECOIND & GIVECOIND...
Post by: TheLittleDuke on August 11, 2014, 02:20:32 AM
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<char>::getline(std::string&) in util.o
  "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
  "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::pair<std::vector<unsigned char, std::allocator<unsigned char> >, std::vector<unsigned char, std::allocator<unsigned char> > >, std::allocator<std::pair<std::vector<unsigned char, std::allocator<unsigned char> >, std::vector<unsigned char, std::allocator<unsigned char> > > > >&) 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<char>::getline(std::string&) in util.o
  "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
  "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::pair<std::vector<unsigned char, std::allocator<unsigned char> >, std::vector<unsigned char, std::allocator<unsigned char> > >, std::allocator<std::pair<std::vector<unsigned char, std::allocator<unsigned char> >, std::vector<unsigned char, std::allocator<unsigned char> > > > >&) 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


Title: MAC OS X 10.9 Mavericks / Rebuild ALL with same compiler is key
Post by: TheLittleDuke on August 11, 2014, 06:24:30 PM
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.


Title: Re: MAC OS X 10.9 Mavericks / Compile Hints / ALL *COIND AFFECTED
Post by: cryptowest on September 22, 2014, 08:43:28 AM
Thanks for this info. Have you had any luck getting the x11 coins compiled?



Title: Re: MAC OS X 10.9 Mavericks / Rebuild ALL with same compiler is key
Post by: johnnyrocket on September 22, 2014, 09:01:45 AM
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?


Title: Re: MAC OS X 10.9 Mavericks / Compile Hints / ALL *COIND AFFECTED
Post by: TheLittleDuke on September 22, 2014, 01:40:59 PM
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 :P

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


Title: Re: MAC OS X 10.9 Mavericks / Rebuild ALL with same compiler is key
Post by: TheLittleDuke on September 22, 2014, 01:42:09 PM
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