Showing posts with label Mac. Show all posts
Showing posts with label Mac. Show all posts

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!


Wednesday, August 4, 2010

Mac annoyances (for a developer)

I'm switching to a Mac at work, mostly because it is recommended by other developers I respect.  But when it comes to productivity, I don't think it's going to make much of a difference: there are a bunch of features I had on my previous Linux (Ubuntu 10.4) laptop that just don't work well on the Mac.  Here is my list, in case Steve Jobs asks me later.
  • Apple has that stupid custom COMMAND button, just like Windows has their stupid custom START and MENU buttons.  It wouldn't be so bad if I could ignore it or use it in place of ALT, but it's used in most of the keyboard shortcuts, and the placement of the ALT and COMMAND keys on a connected keyboard is exactly reversed from the laptop keyboard.  I'm afraid I'll have to remap the keys whenever I connect my keyboard.  Ug.  I would love a good solution to this one.
  • Speaking of buttons, why doesn't the default keyboard have DELETE, HOME, END, PAGE-UP, and PAGE-DOWN?  I'll live since they usually work on my connected keyboard, but I emphasize "usually": for example, the HOME and END buttons do nothing as I'm writing this post in my browser.  Great... do I start learning Mac shortcuts for those?
  • Depending on the focus, keyboard shortcuts for enclosing windows don't fire.  For example, in Safari, if my cursor is in a text box, then I cannot switch to the next tab using my keyboard.  I get the same behavior in Eclipse... I just get stuck if my cursor isn't in just the right place.  Ouch.
  • I often want to resize a window by grabbing it's border on, say, the left side... or somewhere besides the bottom-right corner.
  • It's hard to navigate through the menu bar.  To get into a menu, I have to get to the menu bar, then type the first letter of the desired menu, then hit ENTER; on my other systems, one key combination will take me to the desired menu (eg. ALT+F for the "File" menu).
  • The menu bar contains many different sections: app operations, services, time, the Apple menu.  Why can't I separate them out and put the time where I'm accustomed to seeing it?
  • Any why does the menu bar always have to be at the top?  I'm accustomed to accessing system applications (eg. services) on the bottom.  Also, I put my dual screens on top of one another... luckily I can configure the menu bar to go at the top of my second monitor, or I would have been outright pissed (since it would have been in the middle of both screens).

I admit to being a Mac newbie, so I appreciate if you know any solutions that help with this stuff.  (But if you're going to say that I should buy a Mac keyboard or learn The Mac Way, please realize that I'll always do development work on some of my own machines where I run Linux (and I regularly hop on other people's Windows machines), so totally converting myself to the proprietary Mac approach isn't very attractive.)

Maybe I'm the wrong audience for this thing!?