Ubuntu - 22.04
CMake Legacy Building
Section titled “CMake Legacy Building”Dependency | Working Version |
---|---|
GCC / G++ | 14.0.3 |
LLVM | 14.0.3 |
LLD | 14.0.3 |
Boost | 1.86.0 |
CMake | 3.23.1 |
Protobuf | 3.20.0 |
WasmEdge | 0.11.2 |
Set Build Env Variables
Section titled “Set Build Env Variables”First make a dependency directory. I like to use ~/dependencies
mkdir ~/dependencies
Next we need to set the environment variables.
Set Versions Env Variables
Section titled “Set Versions Env Variables”export UBUNTU_VERSION=jammyexport LLVM_VERSION=14export CMAKE_VERSION=3.23.1export BOOST_VERSION=1.86.0export WASMEDGE_VERSION=0.11.2export PROTOBUF_VERSION=3.20.0
Set Build Env Variables
Section titled “Set Build Env Variables”export DEP_DIR=~/dependenciesexport BOOST_FOLDER_NAME="boost_$(echo "$BOOST_VERSION" | sed 's/\./_/g')"export BOOST_ROOT=$DEP_DIR/$BOOST_FOLDER_NAMEexport Boost_LIBRARY_DIRS=$BOOST_ROOT/libsexport BOOST_INCLUDEDIR=$BOOST_ROOT/boostexport Boost_INCLUDE_DIRS=$BOOST_ROOT/boostexport LLVM_DIR=/usr/lib/llvm-$LLVM_VERSION/lib/cmake/llvmexport LLVM_LIBRARY_DIR=/usr/lib/llvm-$LLVM_VERSION/libexport LLD_DIR=/usr/lib/llvm-$LLVM_VERSION/lib/cmake/lldexport CC=gccexport CXX=g++export CFLAGS="-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"export CXXFLAGS="-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"export BOOST_CXXFLAGS="-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"export LDFLAGS="-L$BOOST_ROOT/lib"export CPPFLAGS="-I$BOOST_ROOT/include"export LDFLAGS="-L/usr/lib/llvm-$LLVM_VERSION/lib"export CPPFLAGS="-I/usr/lib/llvm-$LLVM_VERSION/include"
Install Core Dependencies
Section titled “Install Core Dependencies”apt update && \apt install -y build-essential software-properties-common wget curl git pkg-config zlib1g-dev libssl-dev autoconf libtool unzip gcc g++ ninja-build && \wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \add-apt-repository "deb http://apt.llvm.org/$UBUNTU_VERSION/ llvm-toolchain-$UBUNTU_VERSION-$LLVM_VERSION main" && \add-apt-repository ppa:deadsnakes/ppa && \apt-cache policy python3.9 && \apt install -y python3.9 python3-pip llvm-$LLVM_VERSION-dev liblld-$LLVM_VERSION-dev libpolly-$LLVM_VERSION-dev
sudo nano /etc/apt/sources.list# Scroll down and removedeb http://apt.llvm.org/ llvm-toolchain-- main# Add the apt-repo directly with add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main"
Install Rippled Dependencies
Section titled “Install Rippled Dependencies”Install CMake
cd $DEP_DIR && \wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.sh && \sudo sh cmake-$CMAKE_VERSION-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir
Install Protobuf
cd $DEP_DIR && \wget -nc https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protobuf-all-$PROTOBUF_VERSION.tar.gz && \tar -xzf protobuf-all-$PROTOBUF_VERSION.tar.gz && \cd protobuf-$PROTOBUF_VERSION/ && \./autogen.sh && \./configure --prefix=/usr --disable-shared link=static && \make -j$(nproc) && \sudo make install
Install Boost
cd $DEP_DIR && \wget https://boostorg.jfrog.io/artifactory/main/release/$BOOST_VERSION/source/$BOOST_FOLDER_NAME.tar.gz && \tar -xvzf $BOOST_FOLDER_NAME.tar.gz && \cd $BOOST_FOLDER_NAME && \./bootstrap.sh && \./b2 -j$(nproc)
Install WasmEdge
cd $DEP_DIR && \wget -nc -q https://github.com/WasmEdge/WasmEdge/archive/refs/tags/$WASMEDGE_VERSION.zip && \unzip -o $WASMEDGE_VERSION.zip && \cd WasmEdge-$WASMEDGE_VERSION && \mkdir build && \cd build && \cmake -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_SHARED_LIB=OFF -DWASMEDGE_BUILD_STATIC_LIB=ON -DWASMEDGE_BUILD_AOT_RUNTIME=ON -DWASMEDGE_FORCE_DISABLE_LTO=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DWASMEDGE_LINK_LLVM_STATIC=ON -DWASMEDGE_BUILD_PLUGINS=OFF -DWASMEDGE_LINK_TOOLS_STATIC=ON .. && \make -j$(nproc) && \sudo make install
Clone the repository
Section titled “Clone the repository”mkdir ~/projects && \cd ~/projects && \git clone https://github.com/Xahau/xahaud.git && \cd xahaud && \git checkout dev
Build Xahaud
Section titled “Build Xahaud”From the root xahaud
directory:
mkdir build && \cd build && \cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_DIR=$LLVM_DIR -DLLVM_LIBRARY_DIR=$LLVM_LIBRARY_DIR .. && \cmake --build . --target rippled --parallel -j$(nproc)
Start the built node
./rippled