Conda environment for building


Is there a conda environment in which I can build root? I tried to create one myself with

mamba create -n buildroot make=4.4 cmake=3.31 gxx=15.2 gcc=15.2 python=3.13 liblzma-devel xorg-libx11 xorg-libxpm xorg-libxft xorg-libxext xorg-xorgproto expat xrootd

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

ROOT Version: latest stable branch
Platform: Fedora
Compiler: gcc 15.2


Maybe @vpadulan can give some hints, but first of all, why don’t you use the pre-built version of ROOT in Conda?

I am fixing a bug I found

OK, then I don’t know if it’s the best alternative. Anyway, let’s see if @vpadulan has an idea

1 Like

Dear @KoljaFrahm ,

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.

I would start by at the very least creating a conda environment that has all the dependencies we list in our recipe at root-feedstock/recipe/recipe.yaml at 9f5368f9a08d5744667524dcaf849e197312d77a · conda-forge/root-feedstock · GitHub . You need to make an intersection between build, host and run for what makes sense for your target platform.

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?

Cheers,

Vincenzo

1 Like

This seems to work. I will formulate later a longer reply, but I just don’t want this topic to close right now

Dear @KoljaFrahm ,

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!

Cheers,

Vincenzo