-
Notifications
You must be signed in to change notification settings - Fork 4
Installation of dependencies
This project is tested on Ubuntu (18.04) and macOS (10.15). It is expected to run on Linux distributions, e.g., CentOS, without much trouble. The implementation of the code has so far never given any consideration to Windows operating systems. Thus, it is not expected to work on Windows without substantial additional work.
The implementation of this project is written in C++ 17.
-
C/C++ compiler and library
-
gcc
version 8 or up on Linux. We recommendclang
version 8 or up as an alternative (or better) compiler. Note: the llvmlibc++
lacks the support of some C++ 17 features, thus still need thegcc
library. -
Apple LLVM version 11.0.0 (clang-1100.0.33.8) provided by XCode 11 on macOS
-
-
cmake
version 3.15 or up
This project builds on several existing projects:
- The source code has included the code from the following projects:
- The following dependencies need to be installed on your system:
-
openssl
version 1.1 libsecp256k1
-
libevent
version 2.1.11 -
RocksDB
version 6.3.6 -
protobuf
version 3.10.0 -
gRPC
version 1.24.3 -
GoogleTest
version 1.10.0
-
An installation script sys-dep-install.sh
is provided in the folder ci
for Ubuntu 18.04 and macOS 10.15.
The following are instructions for Ubuntu and macOS.
-
Install some basics build tools
sudo apt-get install autoconf libtool pkg-config
-
Install gcc-8
sudo apt-get install gcc-8 g++-8
Update alternatives
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 100 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 100
-
Install clang-9
Add repository. If you have a different version of Ubuntu other than 18.04, see https://apt.llvm.org for corresponding repos.
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main" sudo apt-get update sudo apt-get install clang-9
Update alternatives
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 100 sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 100
-
(Optional) for
libsecp256k1
sudo apt-get install libgmp-dev
-
XCode11
xcode-select --install
Apple provides its own C/C++ compiler and lib via XCode,
Apple clang version 11.0.0 (clang-1100.0.33.8)
. macOS must upgrade to 10.15. -
Brew
/usr/bin/ruby -e "$(curl -fsSL https://github.com/raw/Homebrew/install/master/install)"
-
Some configure/make tools
brew install automake autoconf libtool
-
(Optional) for
libsecp256k1
brew install gmp
Some dependencies need to be installed from the source. The following is the detailed instruction, with slight variation depending on Linux or macOS.
macOS:
brew install cmake
# version 3.17 will be installed
Linux:
git clone -b v3.17.0 --single-branch https://github.com/Kitware/CMake.git
cd CMake
./bootstrap && make -j && sudo make install
macOS:
brew install openssl@1.1
# The following is needed for libevent install
export OPENSSL_ROOT_DIR="/usr/local/opt/openssl@1.1"
Linux:
git clone -b OpenSSL_1_1_1f https://github.com/openssl/openssl.git
cd openssl
./config && make -j && sudo make install
This is required by libevent
and secp256k1
.
macOS:
brew install protobuf
# version 3.11.4 will be installed
Linux:
git clone -b v3.11.4 --single-branch https://github.com/protocolbuffers/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh && ./configure && make -j
make check
sudo make install
sudo ldconfig # refresh shared library cache.
If "make check" fails, you can still install, but it is likely that some features of this library will not work correctly on your system. Proceed at your own risk. https://github.com/protocolbuffers/protobuf/blob/master/src/README.md
macOS:
brew install grpc
# version 1.24.3 will be installed
Linux:
git clone -b v1.28.1 --single-branch https://github.com/grpc/grpc.git
cd grpc
git submodule update --init
make -j
sudo make install
The above instruction is from https://github.com/grpc/grpc/blob/master/BUILDING.md.
macOS:
brew install rocksdb
# version 6.7.3 will be installed
Linux:
git clone -b v6.7.3 --single-branch https://github.com/facebook/rocksdb.git
cd rocksdb
make shared_lib -j
sudo make install
git clone -b release-2.1.11-stable --single-branch https://github.com/libevent/libevent.git
cd libevent
mkdir build && cd build
cmake ..
make -j && sudo make install
The brew-installed
libevent
(version 2.1.11_1) on macOS does not work smoothly for now. So please compile as instructed in the above.
git clone -b release-1.10.0 --single-branch https://github.com/google/googletest.git
cd googletest && mkdir build && cd build
cmake ..
make -j && sudo make install
git clone https://github.com/bitcoin-core/secp256k1.git
cd secp256k1
./autogen.sh && ./configure --enable-module-recovery=yes
make -j && sudo make install