提交 7aca4847 编写于 作者: D Daniel Larimer

Merge branch 'master' into contextfree

......@@ -12,6 +12,12 @@ developing applications (smart contracts).
The public testnet described in the [wiki](https://github.com/EOSIO/eos/wiki/Testnet%3A%20Public) is running the `dawn-2.x` branch. The `master` branch is no longer compatible with the public testnet. Instructions are provided below for building either option.
### Supported Operating Systems
EOS.IO currently supports the following operating systems:
1. Ubuntu 16.04 and higher (Ubuntu 16.10 recommended).
2. MacOS Darwin 10.12 and higher (MacOS 10.13.x recommended).
3. Fedora 25 and higher (Fedora 27 recommended).
# Resources
1. [EOS.IO Website](https://eos.io)
2. [Documentation](https://eosio.github.io/eos/)
......@@ -27,10 +33,10 @@ The public testnet described in the [wiki](https://github.com/EOSIO/eos/wiki/Tes
1. [Getting Started](#gettingstarted)
2. [Setting up a build/development environment](#setup)
1. [Automated build script](#autobuild)
1. [Clean install Ubuntu 16.10 for a local testnet](#autoubuntulocal)
2. [Clean install Ubuntu 16.10 for the public testnet](#autoubuntupublic)
3. [MacOS Sierra 10.12.6 for a local testnet](#automaclocal)
4. [MacOS Sierra 10.12.6 for the public testnet](#automacpublic)
1. [Clean install Linux (Ubuntu & Fedora) for a local testnet](#autoubuntulocal)
2. [Clean install Linux (Ubuntu & Fedora) for the public testnet](#autoubuntupublic)
3. [MacOS for a local testnet](#automaclocal)
4. [MacOS for the public testnet](#automacpublic)
3. [Building EOS and running a node](#runanode)
1. [Getting the code](#getcode)
2. [Building from source code](#build)
......@@ -48,8 +54,9 @@ The public testnet described in the [wiki](https://github.com/EOSIO/eos/wiki/Tes
7. [Doxygen documentation](#doxygen)
8. [Running EOS in Docker](#docker)
9. [Manual installation of the dependencies](#manualdep)
1. [Clean install Ubuntu 16.10](#ubuntu)
2. [MacOS Sierra 10.12.6](#macos)
1. [Clean install Ubuntu 16.04 and higher](#ubuntu)
2. [MacOS Sierra 10.12 and higher](#macos)
3. [Fedora 25 and higher](#fedora)
<a name="gettingstarted"></a>
## Getting Started
......@@ -61,31 +68,34 @@ The following instructions detail the process of getting the software, building
<a name="autobuild"></a>
### Automated build script
For Ubuntu 16.10 and MacOS Sierra, there is an automated build script that can install all dependencies and builds EOS.
Supported Operating Systems:
1. Ubuntu 16.04 and higher.
2. MacOS Darwin 10.12 and higher.
3. Fedora 25 and higher.
It is called eosio-build.sh with the following inputs.
- architecture [ubuntu|darwin]
- optional mode [full|build]
For Ubuntu, MacOS and Fedora there is an automated build script that can install all dependencies and builds EOS.
We are working on supporting Centos, Amazon Linux & Red Hat in future releases.
The second optional input can be `full` or `build` where `full` implies that it installs dependencies and builds eos. If you omit this input then the build script installs dependencies and then builds eos.
It is called eosio_build.sh
```bash
./eosio-build.sh <architecture> <optional mode>
cd eos
./eosio_build.sh
```
Choose whether you will be building for a local testnet or for the public testnet and jump to the appropriate section below. Clone the EOS repository recursively as described and run eosio-build.sh located in the root `eos` folder.
Choose whether you will be building for a local testnet or for the public testnet and jump to the appropriate section below. Clone the EOS repository recursively as described and run eosio_build.sh located in the root `eos` folder.
:warning: **As of February 2018, `master` is under heavy development and is not suitable for experimentation.** :warning:
We strongly recommend following the instructions for building the public testnet version for [Ubuntu](#autoubuntupublic) or [Mac OS X](#automacpublic). `master` is in pieces on the garage floor while we rebuild this hotrod. This notice will be removed when `master` is usable again. Your patience is appreciated.
<a name="autoubuntulocal"></a>
#### :no_entry: Clean install Ubuntu 16.10 for a local testnet :no_entry:
#### :no_entry: Clean install Linux (Ubuntu & Fedora) for a local testnet :no_entry:
```bash
git clone https://github.com/eosio/eos --recursive
cd eos
./eosio-build.sh ubuntu
./eosio_build.sh
```
For ease of contract development, one further step is required:
......@@ -97,14 +107,15 @@ sudo make install
Now you can proceed to the next step - [Creating and launching a single-node testnet](#singlenode)
<a name="autoubuntupublic"></a>
#### Clean install Ubuntu 16.10 for the public testnet
#### Clean install Linux (Ubuntu & Fedora) for the public testnet
```bash
git clone https://github.com/eosio/eos --recursive
cd eos
git checkout dawn-2.x
./build.sh ubuntu
git checkout DAWN-2018-01-25
./eosio_build.sh
```
For ease of contract development, one further step is required:
......@@ -116,22 +127,18 @@ sudo make install
Now you can proceed to the next step - [Running a node on the public testnet](#publictestnet)
<a name="automaclocal"></a>
#### :no_entry: MacOS Sierra for a local testnet :no_entry:
#### :no_entry: MacOS for a local testnet :no_entry:
Before running the script make sure you have updated XCode and brew:
Before running the script make sure you have installed/updated XCode. Note: The build script
will install homebrew if it is not already installed on you system. [Homebrew Website](https://brew.sh)
```bash
xcode-select --install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```
Then clone the EOS repository recursively and run eosio-build.sh in the root `eos` folder.
Then clone the EOS repository recursively and run eosio_build.sh in the root `eos` folder.
```bash
git clone https://github.com/eosio/eos --recursive
cd eos
./eosio-build.sh darwin
./eosio_build.sh
```
For ease of contract development, one further step is required:
......@@ -143,23 +150,20 @@ make install
Now you can proceed to the next step - [Creating and launching a single-node testnet](#singlenode)
<a name="automacpublic"></a>
#### MacOS Sierra for the public testnet
Before running the script make sure you have updated XCode and brew:
#### MacOS for the public testnet
```bash
xcode-select --install
ruby -e "$(curl -fsSl https://raw.githubusercontent.com/Homebrew/install/master/install)"
```
Before running the script make sure you have installed/updated XCode. Note: The build script
will install homebrew if it is not already installed on you system. [Homebrew Website](https://brew.sh)
Then clone the EOS repository recursively, checkout the branch that is compatible with the public testnet, and run eosio-build.sh in the root `eos` folder.
Then clone the EOS repository recursively, checkout the branch that is compatible with the public testnet, and run eosio_build.sh in the root `eos` folder.
```bash
git clone https://github.com/eosio/eos --recursive
cd eos
git checkout dawn-2.x
./build.sh darwin
git checkout DAWN-2018-01-25
./eosio_build.sh
```
For ease of contract development, one further step is required:
......@@ -199,7 +203,7 @@ cd ~
git clone https://github.com/eosio/eos --recursive
mkdir -p ~/eos/build && cd ~/eos/build
cmake -DBINARYEN_BIN=~/binaryen/bin -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib ..
make -j4
make -j$( nproc )
```
Out-of-source builds are also supported. To override clang's default choice in compiler, add these flags to the CMake command:
......@@ -557,7 +561,7 @@ Dependencies:
* Clang 4.0.0
* CMake 3.5.1
* Boost 1.64
* Boost 1.66
* OpenSSL
* LLVM 4.0
* [secp256k1-zkp (Cryptonomex branch)](https://github.com/cryptonomex/secp256k1-zkp.git)
......@@ -578,14 +582,14 @@ sudo apt-get install clang-4.0 lldb-4.0 libclang-4.0-dev cmake make \
autoconf libtool git
```
Install Boost 1.64:
Install Boost 1.66:
```bash
cd ~
wget -c 'https://sourceforge.net/projects/boost/files/boost/1.64.0/boost_1_64_0.tar.bz2/download' -O boost_1.64.0.tar.bz2
tar xjf boost_1.64.0.tar.bz2
cd boost_1_64_0/
echo "export BOOST_ROOT=$HOME/opt/boost_1_64_0" >> ~/.bash_profile
wget -c 'https://sourceforge.net/projects/boost/files/boost/1.64.0/boost_1_66_0.tar.bz2/download' -O boost_1.64.0.tar.bz2
tar xjf boost_1.66.0.tar.bz2
cd boost_1_66_0/
echo "export BOOST_ROOT=$HOME/boost_1_66_0" >> ~/.bash_profile
source ~/.bash_profile
./bootstrap.sh "--prefix=$BOOST_ROOT"
./b2 install
......@@ -636,6 +640,13 @@ 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 `.bash_profile`:
```bash
echo "export WASM_LLVM_CONFIG=~/wasm-compiler/llvm/bin/llvm-config" >> ~/.bash_profile
echo "export LLVM_DIR=~/wasm-compiler/lib/cmake/llvm" >> ~/.bash_profile
source ~/.bash_profile
```
Your environment is set up. Now you can <a href="#runanode">build EOS and run a node</a>.
......@@ -696,7 +707,6 @@ echo "export BINARYEN_ROOT=~/binaryen" >> ~/.bash_profile
source ~/.bash_profile
```
Build LLVM and clang for WASM:
```bash
......@@ -709,13 +719,94 @@ 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
make -j$( nproc ) install
```
Add `WASM_LLVM_CONFIG` and `LLVM_DIR` to your `.bash_profile`:
```bash
echo "export WASM_LLVM_CONFIG=~/wasm-compiler/llvm/bin/llvm-config" >> ~/.bash_profile
echo "export LLVM_DIR=/usr/local/Cellar/llvm@4/4.0.1/lib/cmake/llvm/" >> ~/.bash_profile
source ~/.bash_profile
```
<a name="fedora"></a>
### Clean install Fedora 25 and higher
Install the development toolkit:
```bash
sudo yum update
sudo yum install git gcc.x86_64 gcc-c++.x86_64 autoconf automake libtool make cmake.x86_64 \
bzip2 bzip2-devel.x86_64 openssl-devel.x86_64 gmp-devel.x86_64 \
libstdc++-devel.x86_64 python3-devel.x86_64 libedit.x86_64 \
ncurses-devel.x86_64 swig.x86_64 gettext-devel.x86_64
```
Install Boost 1.66:
```bash
cd ~
curl -L https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2 > boost_1.66.0.tar.bz2
tar xf boost_1.66.0.tar.bz2
echo "export BOOST_ROOT=$HOME/boost_1_66_0" >> ~/.bash_profile
source ~/.bash_profile
cd boost_1_66_0/
./bootstrap.sh "--prefix=$BOOST_ROOT"
./b2 install
```
Install [secp256k1-zkp (Cryptonomex branch)](https://github.com/cryptonomex/secp256k1-zkp.git):
```bash
cd ~
git clone https://github.com/cryptonomex/secp256k1-zkp.git
cd secp256k1-zkp
./autogen.sh
./configure
make
sudo make install
```
To use the WASM compiler, EOS has an external dependency on [binaryen](https://github.com/WebAssembly/binaryen.git):
```bash
cd ~
git clone https://github.com/WebAssembly/binaryen.git
cd ~/binaryen
git checkout tags/1.37.14
cmake . && make
```
Add `BINARYEN_ROOT` to your .bash_profile:
```bash
echo "export BINARYEN_ROOT=~/binaryen" >> ~/.bash_profile
source ~/.bash_profile
```
By default LLVM and clang do not include the WASM build target, so you will have to build it yourself:
```bash
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 -j$( nproc ) install
```
Add `WASM_LLVM_CONFIG` and `LLVM_DIR` to your `.bash_profile`:
```bash
echo "export WASM_LLVM_CONFIG=~/wasm-compiler/llvm/bin/llvm-config" >> ~/.bash_profile
echo "export LLVM_DIR=/usr/local/Cellar/llvm\@4/4.0.1/lib/cmake/llvm" >> ~/.bash_profile
echo "export LLVM_DIR=~/wasm-compiler/lib/cmake/llvm" >> ~/.bash_profile
source ~/.bash_profile
```
Your environment is set up. Now you can <a href="#runanode">build EOS and run a node</a>.
#!/usr/bin/env bash
##########################################################################
# This is EOS bootstrapper script for Linux and OS X.
# This file was downloaded from https://github.com/EOSIO/eos
# Feel free to change this file to fit your needs.
##########################################################################
VERSION=1.0
ulimit -u
# Define directories.
WORK_DIR=$PWD
BUILD_DIR=${WORK_DIR}/build
TEMP_DIR=/tmp
# Target architectures
ARCH=$1
TARGET_ARCHS="ubuntu darwin"
# Check ARCH
if [[ $# > 2 ]]; then
echo ""
echo "Error: too many arguments"
exit 1
fi
if [[ $# < 1 ]]; then
echo ""
echo "Usage: bash build.sh TARGET [full|build]"
echo ""
echo "Targets: $TARGET_ARCHS"
exit 1
fi
if [[ $ARCH =~ [[:space:]] || ! $TARGET_ARCHS =~ (^|[[:space:]])$ARCH([[:space:]]|$) ]]; then
echo ""
echo ">>> WRONG ARCHITECTURE \"$ARCH\""
exit 1
fi
if [ -z "$2" ]; then
INSTALL_DEPS=1
else
if [ "$2" == "full" ]; then
INSTALL_DEPS=1
elif [ "$2" == "build" ]; then
INSTALL_DEPS=0
else
echo ">>> WRONG mode use full or build"
exit 1
fi
fi
echo ""
echo ">>> ARCHITECTURE \"$ARCH\""
if [ $ARCH == "ubuntu" ]; then
BOOST_ROOT=${HOME}/opt/boost_1_64_0
BINARYEN_BIN=${HOME}/opt/binaryen/bin
OPENSSL_ROOT_DIR=/usr/local/opt/openssl
OPENSSL_LIBRARIES=/usr/local/opt/openssl/lib
WASM_LLVM_CONFIG=${HOME}/opt/wasm/bin/llvm-config
fi
if [ $ARCH == "darwin" ]; then
OPENSSL_ROOT_DIR=/usr/local/opt/openssl
OPENSSL_LIBRARIES=/usr/local/opt/openssl/lib
BINARYEN_BIN=/usr/local/binaryen/bin/
WASM_LLVM_CONFIG=/usr/local/wasm/bin/llvm-config
fi
# Debug flags
COMPILE_EOS=1
COMPILE_CONTRACTS=1
# Define default arguments.
CMAKE_BUILD_TYPE=RelWithDebugInfo
# Install dependencies
if [ ${INSTALL_DEPS} == "1" ]; then
echo ">> Install dependencies"
. ${WORK_DIR}/scripts/install_dependencies.sh
fi
# Create the build dir
cd ${WORK_DIR}
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
CXX_COMPILER=clang++-4.0
C_COMPILER=clang-4.0
if [ $ARCH == "darwin" ]; then
CXX_COMPILER=clang++
C_COMPILER=clang
fi
# Build EOS
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_COMPILER=${CXX_COMPILER} -DCMAKE_C_COMPILER=${C_COMPILER} -DWASM_LLVM_CONFIG=${WASM_LLVM_CONFIG} -DBINARYEN_BIN=${BINARYEN_BIN} -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR} -DOPENSSL_LIBRARIES=${OPENSSL_LIBRARIES} ..
make -j10
#!/bin/bash
##########################################################################
# This is EOS bootstrapper script for Linux and OS X.
# This file was downloaded from https://github.com/EOSIO/eos
#
# Copyright (c) 2017, Respective Authors all rights reserved.
#
# After June 1, 2018 this software is available under the following terms:
#
# The MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# https://github.com/EOSIO/eos/blob/master/LICENSE.txt
##########################################################################
VERSION=1.1
ULIMIT=$( ulimit -u )
# Define directories.
WORK_DIR=$PWD
BUILD_DIR=${WORK_DIR}/build
TEMP_DIR=/tmp
ARCH=$(uname)
txtbld=$(tput bold)
bldred=${txtbld}$(tput setaf 1)
txtrst=$(tput sgr0)
printf "\n\tARCHITECTURE ${ARCH}\n"
if [ $ARCH == "Linux" ]; then
if [ ! -e /etc/os-release ]; then
printf "EOSIO currently supports Ubuntu, Red Hat & Fedora Linux only.\n"
printf "Please install on the latest version of one of these Linux distributions.\n"
printf "https://www.ubuntu.com/\n"
printf "https://start.fedoraproject.org/en/\n"
printf "Exiting now.\n"
exit 1
fi
OS_NAME=$( cat /etc/os-release | grep ^NAME | cut -d'=' -f2 | sed 's/\"//gI' )
case $OS_NAME in
"Ubuntu")
FILE=${WORK_DIR}/scripts/eosio_build_ubuntu.sh
CXX_COMPILER=clang++-4.0
C_COMPILER=clang-4.0
;;
"Fedora")
FILE=${WORK_DIR}/scripts/eosio_build_fedora.sh
CXX_COMPILER=g++
C_COMPILER=gcc
;;
*)
printf "\n\tUnsupported Linux Distribution. Exiting now.\n\n"
exit 1
esac
export BOOST_ROOT=${HOME}/opt/boost_1_66_0
export BINARYEN_BIN=${HOME}/opt/binaryen/bin
export OPENSSL_ROOT_DIR=/usr/include/openssl
export OPENSSL_LIBRARIES=/usr/include/openssl
export WASM_LLVM_CONFIG=${HOME}/opt/wasm/bin/llvm-config
. $FILE
fi
if [ $ARCH == "Darwin" ]; then
OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1
OPENSSL_LIBRARIES=/usr/local/opt/openssl@1.1/lib
BINARYEN_BIN=/usr/local/binaryen/bin/
WASM_LLVM_CONFIG=/usr/local/wasm/bin/llvm-config
CXX_COMPILER=clang++
C_COMPILER=clang
. scripts/eosio_build_darwin.sh
fi
printf "\n\n>>>>>>>> ALL dependencies sucessfully found or installed . Installing EOS.IO\n\n"
# Debug flags
COMPILE_EOS=1
COMPILE_CONTRACTS=1
# Define default arguments.
CMAKE_BUILD_TYPE=RelWithDebugInfo
# Create the build dir
cd ${WORK_DIR}
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
# Build EOS
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_COMPILER=${CXX_COMPILER} \
-DCMAKE_C_COMPILER=${C_COMPILER} -DWASM_LLVM_CONFIG=${WASM_LLVM_CONFIG} \
-DBINARYEN_BIN=${BINARYEN_BIN} -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR} \
-DOPENSSL_LIBRARIES=${OPENSSL_LIBRARIES} ..
if [ $? -ne 0 ]; then
printf "\n\t>>>>>>>>>>>>>>>>>>>> CMAKE building EOSIO has exited with the above error.\n\n"
exit -1
fi
make -j$(nproc) VERBOSE=1
if [ $? -ne 0 ]; then
printf "\n\t>>>>>>>>>>>>>>>>>>>> MAKE building EOSIO has exited with the above error.\n\n"
exit -1
fi
printf "\n\t>>>>>>>>>>>>>>>>>>>> EOSIO has been successfully installed.\n\n"
OS_VER=`sw_vers -productVersion`
OS_MAJ=`echo "${OS_VER}" | cut -d'.' -f1`
OS_MIN=`echo "${OS_VER}" | cut -d'.' -f2`
OS_PATCH=`echo "${OS_VER}" | cut -d'.' -f3`
MEM_GIG=`bc <<< "($(sysctl -in hw.memsize) / 1024000000)"`
CPU_SPEED=`bc <<< "scale=2; ($(sysctl -in hw.cpufrequency) / 100000000) / 10"`
CPU_CORE=$( sysctl -in machdep.cpu.core_count )
DISK_TOTAL=`df -H $PWD | grep /dev | tr -s ' ' | cut -d\ -f2 | sed 's/[^0-9]//'`
DISK_AVAIL=`df -H $PWD | grep /dev | tr -s ' ' | cut -d\ -f4 | sed 's/[^0-9]//'`
printf "\n\tOS name: $ARCH\n"
printf "\tOS Version: ${OS_VER}\n"
printf "\tCPU speed: ${CPU_SPEED}Ghz\n"
printf "\tCPU cores: $CPU_CORE\n"
printf "\tPhysical Memory: $MEM_GIG Gbytes\n"
printf "\tDisk space total: ${DISK_TOTAL}G\n"
printf "\tDisk space available: ${DISK_AVAIL}G\n\n"
if [ $MEM_GIG -lt 8 ]; then
printf "\tYour system must have 8 or more Gigabytes of physical memory installed.\n"
printf "\tExiting now.\n"
exit 1
fi
if [ $OS_MIN -lt 12 ]; then
printf "\tYou must be running Mac OS 10.12.x or higher to install EOSIO.\n"
printf "\tExiting now.\n"
exit 1
fi
if [ $DISK_AVAIL -lt 100 ]; then
printf "\tYou must have at least 100GB of available storage to install EOSIO.\n"
printf "\tExiting now.\n"
exit 1
fi
process_dep()
{
printf "\tChecking XCode installation\n"
XCODESELECT=$(which xcode-select)
if [ $? -ne 0 ]; then
printf "\n\tXCode must be installed in order to proceed.\n\n"
printf "\texiting now.\n"
exit 1
fi
printf "\tXCode installation found.\n\n"
printf "\tChecking Ruby installation\n"
RUBY=$(which ruby)
if [ $? -ne 0 ]; then
printf "\nRuby must be installed in order to proceed.\n\n"
printf "\texiting now.\n"
exit 1
fi
printf "\tRuby installation found.\n\n"
printf "\tChecking Home Brew installation\n"
BREW=$(which brew)
if [ $? -ne 0 ]; then
printf "\tHomebrew must be installed to compile EOS.IO\n\n"
printf "\tDo you wish to install Home Brew?\n"
select yn in "Yes" "No"; do
case $yn in
[Yy]* )
$XCODESELECT --install 2>/dev/null;
$RUBY -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
if [ $? -ne 0 ]; then
echo "User aborted homebrew installation. Exiting now."
exit 0;
fi
break;;
[Nn]* ) echo "User aborted homebrew installation. Exiting now.";
exit;;
* ) echo "Please enter 1 for yes or 2 for no.";;
esac
done
fi
printf "\tHome Brew installation found.\n\n"
# DEPS="git automake libtool openssl cmake wget boost llvm@4 gmp gettext"
DCOUNT=0
COUNT=1
PERMISSION_GETTEXT=0
DISPLAY=""
DEP=""
printf "\tChecking dependencies.\n"
for line in `cat ${WORK_DIR}/scripts/eosio_build_dep`; do
pkg=$( echo "${line}" | cut -d',' -f1 )
printf "\tChecking $pkg ... "
BIN=$(which $pkg)
if [ $? -eq 0 ]; then
printf "\t$pkg found\n"
continue
fi
LIB=$( ls -l /usr/local/lib/lib${pkg}* 2>/dev/null | wc -l)
if [ ${LIB} -ne 0 ]; then
printf "\t$pkg found\n"
continue
else
let DCOUNT++
if [ $pkg = "LLVM" ]; then
pkg="llvm@4"
fi
if [ $pkg = "gettext" ]; then
PERMISSION_GETTEXT=1
fi
DEP=$DEP" ${pkg} "
DISPLAY="${DISPLAY}${COUNT}. ${pkg}\n\t"
printf "\tPackage ${pkg} ${bldred}NOT${txtrst} found.\n"
let COUNT++
fi
done
if [ $DCOUNT -ne 0 ]; then
printf "\n\tThe following dependencies are required to install EOSIO.\n"
printf "\n\t$DISPLAY\n\n"
echo "Do you wish to install these packages?"
select yn in "Yes" "No"; do
case $yn in
[Yy]* )
if [ $PERMISSION_GETTEXT -eq 1 ]; then
sudo chown -R $(whoami) /usr/local/share
fi
$XCODESELECT --install 2>/dev/null;
printf "\tUpdating Home Brew.\n"
brew update
printf "\tInstalling Dependencies.\n"
brew install --force $DEP
brew unlink $DEP && brew link --force $DEP
break;;
[Nn]* ) echo "User aborting installation of required dependencies, Exiting now."; exit;;
* ) echo "Please type 1 for yes or 2 for no.";;
esac
done
else
printf "\n\tNo required Home Brew dependencies to install.\n"
fi
return 0
}
process_dep
printf "\n\tChecking for secp256k1-zkp\n"
# install secp256k1-zkp (Cryptonomex branch)
if [ ! -e /usr/local/lib/libsecp256k1.a ]; then
cd ${TEMP_DIR}
git clone https://github.com/cryptonomex/secp256k1-zkp.git
cd secp256k1-zkp
./autogen.sh
if [ $? -ne 0 ]; then
printf "\tError running autogen\n"
printf "\tExiting now.\n\n"
exit;
fi
./configure
make
if [ $? -ne 0 ]; then
printf "\tError compiling secp256k1-zkp.\n"
printf "\tExiting now.\n\n"
exit;
fi
sudo make install
sudo rm -rf ${TEMP_DIR}/secp256k1-zkp
else
printf "\tsecp256k1 found at /usr/local/lib/\n"
fi
printf "\n\tChecking for binaryen\n"
if [ ! -e /usr/local/binaryen/bin/binaryen.js ]; then
cd ${TEMP_DIR}
git clone https://github.com/WebAssembly/binaryen
cd binaryen
git checkout tags/1.37.14
cmake . && make
if [ $? -ne 0 ]; then
printf "\tError compiling binaryen.\n"
printf "\tExiting now.\n\n"
exit;
fi
sudo mkdir /usr/local/binaryen
sudo mv ${TEMP_DIR}/binaryen/bin /usr/local/binaryen
sudo ln -s /usr/local/binaryen/bin/* /usr/local
sudo rm -rf ${TEMP_DIR}/binaryen
else
printf "\tBinaryen found at /usr/local/binaryen/bin/\n"
fi
printf "\n\tChecking for WASM\n"
if [ ! -d /usr/local/wasm/bin ]; then
# Build LLVM and clang for WASM:
cd ${TEMP_DIR}
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
sudo cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local/wasm \
-DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly \
-DCMAKE_BUILD_TYPE=Release ../
if [ $? -ne 0 ]; then
printf "\tError compiling WASM.\n"
printf "\tExiting now.\n\n"
exit;
fi
sudo make -j4 install
sudo rm -rf ${TEMP_DIR}/wasm-compiler
else
printf "\tWASM found at /usr/local/wasm/bin/\n"
fi
\ No newline at end of file
automake,http://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz
libtool,http://gnu.askapache.com/libtool/libtool-2.4.6.tar.gz
openssl,https://www.openssl.org/source/openssl-1.0.2n.tar.gz
LLVM,http://releases.llvm.org/5.0.1/llvm-5.0.1.src.tar.xz
wget,https://ftp.gnu.org/gnu/wget/wget-1.19.2.tar.gz
cmake,https://cmake.org/files/v3.10/cmake-3.10.1-Darwin-x86_64.tar.gz
boost,https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
gmp,https://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2
gettext,https://ftp.gnu.org/pub/gnu/gettext/gettext-latest.tar.gz
\ No newline at end of file
OS_VER=$( cat /etc/os-release | grep VERSION_ID | cut -d'=' -f2 | sed 's/[^0-9\.]//gI' )
MEM_MEG=$( free -m | grep Mem | tr -s ' ' | cut -d\ -f2 )
CPU_SPEED=$( lscpu | grep "MHz" | tr -s ' ' | cut -d\ -f3 | cut -d'.' -f1 )
CPU_CORE=$( lscpu | grep "^CPU(s)" | tr -s ' ' | cut -d\ -f2 )
DISK_TOTAL=`df -h / | grep /dev | tr -s ' ' | cut -d\ -f2 | sed 's/[^0-9]//'`
DISK_AVAIL=`df -h / | grep /dev | tr -s ' ' | cut -d\ -f4 | sed 's/[^0-9]//'`
printf "\n\tOS name: $OS_NAME\n"
printf "\tOS Version: ${OS_VER}\n"
printf "\tCPU speed: ${CPU_SPEED}Mhz\n"
printf "\tCPU cores: $CPU_CORE\n"
printf "\tPhysical Memory: $MEM_MEG Mgb\n"
printf "\tDisk space total: ${DISK_TOTAL}G\n"
printf "\tDisk space available: ${DISK_AVAIL}G\n"
if [ $MEM_MEG -lt 4000 ]; then
echo "Your system must have 8 or more Gigabytes of physical memory installed."
echo "exiting now."
exit 1
fi
if [ $OS_VER -lt 25 ]; then
echo "You must be running Fedora 25 or higher to install EOSIO."
echo "exiting now"
exit 1
fi
if [ $DISK_AVAIL -lt 100 ]; then
echo "You must have at least 100GB of available storage to install EOSIO."
echo "exiting now"
exit 1
fi
printf "\n\tChecking Yum installation\n"
YUM=$( which yum 2>/dev/null )
if [ $? -ne 0 ]; then
printf "\n\tYum must be installed to compile EOS.IO.\n"
printf "\n\tExiting now.\n"
exit 0
fi
printf "\tYum installation found at ${YUM}.\n"
printf "\tUpdating YUM.\n"
UPDATE=$( sudo yum update )
if [ $? -ne 0 ]; then
printf "\n\tYUM update failed.\n"
printf "\n\tExiting now.\n"
exit 1
fi
printf "\t${UPDATE}\n"
DEP_ARRAY=( git gcc.x86_64 gcc-c++.x86_64 autoconf automake libtool make cmake.x86_64 bzip2 bzip2-devel.x86_64 openssl-devel.x86_64 gmp.x86_64 gmp-devel.x86_64 libstdc++-devel.x86_64 python3-devel.x86_64 libedit.x86_64 ncurses-devel.x86_64 swig.x86_64 )
DCOUNT=0
COUNT=1
DISPLAY=""
DEP=""
printf "\n\tChecking YUM for installed dependencies.\n\n"
for (( i=0; i<${#DEP_ARRAY[@]}; i++ ));
do
pkg=$( sudo $YUM info ${DEP_ARRAY[$i]} 2>/dev/null | grep Repo | tr -s ' ' | cut -d: -f2 | sed 's/ //g' )
if [ "$pkg" != "@System" ]; then
DEP=$DEP" ${DEP_ARRAY[$i]} "
DISPLAY="${DISPLAY}${COUNT}. ${DEP_ARRAY[$i]}\n\t"
printf "\tPackage ${DEP_ARRAY[$i]} ${bldred} NOT ${txtrst} found.\n"
let COUNT++
let DCOUNT++
else
printf "\tPackage ${DEP_ARRAY[$i]} found.\n"
continue
fi
done
if [ ${DCOUNT} -ne 0 ]; then
printf "\n\tThe following dependencies are required to install EOSIO.\n"
printf "\n\t$DISPLAY\n\n"
printf "\tDo you wish to install these dependencies?\n"
select yn in "Yes" "No"; do
case $yn in
[Yy]* )
printf "\n\n\tInstalling dependencies\n\n"
sudo yum -y install ${DEP}
if [ $? -ne 0 ]; then
printf "\n\tYUM dependency installation failed.\n"
printf "\n\tExiting now.\n"
exit 1
else
printf "\n\tYUM dependencies installed successfully.\n"
fi
break;;
[Nn]* ) echo "User aborting installation of required dependencies, Exiting now."; exit;;
* ) echo "Please type 1 for yes or 2 for no.";;
esac
done
else
printf "\n\tNo required YUM dependencies to install.\n"
fi
printf "\n\tChecking for boost libraries\n"
if [ ! -d ${HOME}/opt/boost_1_66_0 ]; then
# install boost
printf "\tInstalling boost libraries\n"
cd ${TEMP_DIR}
curl -L https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2 > boost_1.66.0.tar.bz2
tar xf boost_1.66.0.tar.bz2
cd boost_1_66_0/
./bootstrap.sh "--prefix=$BOOST_ROOT"
./b2 install
rm -rf ${TEMP_DIR}/boost_1_66_0/
rm -f ${TEMP_DIR}/boost_1.66.0.tar.bz2
else
printf "\tBoost 1.66 found at ${HOME}/opt/boost_1_66_0\n"
fi
printf "\n\tChecking for secp256k1-zkp\n"
# install secp256k1-zkp (Cryptonomex branch)
if [ ! -e /usr/local/lib/libsecp256k1.a ]; then
printf "\tInstalling secp256k1-zkp (Cryptonomex branch)\n"
cd ${TEMP_DIR}
git clone https://github.com/cryptonomex/secp256k1-zkp.git
cd secp256k1-zkp
./autogen.sh
if [ $? -ne 0 ]; then
printf "\tError running autogen for secp256k1-zkp.\n"
printf "\tExiting now.\n\n"
exit;
fi
./configure
make
if [ $? -ne 0 ]; then
printf "\tError compiling secp256k1-zkp.\n"
printf "\tExiting now.\n\n"
exit;
fi
sudo make install
rm -rf cd ${TEMP_DIR}/secp256k1-zkp
else
printf "\tsecp256k1 found\n"
fi
printf "\n\tChecking for binaryen\n"
if [ ! -d ${HOME}/opt/binaryen ]; then
# Install binaryen v1.37.14:
printf "\tInstalling binaryen v1.37.14:\n"
cd ${TEMP_DIR}
git clone https://github.com/WebAssembly/binaryen
cd binaryen
git checkout tags/1.37.14
cmake . && make
if [ $? -ne 0 ]; then
printf "\tError compiling binaryen.\n"
printf "\tExiting now.\n\n"
exit;
fi
mkdir -p ${HOME}/opt/binaryen/ 2>/dev/null
mv ${TEMP_DIR}/binaryen/bin ${HOME}/opt/binaryen/
rm -rf ${TEMP_DIR}/binaryen
else
printf "\tBinaryen found at ${HOME}/opt/binaryen\n"
fi
printf "\n\tChecking for LLVM with WASM support.\n"
if [ ! -d ${HOME}/opt/wasm/bin ]; then
# Build LLVM and clang with EXPERIMENTAL WASM support:
printf "\tInstalling LLVM & WASM\n"
cd ${TEMP_DIR}
mkdir llvm-compiler 2>/dev/null
cd llvm-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=${HOME}/opt/wasm -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release ../
if [ $? -ne 0 ]; then
printf "\tError compiling LLVM and clang with EXPERIMENTAL WASM support.\n"
printf "\tExiting now.\n\n"
exit;
fi
make -j$(nproc)
if [ $? -ne 0 ]; then
printf "\tError compiling LLVM and clang with EXPERIMENTAL WASM support.\n"
printf "\tExiting now.\n\n"
exit;
fi
make install
rm -rf ${TEMP_DIR}/llvm-compiler 2>/dev/null
else
printf "\tWASM found at ${HOME}/opt/wasm\n"
fi
\ No newline at end of file
OS_VER=$( cat /etc/os-release | grep VERSION_ID | cut -d'=' -f2 | sed 's/[^0-9\.]//gI' )
OS_MAJ=`echo "${OS_VER}" | cut -d'.' -f1`
OS_MIN=`echo "${OS_VER}" | cut -d'.' -f2`
MEM_MEG=$( free -m | grep Mem | tr -s ' ' | cut -d\ -f2 )
CPU_SPEED=$( lscpu | grep "MHz" | tr -s ' ' | cut -d\ -f3 | cut -d'.' -f1 )
CPU_CORE=$( lscpu | grep "^CPU(s)" | tr -s ' ' | cut -d\ -f2 )
DISK_TOTAL=`df -h / | grep /dev | tr -s ' ' | cut -d\ -f2 | sed 's/[^0-9]//'`
DISK_AVAIL=`df -h / | grep /dev | tr -s ' ' | cut -d\ -f4 | sed 's/[^0-9]//'`
printf "\n\tOS name: $OS_NAME\n"
printf "\tOS Version: ${OS_VER}\n"
printf "\tCPU speed: ${CPU_SPEED}Mhz\n"
printf "\tCPU cores: $CPU_CORE\n"
printf "\tPhysical Memory: $MEM_MEG Mgb\n"
printf "\tDisk space total: ${DISK_TOTAL}G\n"
printf "\tDisk space available: ${DISK_AVAIL}G\n"
if [ $MEM_MEG -lt 4000 ]; then
echo "Your system must have 8 or more Gigabytes of physical memory installed."
echo "exiting now."
exit 1
fi
if [ $OS_MIN -lt 4 ]; then
echo "You must be running Ubuntu 16.04.x or higher to install EOSIO."
echo "exiting now"
exit 1
fi
if [ $DISK_AVAIL -lt 100 ]; then
echo "You must have at least 100GB of available storage to install EOSIO."
echo "exiting now"
exit 1
fi
DEP_ARRAY=(clang-4.0 lldb-4.0 libclang-4.0-dev cmake make libbz2-dev libssl-dev libgmp3-dev autotools-dev build-essential libbz2-dev libicu-dev python-dev autoconf libtool curl)
DCOUNT=0
COUNT=1
DISPLAY=""
DEP=""
printf "\n\tChecking for installed dependencies.\n\n"
for (( i=0; i<${#DEP_ARRAY[@]}; i++ ));
do
pkg=$( dpkg -s ${DEP_ARRAY[$i]} 2>/dev/null | grep Status | tr -s ' ' | cut -d\ -f4 )
if [ -z "$pkg" ]; then
DEP=$DEP" ${DEP_ARRAY[$i]} "
DISPLAY="${DISPLAY}${COUNT}. ${DEP_ARRAY[$i]}\n\t"
printf "\tPackage ${DEP_ARRAY[$i]} ${bldred} NOT ${txtrst} found.\n"
let COUNT++
let DCOUNT++
else
printf "\tPackage ${DEP_ARRAY[$i]} found.\n"
continue
fi
done
if [ ${DCOUNT} -ne 0 ]; then
printf "\n\tThe following dependencies are required to install EOSIO.\n"
printf "\n\t$DISPLAY\n\n"
printf "\tDo you wish to install these packages?\n"
select yn in "Yes" "No"; do
case $yn in
[Yy]* )
printf "\n\n\tInstalling dependencies\n\n"
sudo apt-get update
sudo apt-get -y install ${DEP}
if [ $? -ne 0 ]; then
printf "\n\tDPKG dependency failed.\n"
printf "\n\tExiting now.\n"
exit 1
else
printf "\n\tDPKG dependencies installed successfully.\n"
fi
break;;
[Nn]* ) echo "User aborting installation of required dependencies, Exiting now."; exit;;
* ) echo "Please type 1 for yes or 2 for no.";;
esac
done
else
printf "\n\tNo required dpkg dependencies to install.\n"
fi
printf "\n\tChecking for boost libraries\n"
if [ ! -d ${HOME}/opt/boost_1_66_0 ]; then
# install boost
printf "\tInstalling boost libraries\n"
cd ${TEMP_DIR}
curl -L https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2 > boost_1.66.0.tar.bz2
tar xf boost_1.66.0.tar.bz2
cd boost_1_66_0/
./bootstrap.sh "--prefix=$BOOST_ROOT"
./b2 install
rm -rf ${TEMP_DIR}/boost_1_66_0/
rm -f ${TEMP_DIR}/boost_1.66.0.tar.bz2
else
printf "\tBoost 1.66 found at ${HOME}/opt/boost_1_66_0\n"
fi
printf "\n\tChecking for secp256k1-zkp\n"
# install secp256k1-zkp (Cryptonomex branch)
if [ ! -e /usr/local/lib/libsecp256k1.a ]; then
printf "\tInstalling secp256k1-zkp (Cryptonomex branch)\n"
cd ${TEMP_DIR}
git clone https://github.com/cryptonomex/secp256k1-zkp.git
cd secp256k1-zkp
./autogen.sh
if [ $? -ne 0 ]; then
printf "\tError running autogen for secp256k1-zkp.\n"
printf "\tExiting now.\n\n"
exit;
fi
./configure
make
if [ $? -ne 0 ]; then
printf "\tError compiling secp256k1-zkp.\n"
printf "\tExiting now.\n\n"
exit;
fi
sudo make install
rm -rf cd ${TEMP_DIR}/secp256k1-zkp
else
printf "\tsecp256k1 found\n"
fi
printf "\n\tChecking for binaryen\n"
if [ ! -d ${HOME}/opt/binaryen ]; then
# Install binaryen v1.37.14:
printf "\tInstalling binaryen v1.37.14:\n"
cd ${TEMP_DIR}
git clone https://github.com/WebAssembly/binaryen
cd binaryen
git checkout tags/1.37.14
cmake . && make
if [ $? -ne 0 ]; then
printf "\tError compiling binaryen.\n"
printf "\tExiting now.\n\n"
exit;
fi
mkdir -p ${HOME}/opt/binaryen/ 2>/dev/null
mv ${TEMP_DIR}/binaryen/bin ${HOME}/opt/binaryen/
rm -rf ${TEMP_DIR}/binaryen
else
printf "\tBinaryen found at ${HOME}/opt/binaryen\n"
fi
printf "\n\tChecking for LLVM with WASM support.\n"
if [ ! -d ${HOME}/opt/wasm/bin ]; then
# Build LLVM and clang for WASM:
printf "\tInstalling LLVM & WASM\n"
cd ${TEMP_DIR}
mkdir llvm-compiler 2>/dev/null
cd llvm-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=${HOME}/opt/wasm -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release ../
if [ $? -ne 0 ]; then
printf "\tError compiling LLVM and clang with EXPERIMENTAL WASM support.\n"
printf "\tExiting now.\n\n"
exit;
fi
make -j$(nproc)
if [ $? -ne 0 ]; then
printf "\tError compiling LLVM and clang with EXPERIMENTAL WASM support.\n"
printf "\tExiting now.\n\n"
exit;
fi
rm -rf ${TEMP_DIR}/llvm-compiler
else
printf "\tWASM found at ${HOME}/opt/wasm/bin\n"
fi
\ No newline at end of file
# Install dependencies script
if [ $ARCH == "ubuntu" ]; then
# install dev toolkit
sudo apt-get update
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-get -y install clang-4.0 lldb-4.0 libclang-4.0-dev cmake make \
libbz2-dev libssl-dev libgmp3-dev \
autotools-dev build-essential \
libbz2-dev libicu-dev python-dev \
autoconf libtool git curl automake
OPENSSL_ROOT_DIR=/usr/local/opt/openssl
OPENSSL_LIBRARIES=/usr/local/opt/openssl/lib
# install boost
cd ${TEMP_DIR}
export BOOST_ROOT=${HOME}/opt/boost_1_64_0
curl -L https://sourceforge.net/projects/boost/files/boost/1.64.0/boost_1_64_0.tar.bz2 > boost_1.64.0.tar.bz2
tar xvf boost_1.64.0.tar.bz2
cd boost_1_64_0/
./bootstrap.sh "--prefix=$BOOST_ROOT"
./b2 install
rm -rf ${TEMP_DIR}/boost_1_64_0/
# install secp256k1-zkp (Cryptonomex branch)
cd ${TEMP_DIR}
git clone https://github.com/cryptonomex/secp256k1-zkp.git
cd secp256k1-zkp
./autogen.sh
./configure
make
sudo make install
rm -rf cd ${TEMP_DIR}/secp256k1-zkp
# install binaryen
cd ${TEMP_DIR}
git clone https://github.com/WebAssembly/binaryen
cd binaryen
git checkout tags/1.37.14
cmake . && make
mkdir -p ${HOME}/opt/binaryen/
mv ${TEMP_DIR}/binaryen/bin ${HOME}/opt/binaryen/
rm -rf ${TEMP_DIR}/binaryen
BINARYEN_BIN=${HOME}/opt/binaryen/bin
# build llvm with wasm build target:
cd ${TEMP_DIR}
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=${HOME}/opt/wasm -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release ../
make -j4 install
rm -rf ${TEMP_DIR}/wasm-compiler
WASM_LLVM_CONFIG=${HOME}/opt/wasm/bin/llvm-config
fi
if [ $ARCH == "darwin" ]; then
DEPS="git automake libtool boost openssl llvm@4 gmp wget cmake gettext"
brew update
brew install --force $DEPS
brew unlink $DEPS && brew link --force $DEPS
# LLVM_DIR=/usr/local/Cellar/llvm/4.0.1/lib/cmake/llvm
# install secp256k1-zkp (Cryptonomex branch)
cd ${TEMP_DIR}
git clone https://github.com/cryptonomex/secp256k1-zkp.git
cd secp256k1-zkp
./autogen.sh
./configure
make
sudo make install
sudo rm -rf ${TEMP_DIR}/secp256k1-zkp
# Install binaryen v1.37.14:
cd ${TEMP_DIR}
git clone https://github.com/WebAssembly/binaryen
cd binaryen
git checkout tags/1.37.14
cmake . && make
sudo mkdir /usr/local/binaryen
sudo mv ${TEMP_DIR}/binaryen/bin /usr/local/binaryen
sudo ln -s /usr/local/binaryen/bin/* /usr/local
sudo rm -rf ${TEMP_DIR}/binaryen
BINARYEN_BIN=/usr/local/binaryen/bin/
# Build LLVM and clang for WASM:
cd ${TEMP_DIR}
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
sudo cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local/wasm -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release ../
sudo make -j4 install
sudo rm -rf ${TEMP_DIR}/wasm-compiler
WASM_LLVM_CONFIG=/usr/local/wasm/bin/llvm-config
fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册