Build Icinga2 from sources on RHEL8/CentOS8

Hello,
I’ve found some problems during building Icinga2 from sources on CentOS 8. The documentation I’ve found in your official man pages is only for CentOS <=7 - https://icinga.com/docs/icinga2/latest/doc/21-development/#centos-7

All dependencies installed without problems

dnf -y install 'dnf-command(config-manager)' && \
    dnf config-manager --set-enabled PowerTools && \
    dnf -y install epel-release && \
    dnf -y update && \
    dnf -y install make \
                   ccache \
                   cmake \
                   gcc \
                   gcc-c++ \
                   flex \
                   bison \
                   openssl-devel \
                   boost169-devel \
                   mysql-devel \
                   postgresql-devel \
                   systemd-devel \
                   libedit-devel \
                   libstdc++-devel \
                   rpmdevtools \
                   rpm-build \
                   wget \
                   ruby \
                   ruby-devel \
                   gdb \
                   git \
                   which && \
    dnf clean all && \
    ln -sf /bin/ccache /usr/local/bin/gcc && \
    ln -sf /bin/ccache /usr/local/bin/g++

But when I’m trying to build Icinga2 I’m getting the next problem
[root@71a867f56400 debug]# cmake -DCMAKE_BUILD_TYPE=Debug
-DICINGA2_UNITY_BUILD=OFF
-DBoost_NO_BOOST_CMAKE=TRUE
-DBoost_NO_SYSTEM_PATHS=TRUE
-DBOOST_LIBRARYDIR=/usr/lib64/boost169
-DBOOST_INCLUDEDIR=/usr/include/boost169
-DBoost_ADDITIONAL_VERSIONS=‘1.69;1.69.0’
-DCMAKE_INSTALL_PREFIX=/opt/icinga2-agent …
– The C compiler identification is GNU 8.3.1
– The CXX compiler identification is GNU 8.3.1
– Check for working C compiler: /usr/lib64/ccache/cc
– Check for working C compiler: /usr/lib64/ccache/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/lib64/ccache/c++
– Check for working CXX compiler: /usr/lib64/ccache/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Prefixing in ICINGA2_FULL_CONFIGDIR “etc/icinga2” with /opt/icinga2-agent
– Prefixing in ICINGA2_FULL_CACHEDIR “var/cache/icinga2” with /opt/icinga2-agent
– Prefixing in ICINGA2_FULL_DATADIR “var/lib/icinga2” with /opt/icinga2-agent
– Prefixing in ICINGA2_FULL_LOGDIR “var/log/icinga2” with /opt/icinga2-agent
– Prefixing in ICINGA2_FULL_SPOOLDIR “var/spool/icinga2” with /opt/icinga2-agent
– Prefixing in ICINGA2_FULL_RUNDIR “var/run” with /opt/icinga2-agent
– Prefixing in ICINGA2_FULL_INITRUNDIR “var/run/icinga2” with /opt/icinga2-agent
– Prefixing in ICINGA2_FULL_PKGDATADIR “share/icinga2” with /opt/icinga2-agent
– Prefixing in ICINGA2_FULL_INCLUDEDIR “share/icinga2/include” with /opt/icinga2-agent
– ICINGA2_VERSION_SAFE=2.12.0 CHOCO_VERSION_SHORT=2.12.0
CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:839 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:166 (find_package)

CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:839 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:166 (find_package)


CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:839 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:166 (find_package)


CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:839 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:166 (find_package)


CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:839 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:166 (find_package)


CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:839 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:166 (find_package)


CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:839 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:166 (find_package)


CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:839 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:166 (find_package)


CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:839 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:166 (find_package)


CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:839 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:166 (find_package)


-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Error at /usr/share/cmake/Modules/FindBoost.cmake:2044 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.69.0

  Boost include path: /usr/include/boost169

  Could not find the following Boost libraries:

          boost_context

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:166 (find_package)


-- Found OpenSSL: /usr/lib64/libcrypto.so (found version "1.1.1c")
-- Found JSON: /build/icinga2/third-party/nlohmann_json
-- Found UTF8CPP: /build/icinga2/third-party/utf8cpp/source
-- Found Editline: /lib64/libedit.so
-- Found Termcap: /lib64/libtermcap.so
-- Performing Test CXX_INVALID_PCH
-- Performing Test CXX_INVALID_PCH - Success
-- Looking for __COUNTER__
-- Looking for __COUNTER__ - found
-- Looking for vfork
-- Looking for vfork - found
-- Looking for backtrace_symbols
-- Looking for backtrace_symbols - found
-- Looking for pipe2
-- Looking for pipe2 - found
-- Looking for nice
-- Looking for nice - found
-- Looking for dladdr in dl
-- Looking for dladdr in dl - found
-- Looking for backtrace_symbols in execinfo
-- Looking for backtrace_symbols in execinfo - not found
-- Looking for C++ include cxxabi.h
-- Looking for C++ include cxxabi.h - found
-- Performing Test CXX_FEATURE_OVERRIDE
-- Performing Test CXX_FEATURE_OVERRIDE - Success
-- Target architecture - x86_64
-- Found BISON: /usr/bin/bison (Required is at least version "2.3.0")
-- Found FLEX: 2.6.1 (Required is at least version "2.5.31")
-- MySQL Include dir: /usr/include/mysql  library dir: /lib64/mysql
-- MySQL client libraries: mysqlclient;mariadbclient
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found PostgreSQL: /usr/lib64/libpq.so
CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:839 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
  third-party/cmake/BoostTestTargets.cmake:58 (find_package)
  test/CMakeLists.txt:3 (include)


-- Test 'base' uses the CMake-configurable form of the boost test framework - congrats! (Including File: test-runner.cpp)
-- Test 'livestatus' uses the CMake-configurable form of the boost test framework - congrats! (Including File: test-runner.cpp)
-- Test 'icinga_checkable' uses the CMake-configurable form of the boost test framework - congrats! (Including File: test-runner.cpp)
-- Configuring incomplete, errors occurred!
See also "/build/icinga2/debug/CMakeFiles/CMakeOutput.log".
See also "/build/icinga2/debug/CMakeFiles/CMakeError.log".

But all boost libraries are installed
[root@71a867f56400 debug]# yum list installed | grep boost
Failed to set locale, defaulting to C.UTF-8
boost169.x86_64 1.69.0-4.el8 @epel
boost169-atomic.x86_64 1.69.0-4.el8 @epel
boost169-chrono.x86_64 1.69.0-4.el8 @epel
boost169-container.x86_64 1.69.0-4.el8 @epel
boost169-context.x86_64 1.69.0-4.el8 @epel
boost169-contract.x86_64 1.69.0-4.el8 @epel
boost169-coroutine.x86_64 1.69.0-4.el8 @epel
boost169-date-time.x86_64 1.69.0-4.el8 @epel
boost169-devel.x86_64 1.69.0-4.el8 @epel
boost169-fiber.x86_64 1.69.0-4.el8 @epel
boost169-filesystem.x86_64 1.69.0-4.el8 @epel
boost169-graph.x86_64 1.69.0-4.el8 @epel
boost169-iostreams.x86_64 1.69.0-4.el8 @epel
boost169-locale.x86_64 1.69.0-4.el8 @epel
boost169-log.x86_64 1.69.0-4.el8 @epel
boost169-math.x86_64 1.69.0-4.el8 @epel
boost169-numpy2.x86_64 1.69.0-4.el8 @epel
boost169-numpy3.x86_64 1.69.0-4.el8 @epel
boost169-program-options.x86_64 1.69.0-4.el8 @epel
boost169-python2.x86_64 1.69.0-4.el8 @epel
boost169-python3.x86_64 1.69.0-4.el8 @epel
boost169-random.x86_64 1.69.0-4.el8 @epel
boost169-regex.x86_64 1.69.0-4.el8 @epel
boost169-serialization.x86_64 1.69.0-4.el8 @epel
boost169-stacktrace.x86_64 1.69.0-4.el8 @epel
boost169-system.x86_64 1.69.0-4.el8 @epel
boost169-test.x86_64 1.69.0-4.el8 @epel
boost169-thread.x86_64 1.69.0-4.el8 @epel
boost169-timer.x86_64 1.69.0-4.el8 @epel
boost169-type_erasure.x86_64 1.69.0-4.el8 @epel
boost169-wave.x86_64 1.69.0-4.el8 @epel

In attach my CMakeOutput.log and CMakeError.log
CMakeError.log (3.7 KB) CMakeOutput.log (54.6 KB)

Please, help me to solve this problem, if you need additional information I could provide it for you.
Thank you for any help.

I found a fix of the mentioned problem, it’s connected to the problematic version of cmake - https://gitlab.kitware.com/cmake/cmake/-/issues/18126
To fix this problem you should update your cmake to the latest version, or version >=3.11.4

The problem is solved, thank’s for your attention.