Build on Windows¶
The module from source in MSYS2, with the versions of the packages that CI builds with.
- Download and install MSYS2.
- Press the Windows button and launch
MSYS2 MINGW64. - Update packages:
pacman -Syuand confirm at prompts. -
Relaunch MSYS2 (if necessary) and install dependencies:
pacman -S mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-unbound mingw-w64-x86_64-protobuf git gettext base-devel wget -
Clone repo:
git clone --recurse-submodules https://github.com/libmonero/monero-python.git -
Install the packages at the versions that CI uses (ICU, hidapi and libusb, boost, pybind11, and OpenSSL with the packages that link to it). bin/msys2_pins.txt has them with their sha256, and the script downloads, checks and installs a group of them:
cd monero-python for group in icu hidapi-libusb boost pybind11 openssl; do bin/install_msys2_pins.sh $group; donehidapi and libusb were removed from the msys2 mingw64 repo, the script installs the archived packages. OpenSSL is at 3.6.5 because the net_ssl.cpp of monero-project does not build with OpenSSL 4, and the packages that link to it go back with it (unbound, ldns, curl, libarchive, hiredis, libssh2 and ngtcp2): the ones of the repo are rebuilt against OpenSSL 4. CI also pins the MinGW toolchain (
bin/install_msys2_pins.sh toolchain), see build-windows.yml. -
Build monero-cpp, located as a submodule at ./external/monero-cpp:
cd external/monero-cpp ./bin/build_libmonero_cpp.sh cd ../.. -
Build monero-python:
mkdir -p build && cd build && cmake .. cmake --build . -
Or run build script:
./bin/build_libmonero_python.sh