EOS Build Guide on Mac OS

in #eosdev7 years ago (edited)

Here is a brief guide to show you how to build the eos on MacOS Sierra 10.12.6. If you use Ubuntu, please check this article : EOS Build Guide on Ubuntu. And this is a traditional installation, not built from Docker.

Upgrate your XCode

This step is very important, please upgrate the xcode verision >=8.3.3

xcode-select --install

Install Dependencies

We use homebrew as our package manager, please install it first. Then execute the following:

brew install automake libtool boost openssl llvm

Install secp256k1-zkp

git clone https://github.com/cryptonomex/secp256k1-zkp.git  
cd secp256k1-zkp
./autogen.sh
./configure
make
sudo make install

Build LLVM and clang for WASM

mkdir  ~/wasm-compiler
cd ~/wasm-compiler
git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/llvm.git
cd llvm/tools
git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/clang.git
cd ..
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=.. -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release ../
make -j4 install

Add WASM_LLVM_CONFIG and LLVM_DIR to your .zshrc or . bash_profile

echo "export WASM_LLVM_CONFIG=~/wasm-compiler/llvm/bin/llvm-config" >> ~/.zshrc
echo "export LLVM_DIR=/usr/local/Cellar/llvm/4.0.1/lib/cmake/llvm" >> ~/.zshrc
source ~/.zshrc

Using the WASM compiler to perform a full build of the project

git clone https://github.com/eosio/eos --recursive
mkdir -p eos/build && cd eos/build
cmake ..
make -j4

Configure the testnet

cd tests
./chain_test

Produce the blocks

cd eos/programs/eosd
./eosd    # Ctrl+C after run to create config file
vim ./data-dir/config.ini

The sample config.ini

# Load the testnet genesis state, which creates some initial block producers with the default key
genesis-json = /YOUR_PATH/eos/genesis.json
# Enable production on a stale chain, since a single-node test chain is pretty much always stale
enable-stale-production = true
# Enable block production with the testnet producers
producer-name = inita
producer-name = initb
producer-name = initc
producer-name = initd
producer-name = inite
producer-name = initf
producer-name = initg
producer-name = inith
producer-name = initi
producer-name = initj
producer-name = initk
producer-name = initl
producer-name = initm
producer-name = initn
producer-name = inito
producer-name = initp
producer-name = initq
producer-name = initr
producer-name = inits
producer-name = initt
producer-name = initu
# Load the block producer plugin, so we can produce blocks
plugin = eos::producer_plugin

Produce new blocks

./eosd

You are done!!

End

It took me one night to solve a lot of problems, if you have other troubles, just let me know. I will update this guid based on your feedback. Hope it helps you.

Appreciation

区块链技术EOS开发系列之Mac下的编译
EOS Build Guide on Ubuntu
EOS Github

Sort:  

The step make -j4 in Using the WASM compiler to perform a full build of the project is broken for OSX 10.12. Please refer to the following EOS issue:

Thanks. However, I couldn't update the post any more.

It´s been fixed now anyways :)

For OSX Sierra on the Using the WASM compiler to perform a full build of the project step I had to change:

  • cmake ..
    for
  • cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib ..

thank you

大约需要多少空间?MacBook硬盘太小

差不多10G,我mac总容量256G.

EOS Dawn 3.0后内存要求比较高吧?

Congratulations @skenan! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You got your First payout

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

不错啊,有没有啥group可以交流下eos

最近没有时间看,telegram上有群组

Hi, I'm getting this error when running cmake .. Under the WASM compiler build section. Any tips on how to fix it?

CMake Error at /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 
(message):
  Could NOT find GMP (missing: GMP_LIBRARIES GMP_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:377 
(_FPHSA_FAILURE_MESSAGE)
  libraries/fc/CMakeModules/FindGMP.cmake:50 (find_package_handle_standard_args)
  libraries/fc/CMakeLists.txt:20 (find_package)

Hi, I didn't play eos for a long time. Could you please search or post this issue in Github? https://github.com/EOSIO/eos

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.028
BTC 54610.81
ETH 2293.78
USDT 1.00
SBD 2.35