Sunday, June 8, 2014

Building Bitcoin & Litecoin, Mac & Linux


I'm trying to build my own altcoins (because I want to understand altcoin creation).

First of all, Litecoin is the best place to begin because most altcoin tutorials (eg. here and here and here) use it as the basis.  So I started just by downloading Litecoin source and building it.

On Mac:
  • I started with Homebrew but couldn't ever get past problems with boost:

Undefined symbols for architecture x86_64: "boost::program_options::to_internal(std::string const&amp;)", referenced from: boost::program_options::detail::basic_config_file_iterator<char>::getline(std::string&amp;) 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> &gt; const&amp;, bool)", referenced from: boost::program_options::detail::basic_config_file_iterator<char>::basic_config_file_iterator(std::istream&amp;, std::set<std::string std::less="" std::string="">, std::allocator<std::string> &gt; const&amp;, bool) in util.o "Db::verify(char const*, char const*, std::ostream*, unsigned int)", referenced from: CDBEnv::Verify(std::string, bool (*)(CDBEnv&amp;, std::string)) in db.o CDBEnv::Salvage(std::string, bool, std::vector<std::pair char="" std::allocator="" std::vector="" unsigned=""> &gt;, std::vector<unsigned char="" std::allocator="" unsigned=""> &gt; &gt;, std::allocator<std::pair char="" std::allocator="" std::vector="" unsigned=""> &gt;, std::vector<unsigned char="" std::allocator="" unsigned=""> &gt; &gt; &gt; &gt;&amp;) 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</unsigned></std::pair></unsigned></std::pair></std::string></std::string></char></std::string></std::string></char>
  • I tried with Bitcoin with Homebrew and finally got it to build, though "make check" failed.
  • I totally switched to MacPorts and got Bitcoin to build again (including "make check").
  • OK, but I want Litecoin... and again I get problems with boost:

llvm-g++ -c -stdlib=libstdc++ -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -DUSE_UPNP=1 -DUSE_IPV6=1 -I/Users/tlarson/dev/from-elsewhere/litecoin/src/leveldb/include -I/Users/tlarson/dev/from-elsewhere/litecoin/src/leveldb/helpers -DHAVE_BUILD_INFO -I"/Users/tlarson/dev/from-elsewhere/litecoin/src" -I"/Users/tlarson/dev/from-elsewhere/litecoin/src/obj" -I"/usr/local/include" -I"/usr/local/opt/berkeley-db4/include" -I"/usr/local/opt/openssl/include" -MMD -MF obj/alert.d -o obj/alert.o alert.cpp alert.cpp:6:10: fatal error: 'boost/algorithm/string/classification.hpp' file not found #include <boost algorithm="" classification.hpp="" string=""> ^ 1 error generated. make: *** [obj/alert.o] Error 1 </boost>


On Linux (Ubuntu):

  • Worked, though I had to include all optional items, and also build Berkely DB as instructed in the Bitcoin source and use it here (by setting BDB_INCLUDE_PATH and BDB_LIB_PATH).


I haven't tried Windows yet, since that seems even scarier!


No comments: