diff --git a/BUILD.md b/BUILD.md index cd55fd1531c1909884604996f5109ae8554a1985..de8281075161298550feaceba422927f7ff55319 100644 --- a/BUILD.md +++ b/BUILD.md @@ -3,22 +3,31 @@ This document provides instructions on how to build DHTNet from source code. Ensure that you have met all the dependencies before proceeding with the build. ## Dependencies -Follow these instructions to install DHTNet dependencies depending on your system: -### Debian/Ubuntu +Follow these instructions to install DHTNet's dependencies depending on your system: -#### Ubuntu 20.04+: +### Ubuntu 20.04+: ```bash -sudo apt install libncurses5-dev libreadline-dev nettle-dev libgnutls28-dev libargon2-dev libmsgpack-dev libssl-dev libfmt-dev libjsoncpp-dev libhttp-parser-dev libasio-dev libyaml-cpp-dev libunistring-dev libcppunit-dev +sudo apt install build-essential pkg-config cmake git wget \ + libtool autotools-dev autoconf \ + cython3 python3-dev python3-setuptools python3-build python3-virtualenv \ + libncurses5-dev libreadline-dev nettle-dev libcppunit-dev \ + libgnutls28-dev libuv1-dev libjsoncpp-dev libargon2-dev libunistring-dev \ + libssl-dev libfmt-dev libhttp-parser-dev libasio-dev libmsgpack-dev libyaml-cpp-dev \ + libnatpmp-dev libupnp-dev ``` ### Fedora + ```bash -sudo dnf install readline-devel gnutls-devel msgpack-devel asio-devel libargon2-devel fmt-devel http-parser-devel cppunit-devel jsoncpp-devel +sudo dnf install cmake gcc-c++ git readline-devel gnutls-devel msgpack-devel asio-devel libargon2-devel \ + fmt-devel http-parser-devel cppunit-devel jsoncpp-devel libnatpmp-devel libupnp-devel \ + libunistring-devel yaml-cpp-devel zlib-devel ``` ### macOS + ```bash brew install gnutls msgpack-cxx argon2 asio ``` @@ -27,7 +36,7 @@ brew install gnutls msgpack-cxx argon2 asio Follow these steps to build DHTNet ( Note: You will need ressources (RAM, CPU) for the build to succeed ): -### 1. Clone the DHTNet Repository +### 1. Clone the DHTNet repository Clone the DHTNet repository to your local machine: @@ -36,32 +45,16 @@ git clone https://github.com/savoirfairelinux/dhtnet.git cd dhtnet ``` -### 2. Update dependencies: - -Ensure that you have the latest versions of the required Git submodules, pjproject, and OpenDHT. Run the following command: - - ```bash - git submodule update --init --recursive - ``` -This step ensures that your project has the most up-to-date dependencies for the build process. +### 2. Update dependencies -### 3. Install dependencies: - -#### Add tools and libraries - -##### Ubuntu 20.04+: +Run the following command: ```bash -sudo apt install build-essential pkg-config cmake git wget \ - libtool autotools-dev autoconf \ - cython3 python3-dev python3-setuptools python3-build python3-virtualenv \ - libncurses5-dev libreadline-dev nettle-dev libcppunit-dev \ - libgnutls28-dev libuv1-dev libjsoncpp-dev libargon2-dev libunistring-dev \ - libssl-dev libfmt-dev libhttp-parser-dev libasio-dev libmsgpack-dev libyaml-cpp-dev \ - +git submodule update --init --recursive ``` +This will ensure that you have the correct versions of the Git submodules required for the build process (OpenDHT, PJPROJECT, RESTinio). -### 4. Build: +### 3. Build Create a build directory and use CMake to configure the build: diff --git a/CMakeLists.txt b/CMakeLists.txt index 4297437a04a90f03a6911e0bc64d42e8245fb047..d4ffb09c1e79b9743e773e84b93180c2755e5621 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,9 +22,9 @@ option(DHTNET_PUPNP "Enable UPnP support" ON) option(DHTNET_NATPMP "Enable NAT-PMP support" ON) option(DHTNET_TESTABLE "Enable API for tests" ON) option(BUILD_TOOLS "Build tools" ON) -option(BUILD_BENCHMARKS "Build benchamrks" ON) +option(BUILD_BENCHMARKS "Build benchmarks" ON) option(BUILD_DEPENDENCIES "Build dependencies" ON) -option (DNC_SYSTEMD_UNIT_FILE_LOCATION "Where to install systemd unit file") +option(DNC_SYSTEMD_UNIT_FILE_LOCATION "Where to install systemd unit file") option(DNC_SYSTEMD "Enable dnc systemd integration" ON) option(CODE_COVERAGE "Enable coverage reporting" OFF) @@ -195,6 +195,7 @@ if (DHTNET_PUPNP AND NOT MSVC) message("libupnp not found: disabling") set(DHTNET_PUPNP Off) else() + message("libupnp found") set(upnp_LIBRARIES PkgConfig::upnp) set (requiresprivate "${requiresprivate} libupnp") endif()