Skip to content

BUILD_OS_X

albert edited this page Aug 3, 2018 · 16 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 openssl wget git openssl autoconf automake doxygen libtool llvm@4
  1. Install boost 1.67
wget https://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.gz/download -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 cmake
cd /tmp && wget https://cmake.org/files/v3.11/cmake-3.11.0-Linux-x86_64.sh
mkdir -p /opt/cmake && chmod +x /tmp/cmake-3.11.0-Linux-x86_64.sh
bash /tmp/cmake-3.11.0-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
  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/llvm
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
Clone this wiki locally