and then build root with cmake -DCMAKE_INSTALL_PREFIX=../root_install -DCMAKE_CXX_STANDARD=17 -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_FIND_ROOT_PATH=$CONDA_PREFIX -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY ../root_src
and
cmake --build . -- install -j10
I get [ 65%] Building CXX object net/rpdutils/CMakeFiles/SrvAuth.dir/src/rpdutils.cxx.o <<< cling interactive line includer >>>: remark: building module 'Net' as '[…]/lib/Net.pcm' [-Rmodule-build] Error: Building module 'Net' implicitly. If 'Net' requires a dictionary please specify build dependency: 'G__MultiProc.cxx' depends on 'Net'. Otherwise, specify '-mByproduct Net' to disable this diagnostic.
In a docker container I can of course build it, but it would be nice to build it outside in a conda environment for better performance
Thanks for reaching out to the forum! I have to say I’ve never tried this myself, and for all intents and purposes I would say we cannot offer any practical support on this at the moment. I will still try to give ideas and suggestions though.
Then, looking at your cmake command, I’m actually not sure why you’re passing all those CMAKE_* options, I don’t know how many of those are actually necessary, some might even be playing against you.
but it would be nice to build it outside in a conda environment for better performance
I don’t understand where this notion comes from, given the same hardware, why should the conda environment be more performant?
Great to know that you made progress! If you find time, it would be great to document this somewhere for other users who may want to do the same, thanks!
I now had time to test it a bit more.
I created a mamba environment as you said, with the intersection between build, host and run
The file for the environment can be found here (not too sure about the headings):
and you can create the environment with
mamba env create root-feedstock.yaml
Then root compiles. I actually used cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_CXX_STANDARD=20 ../root-src
but I think other versions should also work.
I used them before so cmake can only see the conda libraries but it works now without.
The main advantage is that it is now much easier to cache the building process. Before, root had to build anew if something small changed in the source code. I guess the docker performance compared to just running it without a docker container is not too much, but I feel like I have better control over it now.