Build on Linux and macOS¶
The module from source, with monero-project and monero-cpp, for the Python of the system or of an environment.
- Clone the project repository:
git clone --recurse-submodules https://github.com/libmonero/monero-python.git - Install the build dependencies, on Ubuntu and Debian with the script that CI uses (the packages of apt for monero-project, monero-cpp and the module, and
python3-venvfor the virtual environment of the tests):On other systems, follow the instructions of monero-cpp.cd monero-python ./bin/install_dependencies_linux.sh - Build monero-project and the monero-cpp submodule (located at
./external/monero-cpp):./bin/build_monero_cpp.sh. It runs 3 jobs, a compiler of monero takes up to 1.5 GB of memory: setJOBSfor more or fewer. - Build monero-python to
./build/:
mkdir -p build cd build cmake .. make - Or build and install monero-python with pip:
pip3 install . --break-system-packages - Or run build script:
./bin/build_libmonero_python.sh
VS Code: the repository has tasks to build, test and lint, launch configurations to debug the tests in Python and in C++, and to build and serve the docs: VS Code.
Faster rebuilds: if ccache is installed it is used automatically for monero and monero-python (pass
-DUSE_CCACHE=OFFto cmake to disable it). To use it for monero-cpp as well, build that with-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache.