Skip to content

Building

Pixel3rr0r edited this page Dec 10, 2024 · 4 revisions

The latest stable version of Armory is available in precompiled, GPG-signed binaries for Windows, Ubuntu/Debian, and Mac. You can download them from the releases page. Non-Debian-based Linux users will have to compile from source.

Building on Linux

Compiling in Linux has proven to be quite easy. There are only a couple of dependencies, and they're all versionless, so there are no games you have to play with system library versions in order to get it to work.

  1. Install dependencies:
    $ sudo apt-get install git build-essential automake autotools-dev autoconf pkg-config python-psutil libtool protobuf-compiler libprotobuf-dev swig python3-dev python3-pip libtool-bin
    $ pip install psutil, protobuf, cffi
    
  2. Clone the following libraries and build them:
  3. Update and start submodules (git submodule update --init --recursive)
  4. In the root folder, start the build process. Replace /path/to/libwebsockets and /path/to/libbtc with the path to the folders you built each library in:
    $ ./autogen.sh
    $ ./configure --with-own-lws=/path/to/libwebsockets --with-own-libbtc=/path/to/libbtc
    $ mkdir build & cd build
    $ make -j4
    
  5. Build required python module:
    $ cd c20p1305_cffi
    $ python3 c20p1305_cffi.py --libbtc_path=path/to/libbtc
    

Building on Windows

1. Installing pre-requisites

2. Installing build tools

As you will be exclusively using MSYS2 MINGW64, make sure you have opened that and not the UCRT/MSYS/CLANG terminal.

pacman -Syu
pacman -S autoconf automake libtoolize mingw-w64-x86_64-gcc mingw-w64-x86_64-libevent mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja git

Next, create a symlink for the cmake binary in order to use the cmake command in MinGW64:

  1. Open command prompt and navigate to <your MSYS2 installation path>\mingw64\bin
  2. Run mklink make mingw32-make.exe

3. Installing Python dependencies

python -m venv .venv
.venv\Scripts\activate.bat
pip install pyside6 qtpy cffi pycapnp setuptools

4. Building dependencies

Pick a single folder in which you will download all dependencies as well as BitcoinArmory's source. From there, clone and build the dependencies using MinGW64.

Note

Be sure to use a separate build directory while building dependencies for LWS, Cap'n Proto, BitcoinArmory and c20p1305_cffi. That way you can always remove it for a clean reset if needed:

rm -r build 
mkdir build 
cd build 
  1. libbtc:
    git clone https://github.com/libbtc/libbtc.git
    cd libbtc
    sh autogen.sh
    ./configure --disable-wallet --disable-tools --disable-net
    make
    
  2. libwebsockets:
    git clone https://github.com/warmcat/libwebsockets.git
    cd libwebsockets
    git checkout v4.3.3
    mkdir build & cd build
    cmake -G Ninja -DLWS_WITH_SSL=OFF ..
    ninja
    
  3. LMDB:
    git clone https://github.com/LMDB/lmdb.git
    cd libraries/liblmdb
    make
    
  4. Cap'n Proto:
    git clone https://github.com/capnproto/capnproto.git
    cd capnproto
    git checkout v1.0.2
    mkdir build & cd build
    cmake -G Ninja ..
    ninja
    

5. Building BitcoinArmory

git clone https://github.com/goatpig/BitcoinArmory
cd BitcoinArmory
mkdir build & cd build
cmake -G Ninja ..
ninja

Warning

If you have cloned and built the dependencies to a folder that is NOT shared with BitcoinArmory, this will fail! In order to make it work, build BitcoinArmory using cmake -G Ninja .. -DTHIRD_PARTY_PATH=path/to/dependencies.

6. Building c20p1305_cffi

  1. Clone the c20p1305_cffi repository and build the shim library:
    git clone https://github.com/goatpig/c20p1305_cffi.git
    cd c20p1305_cffi
    mkdir build
    cd build
    cmake -G Ninja ..
    ninja
    
    If cmake cannot find BitcoinArmory, you can specify it using -DARMORY_PATH=path/to/BitcoinArmory.
  2. Using the Windows Terminal, navigate to c20p1305_cffi/build/src and build the definition library:
    cd src
    lib.exe" /MACHINE:x64 /def:libc20p1305deps.def
    
    This will generate libc20p1305deps.dll.
  3. Still inside the Windows Terminal, build the CFFI package from within c20p1305_cc/cffi:
    cd ../../cffi
    python c20p1305_cffi.py --armory_path=path/to/BitcoinArmory --libbtc_path=path/to/libbtc
    
    This will generate c20p1305.cp<your-python-version>-win_amd64.pyd. If BitcoinArmory and libbtc share the same parent directory as c20p1305_cffi, you can omit both path arguments.
  4. Copy both libc20p1305deps.dll and c20p1305.cp3XX-win_amd64.pyd to BitcoinArmory/armoryengine.

Building on MacOS X

Warning

The instructions below may be outdated and will be updated in time.

To build Armory on Mac OS X, you can follow the instructions found here: https://github.com/goatpig/BitcoinArmory/blob/master/osxbuild/OSX_build_notes.md