Skip to content

Instantly share code, notes, and snippets.

@billythedummy
Last active June 28, 2022 13:00
Show Gist options
  • Save billythedummy/2d452d0bf17a67d7c4aa02c48a547327 to your computer and use it in GitHub Desktop.
Save billythedummy/2d452d0bf17a67d7c4aa02c48a547327 to your computer and use it in GitHub Desktop.
building solana tool suite for aarch64

Building solana tool suite for aarch64

Following instructions from https://docs.solana.com/cli/install-solana-cli-tools#build-from-source.

Pre-reqs

  • rust toolchain
  • >8GB disk space

Support

aarch64-unknown-linux-gnu is not officially supported, so solana-install init will not work because https://github.com/solana-labs/solana/releases/download/vX.X.X/solana-release-aarch64-unknown-linux-gnu.tar.bz2 does not exist. You will need to setup the directory structures and config files yourself after installation if you wish to mirror the supported envs.

Assuming v1.10.27 was built at ~/solana-1.10.27

mkdir -p ~/.local/share/solana/install/releases/1.10.27/solana-release
# Copy a version.yml to ~/.local/share/solana/install/releases/1.10.27/solana-release/version.yml, edit target (not sure if necessary)
cp -r ~/solana-1.10.27/bin ~/.local/share/solana/install/releases/1.10.27/solana-release
ln -s ~/.local/share/solana/install/releases/1.10.27/solana-release ~/.local/share/solana/install/active_release

mkdir -p ~/.config/solana/cli
# Copy a cli config.yml to ~/.config/solana/cli/config.yml

# Append to PATH
export PATH="~/.local/share/solana/install/active_release/bin:$PATH"

apt packages

  • pkg-config
  • libudev-dev
  • libclang-dev
  • clang
  • libssl-dev

cmake

cmake on Ubuntu 18.04 apt is 3.10 which does not have the --parallel build flag. >3.12 must be installed.

To do so, add kitware's apt repo before install:

sudo apt install software-properties-common # for apt-add-repository
wget -qO - https://apt.kitware.com/keys/kitware-archive-latest.asc | sudo apt-key add -
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
sudo apt update
sudo apt install cmake

Other stuff

  • cargo install's default behaviour is to place build artifacts in a temp folder, which means the build cache is lost across attempts. Might want to change the cargo install spl-token-cli command to include --target-dir to save spl-token-cli's build cache.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment