Set two environment variables
rvm --default use ruby-2.7.8
rustup set default-host x86_64-pc-windows-msvc
rustup target add x86_64-pc-windows-msvc
cargo install cbindgen cargo-lipo
rustup target add wasm32-unknown-emscripten
(to be deprecated)
git submodule update --init --recursive
cd ./build/Windows
mkdir Release
cd Release
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
git pull
git submodule update --init --recursive
cd ./build/Windows
mkdir Debug
cd Debug
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug
cmake --build . --config Debug
Open a terminal as root ("sudo" without su won't do it because of Ruby installation)
sudo su root
Install default requirements
#!/bin/bash
apt-get -y update
apt-get -y install g++ clang llvm cmake ntp zlib1g-dev libgtk-3-dev ninja-build libjsoncpp25 libsecret-1-0 libjsoncpp-dev libsecret-1-dev git cmake default-jre curl libc++-dev libc++abi-dev
cd /usr/local/src
wget --no-check-certificate https://www.openssl.org/source/openssl-1.1.1t.tar.gz
tar -xf openssl-1.1.1t.tar.gz
cd openssl-1.1.1t/
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib >build.log
make install >>build.log
cd ~/
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "$HOME/.cargo/env"
cargo install cbindgen >rust-install.log
rustup target add x86_64-unknown-linux-gnu >rust-install.log
cp -R /root/.cargo /home/$SUDO_USER
cp -R /root/.rustup /home/$SUDO_USER
chown -R /$SUDO_USER:/$SUDO_USER /home//$SUDO_USER/.cargo /home//$SUDO_USER/.rustup
apt-get -y install gnupg2
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
curl -sSL https://get.rvm.io | bash -s stable >>ruby-build.log
source /etc/profile.d/rvm.sh
rvm install ruby-2.7.8 --with-openssl-dir=/usr/local/ssl/ >>ruby-build.log
rvm --default use ruby-2.7.8
ln -s /usr/bin/python3 /usr/bin/python
# exit sudo su root
exit
source /etc/profile.d/rvm.sh
# this updates the path
rvm --default use ruby-2.7.8
echo '. "$HOME/.cargo/env"' >> $HOME/.bashrc
# default to use clang
sudo update-alternatives --set c++ /usr/bin/clang++
sudo update-alternatives --set cc /usr/bin/clang
These steps were extracted from the bootstrap.sh script on TestVMS (here)
The following Rust target is needed for now but will be deprecated soon:
rustup target add wasm32-unknown-emscripten
# this will be deprecated on wallet-core soon
export CMAKE_BUILD_PARALLEL_LEVEL=8
export MAKEFLAGS="-j8"
cd ./build/Linux
mkdir Release
cd Release
cmake .. -DCMAKE_BUILD_TYPE=Release
make
rvm --default use ruby-2.7.8
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
○ export ANDROID_NDK=/path/to/android-ndk-r25b ○ export ANDROID_TOOLCHAIN="$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin" ○ export PATH="$ANDROID_TOOLCHAIN":"$PATH"
○ cd build/Android
○ mkdir -p Release/armeabi-v7a
○ cd Release/armeabi-v7a
○ cmake ../../ -DANDROID_ABI="armeabi-v7a" -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang
○ make
○ cd build/Android
○ mkdir -p Release/arm64-v8a
○ cd Release/arm64-v8a
○ cmake ../../ -DANDROID_ABI="arm64-v8a" -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang
○ make
○ cd build/Android
○ mkdir -p Release/x86
○ cd Release/x86
○ cmake ../../ -DANDROID_ABI="x86" -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang
○ make
○ cd build/Android
○ mkdir -p Release/x86_64
○ cd Release/x86_64
○ cmake ../../ -DANDROID_ABI="x86_64" -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang
○ make
rvm --default use ruby-2.7.8
rustup update
rustup toolchain install stable
rustup default stable
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
rustup target add wasm32-unknown-emscripten
cargo install cbindgen cargo-lipo
cd build/OSX
mkdir Release
cd Release
cmake .. -DCMAKE_BUILD_TYPE=Release
make
rustup update
rustup toolchain install stable
rustup default stable
rustup toolchain install stable-x86_64-apple-darwin
rustup toolchain install nightly-x86_64-apple-darwin
rustup component add rust-src --toolchain nightly-x86_64-apple-darwin
rustup target add x86_64-apple-ios aarch64-apple-ios-sim aarch64-apple-ios
cargo install cbindgen cargo-lipo
cd build/iOS
mkdir Release/
cmake .. -DCMAKE_BUILD_TYPE=Release -DiOS_ABI=arm64-v8a -DIOS_ARCH="arm64" -DENABLE_ARC=0 -DENABLE_BITCODE=0 -DENABLE_VISIBILITY=1 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_TOOLCHAIN_FILE=$PWD/../iOS.cmake
make