Take the 2-minute tour ×
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It's 100% free, no registration required.

I've read the README on the bitcoin github page which instructs you to install the following libraries using MacPorts - boost db48 dbus openssl.

I have these installed using homebrew which I use instead of MacPorts. They are also the correct versions as homebrew installs, later, incompatible versions.

With these installed I edited the make to point to the libraries homebrew installed namely DEPSDIR=/usr/local and adding -I"$(DEPSDIR)/Cellar/berkeley-db4/4.8.30/include" to INCLUDEPATHS

However I'm getting this compiler error which is cryptic to me:

http://pastebin.com/6ey859uK

Has anybody managed to get this working?

share|improve this question
add comment

1 Answer

Update: These instructions or similar are included in the bitcoin source as of 19 February 2013. See doc/build-osx.md for details. As such, the below instructions may fall out of date. Alternatively, make it easy on yourself an use WyseNynja's homebrew tap with brew tap wysenynja/bitcoin && brew install bitcoind.

Building bitcoind on OSX 10.8 with homebrew

I got bitcoind working using these instructions. For reference, I'm on OSX 10.8.2 with homebrew 0.9.3. I've made an assumption throughout that homebrew is installed in /usr/local. I've also assumed that you've installed the Xcode command line utilities and any other packages that are essential to building code. If you build any code regularly, e.g. you have RVM installed to build ruby occasionally, you're probably OK!

Install some necessary libraries from homebrew.

brew install boost miniupnpc openssl

Revert berkeley-db formula to an older version

cd /usr/local
git checkout e6a374d Library/Formula/berkeley-db.rb

You may have to unlink it if you've already installed the latest version.

brew unlink berkeley-db

Install berkeley-db 4.8 now that you've got the right formula in place.

brew install berkeley-db

Checkout from Github.

git clone https://github.com/bitcoin/bitcoin.git

Edit the makefile.osx to change it a bit. Here's a diff that shows what you need to change, or you can just use this as a patch by doing echo '$patch-text' | patch, where $patch-text is the patch text below.

diff --git a/src/makefile.osx b/src/makefile.osx
index 9629545..ffac9a3 100644
--- a/src/makefile.osx
+++ b/src/makefile.osx
@@ -7,17 +7,19 @@
 # Originally by Laszlo Hanyecz (solar@heliacal.net)

 CXX=llvm-g++
-DEPSDIR=/opt/local
+DEPSDIR?=/opt/local

 INCLUDEPATHS= \
  -I"$(CURDIR)" \
  -I"$(CURDIR)"/obj \
  -I"$(DEPSDIR)/include" \
- -I"$(DEPSDIR)/include/db48"
+ -I"$(DEPSDIR)/include/db48" \
+ -I"/usr/local/Cellar/openssl/1.0.1c/include"

 LIBPATHS= \
  -L"$(DEPSDIR)/lib" \
- -L"$(DEPSDIR)/lib/db48"
+ -L"$(DEPSDIR)/lib/db48" \
+ -L"/usr/local/Cellar/openssl/1.0.1c/lib"

 USE_UPNP:=1
 USE_IPV6:=1

Start the build.

cd bitcoin/src
make -f makefile.osx DEPSDIR=/usr/local

It's now available at ./bitcoind. We have to first create the rpc configuration file, though. Run ./bitcoind to get the filename where it should be put, or just try the below text.

echo "rpcuser=bitcoinrpc
rpcpassword=HdAseQSRkirfoNuUSzqzixyL9sM1T6ABfzV1nyNmbuwg" > "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf"
chmod 600 "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf"

When next you run it, it will start downloading the blockchain, but it won't output anything while it's doing this. This process may take several hours.

Mine appears to be working fine, but it's still downloading the blockchain. I'll be able to tell after some testing if it's working normally or not, but I suspect that it is!

Inspirations:

share|improve this answer
    
brew install berkeley-db is throwing Error: No available formula for berkeley-db –  Petr Peller Jan 23 at 10:05
    
It works with formula in HEAD. Perhaps the commit hash is wrong? –  Petr Peller Jan 23 at 10:06
    
You'll want to use the berkeley-db4 formula now from homebrew-versions. That commit hash was for when the berkeley-db formula didn't have separate branches. –  Colin Dean Jan 24 at 14:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.