Cellframe Node build from source guide using cmake

For Linux users

Install the following packages using following commands:

sudo apt-get update
sudo apt-get install build-essential cmake dpkg-dev libz-dev libmagic-dev libsqlite3-dev traceroute debconf-utils libexpat1-dev

Clone the source files of the Cellframe Node from gitlab with all submodules.

git clone https://gitlab.demlabs.net/cellframe/cellframe-node.git --recursive

Create a build directory and run cmake:

cd cellframe-node
mkdir ./build & cd ./build && cmake .. && make

Warning

In case you don’t have a C compiler, you will need to install it.

sudo apt-get install gcc

Specify the path to the compiler for Cmake

export CXX=/path

The default path is /usr/bin/g++

Сreate cellframe-node installation package from the build directory using this command:

cpack

Note

At the moment, only deb package (debian-based distribs) can be created using cmake

Install package:

sudo dpkg -i ./<name-of-package.deb>

Warning

In the case when you have previous version of CellFrameNode installed, it is required to apply the changes associated with the service file by following:

systemctl daemon-reload

For Windows users

Use MSYS2 teminal for the following commands:

Update information about available packages

pacman -Syy

Install the necessary packages sequentially

pacman -S --noconfirm msys2-runtime ncurses pacman pacman-mirrors pactoys-git pax pkgconf pkgfile rebase sed tftp-hpa time ttyrec tzcode util-linux which base base-devel bsdcpio
pacman -S --noconfirm bash bash-completion bsdcpio bsdtar bzip2 coreutils curl dash dtc file filesystem findutils flex gawk gcc-libs getent git grep gzip inetutils info less
pacman -S --noconfirm libargp lndir mingw-w64-x86_64-clang-analyzer mingw-w64-x86_64-cmake mingw-w64-x86_64-dlfcn mingw-w64-x86_64-file mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb
pacman -S --noconfirm mingw-w64-x86_64-json-c mingw-w64-x86_64-libzip mingw-w64-x86_64-python mingw-w64-x86_64-qt-creator mingw-w64-x86_64-qt5-static mintty msys2-keyring msys2-launcher
pacman -S --noconfirm clang cmake dtc filesystem lndir mc mingw-w64-clang-x86_64-json-c mingw-w64-x86_64-clang-analyzer mingw-w64-x86_64-cmake mingw-w64-x86_64-dlfcn mingw-w64-x86_64-file
pacman -S --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc-ada mingw-w64-x86_64-gcc-fortran mingw-w64-x86_64-gcc-libgfortran mingw-w64-x86_64-gcc-objc mingw-w64-x86_64-gdb
pacman -S --noconfirm mingw-w64-x86_64-gdb-multiarch mingw-w64-x86_64-geany mingw-w64-x86_64-gstreamer mingw-w64-x86_64-json-c mingw-w64-x86_64-libc++ mingw-w64-x86_64-libgccjit
pacman -S --noconfirm mingw-w64-x86_64-libmangle-git mingw-w64-x86_64-libzip mingw-w64-x86_64-mesa
pacman -S --noconfirm mingw-w64-x86_64-tools-git mingw-w64-x86_64-winstorecompat-git msys2-runtime pkgfile tree

Using the Git Bash terminal, clone the project to a folder whose path does not contain Cyrillic.

git clone https://gitlab.demlabs.net/cellframe/cellframe-node.git

Go to the project folder. Initialize and update the submodules

git submodule update --init --recursive

Open the MSYS2 MINGW64 terminal and enter the command:

cmake.exe -S . -B <path to build> -DCMAKE_C_COMPILER=C:/msys64/mingw64/bin/cc.exe -G Ninja -DCMAKE_C_COMPILER_WORKS=1 -DCMAKE_CXX_COMPILER_WORKS=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo && cmake --build <path to build> -j$(nproc)

Where <path to build> - the path to build the project that will be created automatically.

Warning

The path to the C complier may be different on your device. Check where it is installed, and if it necessary, change it in the command above.

DCMAKE_C_COMPILER=<Your path to the C complier>