Vés al contingut principal

Compilation

aMule uses CMake (minimum version 3.10) as its build system. This page covers the complete build, install, and uninstall workflow. Platform-specific dependency installation commands are in the sub-pages for Windows, macOS, Linux, and BSD.

Dependencies

Required

PackageMinimum versionNotes
CMake3.10Build system
zlib1.2.3Compression
wxWidgets3.2.0GUI toolkit (3.2 branch or newer)
Crypto++5.6Cryptographic functions
Boost1.70Headers only; only asio is used

wxWidgets must be built with Unicode support (the default since wx 3.0). aMule is Unicode-only.

Optional

PackageWhat it enables
libgd ≥ 2.0.0Statistics images in cas
libupnp ≥ 1.6.6UPnP port forwarding
libmaxminddb ≥ 1.0Country flags and IP→country mapping
gettext ≥ 0.11.5Native-language support (NLS)
po4aTranslated man pages, rendered at build time; see Translated Man Pages
libayatana-appindicator3Linux only. StatusNotifierItem (SNI) tray-icon backend; see Building on Linux.
glib-2.0 dev headerswxGTK builds (Linux / BSD). Required for the g_set_prgname() desktop-entry binding when building amule, amuled, or amulegui. No-op on macOS.
readlineLine editing in amulecmd and amuleweb
binutils-dev / libbfdBFD-based crash handler
libpngPNG support in amuleweb

Quick Start

# Clone the repository
git clone https://github.com/amule-org/amule.git
cd amule

# Install platform-specific dependencies first (see sub-pages)

# Configure — build the all-in-one GUI + daemon
cmake -B build \
-DBUILD_MONOLITHIC=YES \
-DBUILD_DAEMON=YES

# Build
cmake --build build -j"$(nproc)"

# Install (default prefix: /usr/local)
sudo cmake --install build

Build Options

All options are passed as -DOPTION=YES or -DOPTION=NO to the initial cmake -B build command.

OptionDefaultBuilds
BUILD_MONOLITHICYESamule — all-in-one GUI client
BUILD_DAEMONNOamuled — headless daemon
BUILD_REMOTEGUINOamulegui — remote control GUI
BUILD_WEBSERVERNOamuleweb — HTTP web interface
BUILD_AMULECMDNOamulecmd — CLI client for the daemon
BUILD_ED2KYESed2k — eD2k link handler helper
BUILD_ALCNOalc — aMuleLinkCreator GUI
BUILD_ALCCNOalcc — aMuleLinkCreator console
BUILD_CASNOcas — C statistics tool (Unix only)
BUILD_WXCASNOwxcas — GUI statistics tool
BUILD_FILEVIEWNOfileview — console file viewer (experimental)
BUILD_TESTINGYESUnit test suite
ENABLE_NLSYESNative-language support (gettext)
TRANSLATED_MANPAGESYESTranslated man pages rendered via po4a (requires ENABLE_NLS; skipped with a notice if po4a is not found)
ENABLE_UPNPYESUPnP port forwarding
ENABLE_IP2COUNTRYYESIP→country mapping (libmaxminddb)
ENABLE_MMAPNOUse memory-mapped file I/O where supported
DOWNLOAD_AND_BUILD_DEPSNOWhen an optional dependency is missing, let CMake download and build it from source instead of failing (requires Git)

To list all available options with descriptions:

cmake -LAH -B build | less

Building Everything

cmake -B build \
-DBUILD_MONOLITHIC=YES \
-DBUILD_DAEMON=YES \
-DBUILD_REMOTEGUI=YES \
-DBUILD_WEBSERVER=YES \
-DBUILD_AMULECMD=YES \
-DBUILD_ED2K=YES \
-DBUILD_ALC=YES \
-DBUILD_ALCC=YES \
-DBUILD_CAS=YES \
-DBUILD_WXCAS=YES \
-DBUILD_TESTING=YES \
-DENABLE_NLS=YES \
-DENABLE_UPNP=YES \
-DENABLE_IP2COUNTRY=YES

Or, using the BUILD_EVERYTHING shorthand:

cmake -B build -DBUILD_EVERYTHING=YES

BUILD_EVERYTHING turns on every build target (BUILD_*). It does not touch the ENABLE_* toggles, but ENABLE_NLS, ENABLE_UPNP, and ENABLE_IP2COUNTRY are all YES by default, so a default BUILD_EVERYTHING invocation produces a full-feature build provided their respective libraries (gettext, libupnp, libmaxminddb) are installed.

Debug Build

cmake -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_MONOLITHIC=YES
cmake --build build -j"$(nproc)"

The Debug type enables compiler optimisation flags for debugging and retains full symbol information. See Debugging for how to use it with GDB and Valgrind.

Installing

sudo cmake --install build

Default installation layout under /usr/local:

WhatWhere
Binaries/usr/local/bin/
Translation catalogs/usr/local/share/locale/<lang>/LC_MESSAGES/amule.mo
Man pages (English)/usr/local/share/man/man1/
Man pages (translated)/usr/local/share/man/<lang>/man1/
Data files (skins, webserver)/usr/local/share/amule/
Documentation/usr/local/share/doc/amule/
License/usr/local/share/LICENSE.md
Desktop entries/usr/local/share/applications/
Icon/usr/local/share/icons/hicolor/128x128/apps/
AppStream metadata/usr/local/share/metainfo/

Custom Install Prefix

Override the prefix with -DCMAKE_INSTALL_PREFIX:

cmake -B build -DCMAKE_INSTALL_PREFIX=/opt/amule -DBUILD_MONOLITHIC=YES
cmake --build build -j"$(nproc)"
sudo cmake --install build

Developer Install (No sudo)

Install to $HOME/.local during development. No root required, and easy to undo:

cmake --install build --prefix=$HOME/.local

Binaries land in ~/.local/bin/ (make sure it is in your $PATH).

On Linux, after a raw cmake --install you may need to refresh the icon cache and ensure the SNI tray-icon backend is present — see Desktop Integration.

Uninstalling

CMake records every installed file in build/install_manifest.txt. Use it to remove them:

# System install
sudo xargs rm -f < build/install_manifest.txt

# Local install (no sudo needed)
xargs rm -f < build/install_manifest.txt

Translated Man Pages

The translated man pages are not tracked in git — they are rendered at build time by po4a from the English masters (docs/man/*.1.in, src/utils/*/docs/*.1.in) and the translation catalogs (docs/man/po/manpages-<lang>.po), then installed under <prefix>/share/man/<lang>/man1/. Rendering is controlled by the TRANSLATED_MANPAGES option (default YES when ENABLE_NLS=YES): if po4a is found, the pages are rendered as part of the normal build; if it is missing, the build prints a notice and installs only the English pages — pass -DTRANSLATED_MANPAGES=NO to silence it.

After editing an English master, refresh the translation catalogs with ./scripts/update-manpages-po.sh and commit the diff (CI checks this). See Man Page Translations for the full translation workflow.

For packagers

To build without po4a and still ship translated man pages, use the source bundle attached to each GitHub Release (aMule-<VERSION>-src.tar.gz) instead of the GitHub-generated "Source code" archive. It includes the pre-rendered *.<lang>.1.in files alongside the English masters, so po4a is not needed at build time.

Running Without Installing

All built binaries are placed in build/ and can be run directly:

./build/amule
./build/amuled
./build/amulecmd

This is the recommended workflow during development — no need to install after every build.

Speeding Up Builds with ccache

If ccache is installed, CMake detects it automatically and uses it as a compiler launcher. Incremental rebuilds are significantly faster when switching between branches or performing git bisect sessions:

# Debian / Ubuntu
sudo apt install ccache

# Fedora / RHEL
sudo dnf install ccache

Running the Unit Tests

cmake -B build -DBUILD_TESTING=YES -DBUILD_MONOLITHIC=YES
cmake --build build -j"$(nproc)"
ctest --test-dir build --output-on-failure

See Testing for the full test suite documentation.