FairRootGroup/FairSoft

Boost

Closed this issue · 14 comments

Dear all, I am trying to install FairSoft on CENTOS 7. The sequence of commands is:

git clone -b apr22_patches https://github.com/FairRootGroup/FairSoft
sudo FairSoft/legacy/setup-centos-7.sh
mkdir build
cmake -S FairSoft -B build -C FairSoft/FairSoftConfig.cmake
cmake --build build

The output that I receive is:

[  0%] Creating directories for 'faircmakemodules'
[  0%] Performing download step (git clone) for 'faircmakemodules'
-- faircmakemodules download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/faircmakemodules-download-*.log
[  0%] No patch step for 'faircmakemodules'
[  0%] Performing configure step for 'faircmakemodules'
-- faircmakemodules configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/faircmakemodules-configure-*.log
[  0%] Performing build step for 'faircmakemodules'
-- faircmakemodules build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/faircmakemodules-build-*.log
[  0%] Performing install step for 'faircmakemodules'
-- faircmakemodules install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/faircmakemodules-install-*.log
[  4%] Completed 'faircmakemodules'
[  4%] Built target faircmakemodules
[  4%] Creating directories for 'asio'
[  4%] Performing download step (git clone) for 'asio'
-- asio download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/asio-download-*.log
[  8%] No patch step for 'asio'
[  8%] Performing configure step for 'asio'
-- asio configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/asio-configure-*.log
[  8%] Performing build step for 'asio'
-- asio build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/asio-build-*.log
[  8%] Performing install step for 'asio'
-- asio install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/asio-install-*.log
[  8%] Completed 'asio'
[  8%] Built target asio
[  8%] Creating directories for 'boost'
[  8%] Performing download step (download, verify and extract) for 'boost'
-- boost download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/boost-download-*.log
[  8%] No patch step for 'boost'
[  8%] Performing configure step for 'boost'
-- boost configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/boost-configure-*.log
[ 13%] Performing build step for 'boost'
CMake Error at /home/pasenov/fair_install/FairSoft/build/Stamp/boost/boost-build-RelWithDebInfo.cmake:37 (message):
  Command failed: 1

   './b2' '--layout=system' 'cxxstd=17' 'link=shared' 'threading=multi' 'variant=release' 'visibility=hidden' 'pch=off' '--site-config=/home/pasenov/fair_install/FairSoft/build/site-config.jam' '-j 4'

  See also

    /home/pasenov/fair_install/FairSoft/build/Log/boost-build.log


-- Log output is:
...skipping to end...

common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_atomic-1.78.0/libboost_atomic-variant-shared.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/BoostDetectToolset-1.78.0.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/Boost-1.78.0/BoostConfig.cmake
boost-install.generate-cmake-config-version- bin.v2/tools/boost_install/BoostConfigVersion.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/Boost-1.78.0/BoostConfigVersion.cmake
boost-install.generate-cmake-config- bin.v2/libs/headers/build/stage/boost_headers-config.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_headers-1.78.0/boost_headers-config.cmake
boost-install.generate-cmake-config-version- bin.v2/libs/headers/build/stage/boost_headers-config-version.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_headers-1.78.0/boost_headers-config-version.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_chrono.so.1.78.0
ln-UNIX /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_chrono.so
boost-install.generate-cmake-config- bin.v2/libs/chrono/build/stage/boost_chrono-config.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_chrono-1.78.0/boost_chrono-config.cmake
boost-install.generate-cmake-config-version- bin.v2/libs/chrono/build/stage/boost_chrono-config-version.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_chrono-1.78.0/boost_chrono-config-version.cmake
boost-install.generate-cmake-variant- bin.v2/libs/chrono/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/libboost_chrono-variant-shared.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_chrono-1.78.0/libboost_chrono-variant-shared.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_container.so.1.78.0
ln-UNIX /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_container.so
boost-install.generate-cmake-config- bin.v2/libs/container/build/stage/boost_container-config.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_container-1.78.0/boost_container-config.cmake
boost-install.generate-cmake-config-version- bin.v2/libs/container/build/stage/boost_container-config-version.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_container-1.78.0/boost_container-config-version.cmake
boost-install.generate-cmake-variant- bin.v2/libs/container/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/libboost_container-variant-shared.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_container-1.78.0/libboost_container-variant-shared.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_context.so.1.78.0
ln-UNIX /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_context.so
boost-install.generate-cmake-config- bin.v2/libs/context/build/stage/boost_context-config.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_context-1.78.0/boost_context-config.cmake
boost-install.generate-cmake-config-version- bin.v2/libs/context/build/stage/boost_context-config-version.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_context-1.78.0/boost_context-config-version.cmake
boost-install.generate-cmake-variant- bin.v2/libs/context/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/libboost_context-variant-shared.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_context-1.78.0/libboost_context-variant-shared.cmake
...on 1000th target...
gcc.compile.c++ bin.v2/libs/wave/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/cpplexer/re2clex/cpp_re.o
boost-install.generate-cmake-config- bin.v2/libs/contract/build/stage/boost_contract-config.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_contract-1.78.0/boost_contract-config.cmake
boost-install.generate-cmake-config-version- bin.v2/libs/contract/build/stage/boost_contract-config-version.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_contract-1.78.0/boost_contract-config-version.cmake
gcc.compile.c++ bin.v2/libs/coroutine/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/detail/coroutine_context.o
gcc.compile.c++ bin.v2/libs/coroutine/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/exceptions.o
gcc.compile.c++ bin.v2/libs/coroutine/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/posix/stack_traits.o
gcc.link.dll bin.v2/libs/coroutine/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/libboost_coroutine.so.1.78.0
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_coroutine.so.1.78.0
ln-UNIX /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_coroutine.so
boost-install.generate-cmake-config- bin.v2/libs/coroutine/build/stage/boost_coroutine-config.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_coroutine-1.78.0/boost_coroutine-config.cmake
boost-install.generate-cmake-config-version- bin.v2/libs/coroutine/build/stage/boost_coroutine-config-version.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_coroutine-1.78.0/boost_coroutine-config-version.cmake
boost-install.generate-cmake-variant- bin.v2/libs/coroutine/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/libboost_coroutine-variant-shared.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_coroutine-1.78.0/libboost_coroutine-variant-shared.cmake
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/gregorian/greg_month.o
gcc.link.dll bin.v2/libs/date_time/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/libboost_date_time.so.1.78.0
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_date_time.so.1.78.0
ln-UNIX /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_date_time.so
boost-install.generate-cmake-config- bin.v2/libs/date_time/build/stage/boost_date_time-config.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_date_time-1.78.0/boost_date_time-config.cmake
boost-install.generate-cmake-config-version- bin.v2/libs/date_time/build/stage/boost_date_time-config-version.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_date_time-1.78.0/boost_date_time-config-version.cmake
boost-install.generate-cmake-variant- bin.v2/libs/date_time/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/libboost_date_time-variant-shared.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_date_time-1.78.0/libboost_date_time-variant-shared.cmake
gcc.compile.c++ bin.v2/libs/exception/build/gcc-7/release/cxxstd-17-iso/link-static/pch-off/threading-multi/visibility-hidden/clone_current_exception_non_intrusive.o
gcc.archive bin.v2/libs/exception/build/gcc-7/release/cxxstd-17-iso/link-static/pch-off/threading-multi/visibility-hidden/libboost_exception.a
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_exception.a
boost-install.generate-cmake-config- bin.v2/libs/exception/build/stage/boost_exception-config.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_exception-1.78.0/boost_exception-config.cmake
boost-install.generate-cmake-config-version- bin.v2/libs/exception/build/stage/boost_exception-config-version.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_exception-1.78.0/boost_exception-config-version.cmake
gcc.compile.c++ bin.v2/libs/contract/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/contract.o
gcc.link.dll bin.v2/libs/contract/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/libboost_contract.so.1.78.0
boost-install.generate-cmake-variant- bin.v2/libs/contract/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/libboost_contract-variant-shared.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_contract.so.1.78.0
ln-UNIX /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_contract.so
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_contract-1.78.0/libboost_contract-variant-shared.cmake
gcc.compile.c++ bin.v2/libs/wave/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/instantiate_re2c_lexer.o
gcc.compile.c++ bin.v2/libs/wave/build/gcc-7/release/cxxstd-17-iso/pch-off/threading-multi/visibility-hidden/instantiate_re2c_lexer_str.o
gcc.link.dll bin.v2/libs/wave/build/gcc-7/release/cxxstd-17-iso/pch-off/threadapi-pthread/threading-multi/visibility-hidden/libboost_wave.so.1.78.0
boost-install.generate-cmake-variant- bin.v2/libs/wave/build/gcc-7/release/cxxstd-17-iso/pch-off/threadapi-pthread/threading-multi/visibility-hidden/libboost_wave-variant-shared.cmake
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_wave.so.1.78.0
ln-UNIX /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/libboost_wave.so
common.copy /home/pasenov/fair_install/FairSoft/build/Source/boost/stage/lib/cmake/boost_wave-1.78.0/libboost_wave-variant-shared.cmake
...failed updating 2 targets...
...skipped 10 targets...
...updated 1081 targets...

CMake Error at /home/pasenov/fair_install/FairSoft/build/Stamp/boost/boost-build-RelWithDebInfo.cmake:47 (message):
  Stopping after outputting logs.


gmake[2]: *** [CMakeFiles/boost.dir/build.make:85: Stamp/boost/boost-build] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:716: CMakeFiles/boost.dir/all] Error 2
gmake: *** [Makefile:101: all] Error 2

Is there any problem with boost? I reinstalled it and tried again, but I get the same message.

Thank you very much in advance.

Can you please attach the files /home/pasenov/fair_install/FairSoft/build/Log/boost-*.log and /home/pasenov/fair_install/FairSoft/build/Stamp/boost/boost-build-RelWithDebInfo.cmake for further assistance (you can drag&drop them here into the thread). Thx!

Which compiler do you use? If you use the system compiler and not one newer one from the devtools you will not be able to compile FairSoft. The system compiler does not support C++17 which is required.

boost-build.log
boost-configure.log
boost-download.log

Copying a .cmake file is not supported, so I copy-paste the text below:

cmake_minimum_required(VERSION 3.15)

set(command "./b2;--layout=system;cxxstd=17;link=shared;threading=multi;variant=release;visibility=hidden;pch=off;--site-config=/home/pasenov/fair_install/FairSoft/build/site-config.jam;-j 4")
set(log_merged "ON")
set(log_output_on_failure "ON")
set(stdout_log "/home/pasenov/fair_install/FairSoft/build/Log/boost-build.log")
set(stderr_log "/home/pasenov/fair_install/FairSoft/build/Log/boost-build.log")
execute_process(
  COMMAND ${command}
  RESULT_VARIABLE result
  OUTPUT_FILE "${stdout_log}"
  ERROR_FILE "${stderr_log}"
)
macro(read_up_to_max_size log_file output_var)
  file(SIZE ${log_file} determined_size)
  set(max_size 10240)
  if (determined_size GREATER max_size)
    math(EXPR seek_position "${determined_size} - ${max_size}")
    file(READ ${log_file} ${output_var} OFFSET ${seek_position})
    set(${output_var} "...skipping to end...\n${${output_var}}")
  else()
    file(READ ${log_file} ${output_var})
  endif()
endmacro()
if(result)
  set(msg "Command failed: ${result}\n")
  foreach(arg IN LISTS command)
    set(msg "${msg} '${arg}'")
  endforeach()
  if (${log_merged})
    set(msg "${msg}\nSee also\n  ${stderr_log}")
  else()
    set(msg "${msg}\nSee also\n  /home/pasenov/fair_install/FairSoft/build/Log/boost-build-*.log")
  endif()
  if (${log_output_on_failure})
    message(SEND_ERROR "${msg}")
    if (${log_merged})
      read_up_to_max_size("${stderr_log}" error_log_contents)
      message(STATUS "Log output is:\n${error_log_contents}")
    else()
      read_up_to_max_size("${stdout_log}" out_log_contents)
      read_up_to_max_size("${stderr_log}" err_log_contents)
      message(STATUS "stdout output is:\n${out_log_contents}")
      message(STATUS "stderr output is:\n${err_log_contents}")
    endif()
    message(FATAL_ERROR "Stopping after outputting logs.")
  else()
    message(FATAL_ERROR "${msg}")
  endif()
else()
  if(NOT "Unix Makefiles" MATCHES "Ninja")
    set(msg "boost build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/boost-build-*.log")
    message(STATUS "${msg}")
  endif()
endif()

I have installed devtoolset and I did:

scl enable devtoolset-7 bash

After gcc --version, I get:

gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

Should I change anything?

Your logs show two instances of the following error:

./boost/asio/detail/memory.hpp: In function ‘void* boost::asio::aligned_new(std::size_t, std::size_t)’:
./boost/asio/detail/memory.hpp:88:20: error: ‘aligned_alloc’ is not a member of ‘std’
   void* ptr = std::aligned_alloc(align, size);
                    ^~~~~~~~~~~~~
./boost/asio/detail/memory.hpp:88:20: note: suggested alternative: ‘aligned_union’
   void* ptr = std::aligned_alloc(align, size);
                    ^~~~~~~~~~~~~
                    aligned_union

This error is known upstream: chriskohlhoff/asio#955. However, we have tested FairSoft apr22 on CentOS 7 with devtoolset-11, see https://github.com/FairRootGroup/FairSoft/blob/apr22_patches/legacy/README.md#tested-systems.

Should I change anything?

I recommend to use devtoolset-11 as it contains GCC version 11 (released 2021) which is much newer than the GCC version 7 (released 2018) you have used. (Even if you fix the error above, I expect you will encounter more problems down the line because GCC version 7's standard library is not fully featured C++17 which FairSoft apr22 requires.) Closing, feel free to re-open if there are still questions!

Well, I actually had installed devtoolset-11, but was [automatically] pointing at the wrong directory of devtoolset-7. I fixed it. Thank you for your suggestion.

I have resolved the boost issue. Now I see the following:

[pasenov@cds01 FairSoft]$ cmake --build build
[  0%] Creating directories for 'faircmakemodules'
[  0%] Performing download step (git clone) for 'faircmakemodules'
-- faircmakemodules download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/faircmakemodules-download-*.log
[  0%] No patch step for 'faircmakemodules'
[  0%] Performing configure step for 'faircmakemodules'
-- faircmakemodules configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/faircmakemodules-configure-*.log
[  0%] Performing build step for 'faircmakemodules'
-- faircmakemodules build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/faircmakemodules-build-*.log
[  0%] Performing install step for 'faircmakemodules'
-- faircmakemodules install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/faircmakemodules-install-*.log
[  4%] Completed 'faircmakemodules'
[  4%] Built target faircmakemodules
[  4%] Creating directories for 'asio'
[  4%] Performing download step (git clone) for 'asio'
-- asio download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/asio-download-*.log
[  8%] No patch step for 'asio'
[  8%] Performing configure step for 'asio'
-- asio configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/asio-configure-*.log
[  8%] Performing build step for 'asio'
-- asio build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/asio-build-*.log
[  8%] Performing install step for 'asio'
-- asio install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/asio-install-*.log
[  8%] Completed 'asio'
[  8%] Built target asio
[  8%] Creating directories for 'boost'
[  8%] Performing download step (download, verify and extract) for 'boost'
-- boost download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/boost-download-*.log
[  8%] No patch step for 'boost'
[  8%] Performing configure step for 'boost'
-- boost configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/boost-configure-*.log
[ 13%] Performing build step for 'boost'
-- boost build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/boost-build-*.log
[ 13%] Performing install step for 'boost'
-- boost install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/boost-install-*.log
[ 13%] Completed 'boost'
[ 13%] Built target boost
[ 13%] Creating directories for 'fmt'
[ 17%] Performing download step (download, verify and extract) for 'fmt'
-- fmt download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/fmt-download-*.log
[ 17%] No patch step for 'fmt'
[ 17%] Performing configure step for 'fmt'
-- fmt configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/fmt-configure-*.log
[ 17%] Performing build step for 'fmt'
-- fmt build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/fmt-build-*.log
[ 17%] Performing install step for 'fmt'
-- fmt install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/fmt-install-*.log
[ 17%] Completed 'fmt'
[ 17%] Built target fmt
[ 17%] Creating directories for 'dds'
[ 17%] Performing download step (git clone) for 'dds'
-- dds download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/dds-download-*.log
[ 21%] Performing patch step for 'dds'
-- dds patch command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/dds-patch-*.log
[ 21%] Performing configure step for 'dds'
-- dds configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/dds-configure-*.log
[ 21%] Performing build step for 'dds'
-- dds build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/dds-build-*.log
[ 21%] Performing build_wn_bin step for 'dds'
-- dds build_wn_bin command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/dds-build_wn_bin-*.log
[ 21%] Performing install step for 'dds'
-- dds install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/dds-install-*.log
[ 26%] Completed 'dds'
[ 26%] Built target dds
[ 26%] Creating directories for 'fairlogger'
[ 26%] Performing download step (git clone) for 'fairlogger'
-- fairlogger download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/fairlogger-download-*.log
[ 26%] No patch step for 'fairlogger'
[ 30%] Performing configure step for 'fairlogger'
-- fairlogger configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/fairlogger-configure-*.log
[ 30%] Performing build step for 'fairlogger'
-- fairlogger build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/fairlogger-build-*.log
[ 30%] Performing install step for 'fairlogger'
-- fairlogger install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/fairlogger-install-*.log
[ 30%] Completed 'fairlogger'
[ 30%] Built target fairlogger
[ 30%] Creating directories for 'zeromq'
[ 30%] Performing download step (git clone) for 'zeromq'
-- zeromq download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/zeromq-download-*.log
[ 30%] No patch step for 'zeromq'
[ 30%] Performing configure step for 'zeromq'
-- zeromq configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/zeromq-configure-*.log
[ 30%] Performing build step for 'zeromq'
-- zeromq build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/zeromq-build-*.log
[ 34%] Performing install step for 'zeromq'
-- zeromq install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/zeromq-install-*.log
[ 34%] Completed 'zeromq'
[ 34%] Built target zeromq
[ 34%] Creating directories for 'flatbuffers'
[ 34%] Performing download step (git clone) for 'flatbuffers'
-- flatbuffers download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/flatbuffers-download-*.log
[ 34%] Performing patch step for 'flatbuffers'
-- flatbuffers patch command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/flatbuffers-patch-*.log
[ 39%] Performing configure step for 'flatbuffers'
-- flatbuffers configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/flatbuffers-configure-*.log
[ 39%] Performing build step for 'flatbuffers'
-- flatbuffers build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/flatbuffers-build-*.log
[ 39%] Performing install step for 'flatbuffers'
-- flatbuffers install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/flatbuffers-install-*.log
[ 39%] Completed 'flatbuffers'
[ 39%] Built target flatbuffers
[ 39%] Creating directories for 'fairmq'
[ 39%] Performing download step (git clone) for 'fairmq'
-- fairmq download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/fairmq-download-*.log
[ 39%] No patch step for 'fairmq'
[ 39%] Performing configure step for 'fairmq'
-- fairmq configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/fairmq-configure-*.log
[ 39%] Performing build step for 'fairmq'
-- fairmq build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/fairmq-build-*.log
[ 43%] Performing install step for 'fairmq'
-- fairmq install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/fairmq-install-*.log
[ 43%] Completed 'fairmq'
[ 43%] Built target fairmq
[ 43%] Creating directories for 'pythia6'
[ 43%] Performing download step (download, verify and extract) for 'pythia6'
-- pythia6 download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/pythia6-download-*.log
[ 43%] Performing patch step for 'pythia6'
-- pythia6 patch command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/pythia6-patch-*.log
[ 43%] Performing configure step for 'pythia6'
-- pythia6 configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/pythia6-configure-*.log
[ 43%] Performing build step for 'pythia6'
-- pythia6 build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/pythia6-build-*.log
[ 43%] Performing install step for 'pythia6'
-- pythia6 install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/pythia6-install-*.log
[ 47%] Completed 'pythia6'
[ 47%] Built target pythia6
[ 52%] Creating directories for 'hepmc'
[ 52%] Performing download step (download, verify and extract) for 'hepmc'
-- hepmc download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/hepmc-download-*.log
[ 52%] No patch step for 'hepmc'
[ 52%] Performing configure step for 'hepmc'
-- hepmc configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/hepmc-configure-*.log
[ 52%] Performing build step for 'hepmc'
-- hepmc build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/hepmc-build-*.log
[ 52%] Performing install step for 'hepmc'
-- hepmc install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/hepmc-install-*.log
[ 52%] Completed 'hepmc'
[ 52%] Built target hepmc
[ 56%] Creating directories for 'vc'
[ 56%] Performing download step (download, verify and extract) for 'vc'
-- vc download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/vc-download-*.log
[ 56%] No patch step for 'vc'
[ 56%] Performing configure step for 'vc'
-- vc configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/vc-configure-*.log
[ 56%] Performing build step for 'vc'
-- vc build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/vc-build-*.log
[ 56%] Performing install step for 'vc'
-- vc install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/vc-install-*.log
[ 56%] Completed 'vc'
[ 56%] Built target vc
[ 56%] Creating directories for 'clhep'
[ 60%] Performing download step (download, verify and extract) for 'clhep'
-- clhep download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/clhep-download-*.log
[ 60%] Performing move_dir step for 'clhep'
-- clhep move_dir command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/clhep-move_dir-*.log
[ 60%] No patch step for 'clhep'
[ 60%] Performing configure step for 'clhep'
-- clhep configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/clhep-configure-*.log
[ 60%] Performing build step for 'clhep'
-- clhep build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/clhep-build-*.log
[ 60%] Performing install step for 'clhep'
-- clhep install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/clhep-install-*.log
[ 60%] Completed 'clhep'
[ 60%] Built target clhep
[ 60%] Creating directories for 'pythia8'
[ 60%] Performing download step (download, verify and extract) for 'pythia8'
-- pythia8 download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/pythia8-download-*.log
[ 60%] No patch step for 'pythia8'
[ 65%] Performing configure step for 'pythia8'
-- pythia8 configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/pythia8-configure-*.log
[ 65%] Performing build step for 'pythia8'
 -- pythia8 build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/pythia8-build-*.log
[ 65%] Performing install step for 'pythia8'
-- pythia8 install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/pythia8-install-*.log
[ 65%] Completed 'pythia8'
[ 65%] Built target pythia8
[ 65%] Creating directories for 'geant4'
[ 65%] Performing download step (download, verify and extract) for 'geant4'
-- geant4 download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/geant4-download-*.log
[ 65%] No patch step for 'geant4'
[ 65%] Performing configure step for 'geant4'
-- geant4 configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/geant4-configure-*.log
[ 69%] Performing build step for 'geant4'
    
-- geant4 build command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/geant4-build-*.log
[ 69%] Performing install step for 'geant4'
-- geant4 install command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/geant4-install-*.log
[ 69%] Completed 'geant4'
[ 69%] Built target geant4
[ 69%] Creating directories for 'root'
[ 69%] Performing download step (git clone) for 'root'
-- root download command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/root-download-*.log
[ 69%] Performing patch step for 'root'
-- root patch command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/root-patch-*.log
[ 69%] Performing configure step for 'root'
-- root configure command succeeded.  See also /home/pasenov/fair_install/FairSoft/build/Log/root-configure-*.log
[ 69%] Performing build step for 'root'
CMake Error at /home/pasenov/fair_install/FairSoft/build/Stamp/root/root-build-RelWithDebInfo.cmake:37 (message):
  Command failed: 2

   '/opt/rh/devtoolset-11/root/usr/bin/gmake'

  See also

    /home/pasenov/fair_install/FairSoft/build/Log/root-build.log

-- Log output is:

...skipping to end...
ld/Source/root/graf3d/eve7/inc/ROOT/REveBox.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:12:
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/stl_vector.h:1962:5: note:                 ‘template<class _Tp, class _Alloc> void std::swap(std::vector<_Tp, _Alloc>&, std::vector<_Tp, _Alloc>&)’
 1962 |     swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
      |     ^~~~
In file included from /opt/rh/devtoolset-11/root/usr/include/c++/11/string:55,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/meta/inc/TSchemaHelper.h:17,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/meta/inc/TGenericClassInfo.h:21,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/base/inc/Rtypes.h:191,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/gui/inc/GuiTypes.h:22,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveTypes.hxx:16,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveElement.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveShape.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveBox.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:12:
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/basic_string.h:6493:5: note:                 ‘template<class _CharT, class _Traits, class _Alloc> void std::swap(std::basic_string<_CharT, _Traits, _Allocator>&, std::basic_string<_CharT, _Traits, _Allocator>&)’
 6493 |     swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~
In file included from /opt/rh/devtoolset-11/root/usr/include/c++/11/bits/stl_algobase.h:64,
                 from /opt/rh/devtoolset-11/root/usr/include/c++/11/bits/char_traits.h:39,
                 from /opt/rh/devtoolset-11/root/usr/include/c++/11/string:40,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/meta/inc/TSchemaHelper.h:17,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/meta/inc/TGenericClassInfo.h:21,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/base/inc/Rtypes.h:191,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/gui/inc/GuiTypes.h:22,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveTypes.hxx:16,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveElement.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveShape.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveBox.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:12:
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/stl_pair.h:541:5: note:                 ‘template<class _T1, class _T2> typename std::enable_if<(! std::__and_<std::__is_swappable<_T1>, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’
  541 |     swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
      |     ^~~~
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/stl_pair.h:533:5: note:                 ‘template<class _T1, class _T2> typename std::enable_if<std::__and_<std::__is_swappable<_T1>, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’
  533 |     swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
      |     ^~~~
In file included from /opt/rh/devtoolset-11/root/usr/include/c++/11/bits/atomic_base.h:38,
                 from /opt/rh/devtoolset-11/root/usr/include/c++/11/atomic:41,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/base/inc/Rtypes.h:35,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/gui/inc/GuiTypes.h:22,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveTypes.hxx:16,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveElement.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveShape.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveBox.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:12:
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/move.h:220:5: note:                 ‘template<class _Tp, long unsigned int _Nm> std::__enable_if_t<std::__is_swappable<_Tp>::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’
  220 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |     ^~~~
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/move.h:196:5: note:                 ‘template<class _Tp> std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’
  196 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
In file included from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:18:
/usr/include/nlohmann/json.hpp:20793:69: error: return type ‘using json = class nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’ {aka ‘class nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’} is incomplete
20793 | inline nlohmann::json operator "" _json(const char* s, std::size_t n)
      |                                                                     ^
/usr/include/nlohmann/json.hpp: In function ‘void operator""_json(const char*, std::size_t)’:
/usr/include/nlohmann/json.hpp:20795:28: error: incomplete type ‘nlohmann::json’ {aka ‘nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’} used in nested name specifier
20795 |     return nlohmann::json::parse(s, s + n);
      |                            ^~~~~
/usr/include/nlohmann/json.hpp: At global scope:
/usr/include/nlohmann/json.hpp:20811:24: error: invalid use of incomplete type ‘using json = class nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’ {aka ‘class nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’}
20811 | inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n)
      |                        ^~~~~~~~~~~~
In file included from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveShape.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveBox.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:12:
/home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveElement.hxx:33:7: note: declaration of ‘using json = class nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’ {aka ‘class nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’}
   33 | class basic_json;
      |       ^~~~~~~~~~
/home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx: In member function ‘virtual Int_t ROOT::Experimental::REveBox::WriteCoreJson(nlohmann::json&, Int_t)’:
/home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:106:5: error: no match for ‘operator[]’ (operand types are ‘nlohmann::json’ {aka ‘nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’} and ‘const char [11]’)
  106 |    j["fMainColor"] = GetFillColor();
      |     ^
/home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:107:5: error: no match for ‘operator[]’ (operand types are ‘nlohmann::json’ {aka ‘nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’} and ‘const char [11]’)
  107 |    j["fLineColor"] = GetLineColor();
      |     ^
/home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx: In member function ‘virtual Int_t ROOT::Experimental::REveBoxProjected::WriteCoreJson(nlohmann::json&, Int_t)’:
/home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:283:5: error: no match for ‘operator[]’ (operand types are ‘nlohmann::json’ {aka ‘nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’} and ‘const char [10]’)
  283 |    j["fBreakIdx"] = fBreakIdx;
      |     ^
gmake[5]: *** [graf3d/eve7/CMakeFiles/ROOTEve.dir/build.make:230: graf3d/eve7/CMakeFiles/ROOTEve.dir/src/REveBox.cxx.o] Error 1
gmake[4]: *** [CMakeFiles/Makefile2:31538: graf3d/eve7/CMakeFiles/ROOTEve.dir/all] Error 2
gmake[3]: *** [Makefile:156: all] Error 2

CMake Error at /home/pasenov/fair_install/FairSoft/build/Stamp/root/root-build-RelWithDebInfo.cmake:47 (message):
  Stopping after outputting logs.


gmake[2]: *** [CMakeFiles/root.dir/build.make:85: Stamp/root/root-build] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:3442: CMakeFiles/root.dir/all] Error 2
gmake: *** [Makefile:101: all] Error 2

Any suggestions what to do next?

Can you also share root-configure.log? Also please share the output of the shell command rpm -qf /usr/include/nlohmann/json.hpp.

root-configure.log

[pasenov@cds01 FairSoft]$ rpm -qf /usr/include/nlohmann/json.hpp
json-devel-3.6.1-2.el7.x86_64

Please try the following patch to FairSoft:

--- a/cmake/legacy.cmake
+++ b/cmake/legacy.cmake
@@ -368,6 +368,7 @@ if(PACKAGE_SET STREQUAL full)
     COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/add_missing_cstring_include.patch"
     COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/update_xrootd_checksum.patch"
     ${CMAKE_DEFAULT_ARGS} CMAKE_ARGS
+      "-Dbuiltin_nlohmannjson=ON"
       "-Daqua=ON"
       "-Dasimage=ON"
       "-Dcintex=OFF"

So, I should save the above commands in a new file, let's say patch1.patch and save it here:

/home/pasenov/fair_install/FairSoft/FairSoft/patches/dds

And then rerun the previous command:
cmake --build build
?

Is that right? Did I miss anything?

[pasenov@cds01 FairSoft]$ cmake --build build
[  4%] Built target faircmakemodules
[  8%] Built target asio
[ 13%] Built target boost
[ 17%] Built target fmt
[ 26%] Built target dds
[ 30%] Built target fairlogger
[ 34%] Built target zeromq
[ 39%] Built target flatbuffers
[ 43%] Built target fairmq
[ 47%] Built target pythia6
[ 52%] Built target hepmc
[ 56%] Built target vc
[ 60%] Built target clhep
[ 65%] Built target pythia8
[ 69%] Built target geant4
[ 69%] Performing build step for 'root'
CMake Error at /home/pasenov/fair_install/FairSoft/build/Stamp/root/root-build-RelWithDebInfo.cmake:37 (message):
  Command failed: 2

   '/opt/rh/devtoolset-11/root/usr/bin/gmake'

  See also

    /home/pasenov/fair_install/FairSoft/build/Log/root-build.log


-- Log output is:
...skipping to end...
ld/Source/root/graf3d/eve7/inc/ROOT/REveBox.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:12:
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/stl_vector.h:1962:5: note:                 ‘template<class _Tp, class _Alloc> void std::swap(std::vector<_Tp, _Alloc>&, std::vector<_Tp, _Alloc>&)’
 1962 |     swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
      |     ^~~~
In file included from /opt/rh/devtoolset-11/root/usr/include/c++/11/string:55,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/meta/inc/TSchemaHelper.h:17,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/meta/inc/TGenericClassInfo.h:21,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/base/inc/Rtypes.h:191,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/gui/inc/GuiTypes.h:22,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveTypes.hxx:16,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveElement.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveShape.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveBox.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:12:
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/basic_string.h:6493:5: note:                 ‘template<class _CharT, class _Traits, class _Alloc> void std::swap(std::basic_string<_CharT, _Traits, _Allocator>&, std::basic_string<_CharT, _Traits, _Allocator>&)’
 6493 |     swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~
In file included from /opt/rh/devtoolset-11/root/usr/include/c++/11/bits/stl_algobase.h:64,
                 from /opt/rh/devtoolset-11/root/usr/include/c++/11/bits/char_traits.h:39,
                 from /opt/rh/devtoolset-11/root/usr/include/c++/11/string:40,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/meta/inc/TSchemaHelper.h:17,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/meta/inc/TGenericClassInfo.h:21,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/base/inc/Rtypes.h:191,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/gui/inc/GuiTypes.h:22,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveTypes.hxx:16,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveElement.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveShape.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveBox.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:12:
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/stl_pair.h:541:5: note:                 ‘template<class _T1, class _T2> typename std::enable_if<(! std::__and_<std::__is_swappable<_T1>, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’
  541 |     swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
      |     ^~~~
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/stl_pair.h:533:5: note:                 ‘template<class _T1, class _T2> typename std::enable_if<std::__and_<std::__is_swappable<_T1>, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’
  533 |     swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
      |     ^~~~
In file included from /opt/rh/devtoolset-11/root/usr/include/c++/11/bits/atomic_base.h:38,
                 from /opt/rh/devtoolset-11/root/usr/include/c++/11/atomic:41,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/base/inc/Rtypes.h:35,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/core/gui/inc/GuiTypes.h:22,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveTypes.hxx:16,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveElement.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveShape.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveBox.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:12:
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/move.h:220:5: note:                 ‘template<class _Tp, long unsigned int _Nm> std::__enable_if_t<std::__is_swappable<_Tp>::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’
  220 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |     ^~~~
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/move.h:196:5: note:                 ‘template<class _Tp> std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’
  196 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
In file included from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:18:
/usr/include/nlohmann/json.hpp:20793:69: error: return type ‘using json = class nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’ {aka ‘class nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’} is incomplete
20793 | inline nlohmann::json operator "" _json(const char* s, std::size_t n)
      |                                                                     ^
/usr/include/nlohmann/json.hpp: In function ‘void operator""_json(const char*, std::size_t)’:
/usr/include/nlohmann/json.hpp:20795:28: error: incomplete type ‘nlohmann::json’ {aka ‘nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’} used in nested name specifier
20795 |     return nlohmann::json::parse(s, s + n);
      |                            ^~~~~
/usr/include/nlohmann/json.hpp: At global scope:
/usr/include/nlohmann/json.hpp:20811:24: error: invalid use of incomplete type ‘using json = class nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’ {aka ‘class nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’}
20811 | inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n)
      |                        ^~~~~~~~~~~~
In file included from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveShape.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveBox.hxx:15,
                 from /home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:12:
/home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/inc/ROOT/REveElement.hxx:33:7: note: declaration of ‘using json = class nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’ {aka ‘class nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’}
   33 | class basic_json;
      |       ^~~~~~~~~~
/home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx: In member function ‘virtual Int_t ROOT::Experimental::REveBox::WriteCoreJson(nlohmann::json&, Int_t)’:
/home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:106:5: error: no match for ‘operator[]’ (operand types are ‘nlohmann::json’ {aka ‘nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’} and ‘const char [11]’)
  106 |    j["fMainColor"] = GetFillColor();
      |     ^
/home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:107:5: error: no match for ‘operator[]’ (operand types are ‘nlohmann::json’ {aka ‘nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’} and ‘const char [11]’)
  107 |    j["fLineColor"] = GetLineColor();
      |     ^
/home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx: In member function ‘virtual Int_t ROOT::Experimental::REveBoxProjected::WriteCoreJson(nlohmann::json&, Int_t)’:
/home/pasenov/fair_install/FairSoft/build/Source/root/graf3d/eve7/src/REveBox.cxx:283:5: error: no match for ‘operator[]’ (operand types are ‘nlohmann::json’ {aka ‘nlohmann::basic_json<std::map, std::vector, std::basic_string<char>, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char> >’} and ‘const char [10]’)
  283 |    j["fBreakIdx"] = fBreakIdx;
      |     ^
gmake[5]: *** [graf3d/eve7/CMakeFiles/ROOTEve.dir/build.make:230: graf3d/eve7/CMakeFiles/ROOTEve.dir/src/REveBox.cxx.o] Error 1
gmake[4]: *** [CMakeFiles/Makefile2:31538: graf3d/eve7/CMakeFiles/ROOTEve.dir/all] Error 2
gmake[3]: *** [Makefile:156: all] Error 2

CMake Error at /home/pasenov/fair_install/FairSoft/build/Stamp/root/root-build-RelWithDebInfo.cmake:47 (message):
  Stopping after outputting logs.


gmake[2]: *** [CMakeFiles/root.dir/build.make:85: Stamp/root/root-build] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:3442: CMakeFiles/root.dir/all] Error 2
gmake: *** [Makefile:101: all] Error 2

I fear that I have missed some important steps in applying the patch correctly.

So, I should save the above commands in a new file, let's say patch1.patch and save it here:

Sry, no, I meant you to modify the file /home/pasenov/fair_install/FairSoft/FairSoft/cmake/legacy.cmake and add the ROOT build option "-Dbuiltin_nlohmannjson=ON". (Once you confirmed this fixes the issue, we should add this option to the FairSoft repo)

FairSoft was finally successfully installed on my computer. The last suggestion really helped (though my legacy.cmake file didn't have exactly the same contents as shown above).

@dennisklein thank you very much for the assistance!

I prepared a commit 7da3238 that is likely to make it into our dev branch and into the next release (with the option to backport it to older releases if requested).