Docker ROOT image and CMake build


I have tried to find it in several places but I cannot find any source of information about it.

I am developing a general analysis framework which uses root when needed (input data structure, histograms, physics objects etc.) and I am compiling the tool with CMake. I can compile it fine locally but I would like to implement CI within the project. For this I am using an image with CMake but the isuee is, of course, when CMake tries to find the ROOT CMake package it fails because in that docker image there is no ROOT instalation. I have tried adding some docker images I have found which have ROOT as services (I am using the gitlab-ci for this) but ROOT is not setup properly and therefore it fails to find it.

I am including ROOT libraries with this part on my CMakeLists.txt file

# Check that ROOT in installed in the system
if(EXISTS $ENV{ROOTSYS}/cmake/ROOTConfig.cmake)
    # ROOT has been compiled with CMake
    #ROOT has been compiled with traditional configure/make
endif(EXISTS $ENV{ROOTSYS}/cmake/ROOTConfig.cmake)
find_package(ROOT REQUIRED)

It compiles with no issue so far. The problem is that ROOTSYS is not defined in the docker image.

Do you know what would be the proper way of solving this issue?


I fuond it! After the entire afternoon searching (and after several failed attempts of building my own image) I found a docker image with ROOT that works perfect!

In case anyone is interested.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.