root-project / root-docker

Docker recipes for ROOT
30 stars 33 forks source link

CMake build broken with rootproject/root:latest image #60

Closed jdfrankland closed 5 months ago

jdfrankland commented 7 months ago

Dear root-project,

After updating to the latest image I can no longer use ROOT in a CMake project.

The following minimal CMakeLists.txt:

cmake_minimum_required(VERSION 3.16)
project(myProject)
find_package(ROOT REQUIRED)

gives the following output:

$ cmake -B build
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  By not providing "Findnlohmann_json.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "nlohmann_json", but CMake did not find one.

  Could not find a package configuration file provided by "nlohmann_json"
  (requested version 3.10.5) with any of the following names:

    nlohmann_jsonConfig.cmake
    nlohmann_json-config.cmake

  Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
  "nlohmann_json_DIR" to a directory containing one of the above files.  If
  "nlohmann_json" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  root/cmake/ROOTConfig.cmake:122 (find_dependency)
  CMakeLists.txt:3 (find_package)

-- Configuring incomplete, errors occurred!
See also "/opt/build/CMakeFiles/CMakeOutput.log".

If I install the nlohmann-json3-dev package with apt and try again, I get further errors:

$ rm -rf build
$ cmake -B build
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found nlohmann_json: /usr/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found suitable version "3.10.5", minimum required is "3.10.5") 
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Vdt (missing: VDT_INCLUDE_DIR VDT_LIBRARY)
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  root/cmake/modules/FindVdt.cmake:63 (find_package_handle_standard_args)
  /usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
  root/cmake/ROOTConfig.cmake:132 (find_dependency)
  CMakeLists.txt:3 (find_package)

-- Configuring incomplete, errors occurred!
See also "/opt/build/CMakeFiles/CMakeOutput.log".

Any help woud be greatly appreciated (please note that I have been using previous versions of this image in my CI for a long time, there was never a problem before)

Cheers John

ferdymercury commented 7 months ago

This is a duplicate of https://github.com/root-project/root/issues/14188

harrypuuter commented 5 months ago

I just ran into the same issue with the rootproject/root:6.30.02-ubuntu22.04 image as described above, I also want to use the image in a CI. I see that the issue is closed, but the container was not updated?

ferdymercury commented 5 months ago

@linev fixed it for the future 6.30.04 release I guess

linev commented 5 months ago

No, I only change it in master - one need to backport it.

harrypuuter commented 5 months ago

Thanks for the quick replies, I will wait for a new release then!

linev commented 5 months ago

https://github.com/root-project/root/pull/14392

This is backport to 6.30 branch. Will be released soon with 6.30.04 version

martamaja10 commented 5 months ago

the 6.30.04 version (ubuntu22.04) is now available as the latest image