BUILD_OS_X

albert edited this page Nov 7, 2018 · 10 revisions

OS X Build Instructions

===============================

  1. Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. Install dependencies:
brew update
brew install cmake wget git openssl autoconf automake doxygen libtool llvm@4
  1. Install boost 1.67
wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz -O  boost_1_67_0.tar.gz
tar -zxvf boost_1_67_0.tar.gz
cd boost_1_67_0 && chmod +x bootstrap.sh
./bootstrap.sh 
./b2 --buildtype=complete install toolset=clang cxxflags="-arch x86_64" linkflags="-arch x86_64" 
  1. Install llvm with 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 -p build && cd build
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=~/opt/wasm -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release ..
make -j4 install
  1. Build GXB-Core:
git clone https://github.com/gxchain/gxb-core
cd gxb-core && git checkout master
git submodule update --init --recursive

export LLVM_DIR=/usr/local/Cellar/llvm@4/4.0.1/lib/cmake/llvm
export WASM_ROOT=~/opt/wasm
mkdir -p build &&  cd build
cmake -DLLVM_DIR=$LLVM_DIR -DWASM_ROOT=$WASM_ROOT -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make install
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.