24 Oct 2022 [CT] [guides]

CT-002: Building from source - Monero CLI

This is the second report in the new Cypherpunk Transmission series.

Motivation

Anyone can download, run and install binaries that were built by someone else. Relatively few users ever build their own programs, despite the advantages:

Building from source usually involves a series of steps, such as compiling, linking, running automated tests and packaging. It can sound nightmarish for new users, but it certainly is not.

By getting familiar with the process, you will also be able to start contributing to your favorite open source projects, like Monero.

Assumptions

Compiling Monero

Let’s practice by compiling the official Monero CLI Wallet from source.

1. Install dependencies

Paste this long command in a terminal to upgrade packages, install git, and all dependencies:

sudo apt update && sudo apt upgrade -y && sudo apt install build-essential cmake pkg-config libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libexpat1-dev libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev python3 ccache doxygen graphviz git

2. Get source code

Recursively clone the repository and change directory to source code root:

git clone --recursive https://github.com/monero-project/monero && cd monero

3. Build

Compile the most stable Monero release:

git checkout release-v0.18 && make

Done! The executable files (including monerod, monero-wallet-cli) can be found in build/Linux/release-v0.18/release/bin.

Note that the process might take a while to complete.

Observations

Reach out to other Monero contributors if you get any errors or if you discover anything interesting during your journey.


Feedback

Let me know if you find this helpful and, depending on interest, I will do my best to post a new Cypherpunk Transmission report every (other?) Monday.

Questions, edits and suggestions are always appreciated @ /about/.

-3RA

Credit goes to gnuteardrops from monero.graphics for the amazing xkcd graphic. Work and xkcd Script font licensed under CC BY-NC 3.0.