Using ROOT precompiled binary distribution

ROOT Version: 6.24.04
Platform: WSL(Ubuntu)
After building root from sources whenever I try to write:

sayang@DESKTOP-IFS80HM:~/root_build1$ cmake -DCMAKE_INSTALL_PREFIX=…/root_install …/root_src

CMake Error at CMakeLists.txt:16 (message):
ROOT must be built out-of-source.
Please see README/INSTALL for more information.

– Configuring incomplete, errors occurred!

Please help!

I would also like to know whether I can use root precompiled binary distribution after just building root from sources(without running the previous command) which is currently running successfully after writing
source root/bin/thisroot.sh

Hi @Sayandeep_Ghosh ,
there seems to be some problem with how you downloaded the sources and built them.

If you just want to install root, you don’t have to build from sources, see Installing ROOT - ROOT .

If, as I imagine, you plan to work on the source code, then you will indeed have to build from sources and I would suggest you start the process from scratch following Building ROOT from source - ROOT .

Cheers,
Enrico

1 Like

After cloning and typing something like :

$ cmake -DCMAKE_INSTALL_PREFIX=../root_install ../root_src # && check cmake configuration output for warnings or errors
$ cmake --build . -- install -j4

At the very end its showing
[100%] Built target RooStats
make[2]: *** No rule to make target ‘/home/sayang/root_src2/roofit/hs3/HistFactory’, needed by ‘roofit/hs3/G__RooFitHS3.cxx’. Stop.
make[1]: *** [CMakeFiles/Makefile2:35117: roofit/hs3/CMakeFiles/G__RooFitHS3.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

root_install directory is also empty .

That’s a bug, fixed by [RF] Avoid any dependencies of RooFitHS3 for dictionary generation and update HistFactory::JSONTool interface by guitargeek · Pull Request #10082 · root-project/root · GitHub . While the patch is not yet merged, you can either grab that patch or build with -Droofit=OFF.

Cheers,
Enrico

If I install root through precompiled binary distribution such as:

wget https://root.cern/download/root_v6.24.02.Linux-ubuntu20-x86_64-gcc9.3.tar.gz
$ tar -xzvf root_v6.24.02.Linux-ubuntu20-x86_64-gcc9.3.tar.gz
$ source root/bin/thisroot.sh # also available: thisroot.{csh,fish,bat}

After typing something like
sayang@DESKTOP-IFS80HM:~$ root-config --features
cxx14 asimage builtin_afterimage builtin_clang builtin_cling builtin_davix builtin_ftgl builtin_gl2ps builtin_glew builtin_llvm builtin_lz4 builtin_lzma builtin_nlohmannjson builtin_openui5 builtin_pcre builtin_tbb builtin_unuran builtin_vc builtin_vdt builtin_veccore builtin_xrootd builtin_xxhash builtin_zlib clad dataframe davix exceptions fftw3 fitsio fortran gdml http imt mathmore mlp minuit2 mysql opengl pgsql pyroot pythia8 roofit webgui root7 runtime_cxxmodules shadowpw shared soversion sqlite ssl tmva tmva-cpu tmva-pymva spectrum unuran vc vmc vdt veccore x11 xml xrootd

Since there is no build directory or install directory involved in this case , from which directory should I write cmake -Dtmva-sofie=ON to include tmva-sofie in this feature?

That’s why I kept the title of this topic using ROOT precompiled binary distribution since the previous error was coming while building from sources. Thanks!

You cannot add features to an existing binary distribution.
You must build your version entirely from source code.

…and v6.24 does not have tmva-sofie anyway, it’s a v6.26 features :sweat_smile:

The fix for your build issue was just merged in master, you should be able to build the master branch from source.

1 Like

Hi @eguiraud ,
Even after building from the master branch, after writing
cmake --build . – install -j4

this error is coming

/home/sayang/root_src2/roofit/hs3/src/HistFactoryJSONTool.cxx:16:10: fatal error: RooStats/HistFactory/Measurement.h: No such file or directory
16 | #include “RooStats/HistFactory/Measurement.h”
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [roofit/hs3/CMakeFiles/RooFitHS3.dir/build.make:76: roofit/hs3/CMakeFiles/RooFitHS3.dir/src/HistFactoryJSONTool.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:34730: roofit/hs3/CMakeFiles/RooFitHS3.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

You need to: sudo apt-get install libxml2-dev
Then, reconfigure your ROOT from scratch again.

The error is still coming

Have you deleted the build directory?

No, I kept the build directory and started reconfiguring

/home/sayang/root_src2/roofit/hs3/src/JSONFactories_HistFactory.cxx:16:10: fatal error: RooStats/HistFactory/ParamHistFunc.h: No such file or directory
16 | #include <RooStats/HistFactory/ParamHistFunc.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [roofit/hs3/CMakeFiles/RooFitHS3.dir/build.make:115: roofit/hs3/CMakeFiles/RooFitHS3.dir/src/JSONFactories_HistFactory.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs…
/home/sayang/root_src2/roofit/hs3/src/HistFactoryJSONTool.cxx:16:10: fatal error: RooStats/HistFactory/Measurement.h: No such file or directory
16 | #include “RooStats/HistFactory/Measurement.h”
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

I did say “from scratch”, didn’t I.

BTW. When you configure ROOT, use: “cmake -Dall=ON ...