Setting up C++ Ethereum on a new MacBook

Mr. Tim Siwula
Timothy Siwula’s Blog
2 min readAug 18, 2017

First thing first, install some dependencies baby:

brew install cmake llvm leveldb libmicrohttpd cryptopp

Then clone the main ethereum cpp client from github:

git clone https://github.com/ethereum/cpp-ethereum.git
cd cpp-ethereum
git submodule update --init
mkdir build && cd build
sudo cmake ..
sudo cmake --build .

If this does not work, then try try try again!

You need version 4 of clang installed.

brew install --with-toolchain llvm
brew info llvm

If the first line contains a 4.x.x, then you have it installed.

Next, make sure it is the default or first for the computer. Open a new terminal tab and type:

clang --version

If you again see clang version 4.x.x on the first line, you are good to go. If not you need to set an enviroment variable to tell the system to use this install as the default:

echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.zshrc

^ for zshell users, otherwise for bash users:

echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bashrc

Now open a new terminal tab and check the clang version again and you should see 4.x.x.

Now try to build it again:

sudo cmake --build .

If that fails try this:

echo 'export CC := /usr/local/opt/llvm/bin/clang' >> ~/.zshrc

and still yet if that fails …. try try try again thomas the train said:

<Install Xcode or the CLI from developer.apple.com/xcode>

brew update
brew upgrade
brew tap ethereum/ethereum
brew reinstall llvm

<At this point, close the terminal, and relaunch it.>

brew install leveldb libmicrohttpd cryptopp
brew install cpp-ethereum --devel --successful --verbose

Now try to build it again:

sudo cmake --build .

And that should work. If not make sure brew is health:

brew doctor
Your system is ready to brew.

For reference purposes:

  1. A gist log of errors encountered on mac.
  2. The gihub repo for ethereum/cpp-ethereum client source code.
  3. Credit to Artur’s post on github.

--

--