# Conda environment for building

**URL:** <https://root-forum.cern.ch/t/conda-environment-for-building/64386>\
**Category:** ROOT\
**Tags:** build, root\
**Created:** [November 7, 2025, 2:03pm UTC](https://root-forum.cern.ch/t/conda-environment-for-building/64386 "2025-11-07T14:03:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![KoljaFrahm](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/koljafrahm/32/36530_2.png) [@KoljaFrahm](https://root-forum.cern.ch/u/KoljaFrahm)\
**Post date:** [November 7, 2025, 2:03pm UTC](https://root-forum.cern.ch/t/conda-environment-for-building/64386/1 "2025-11-07T14:03:28Z")

</div>

* * *

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

* * *

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [November 7, 2025, 2:18pm UTC](https://root-forum.cern.ch/t/conda-environment-for-building/64386/2 "2025-11-07T14:18:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KoljaFrahm](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/koljafrahm/32/36530_2.png) [@KoljaFrahm](https://root-forum.cern.ch/u/KoljaFrahm)\
**Post date:** [November 7, 2025, 2:22pm UTC](https://root-forum.cern.ch/t/conda-environment-for-building/64386/3 "2025-11-07T14:22:07Z")

</div>

I am fixing a bug I found

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [November 7, 2025, 2:27pm UTC](https://root-forum.cern.ch/t/conda-environment-for-building/64386/4 "2025-11-07T14:27:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [November 13, 2025, 8:16pm UTC](https://root-forum.cern.ch/t/conda-environment-for-building/64386/5 "2025-11-13T20:16:11Z")

</div>

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](https://github.com/conda-forge/root-feedstock/blob/9f5368f9a08d5744667524dcaf849e197312d77a/recipe/recipe.yaml#L69-L182) . 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

---

<div class="post-metadata">

**Author:** ![KoljaFrahm](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/koljafrahm/32/36530_2.png) [@KoljaFrahm](https://root-forum.cern.ch/u/KoljaFrahm)\
**Post date:** [November 27, 2025, 4:59pm UTC](https://root-forum.cern.ch/t/conda-environment-for-building/64386/6 "2025-11-27T16:59:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [November 29, 2025, 3:24pm UTC](https://root-forum.cern.ch/t/conda-environment-for-building/64386/7 "2025-11-29T15:24:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KoljaFrahm](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/koljafrahm/32/36530_2.png) [@KoljaFrahm](https://root-forum.cern.ch/u/KoljaFrahm)\
**Post date:** [December 1, 2025, 2:27pm UTC](https://root-forum.cern.ch/t/conda-environment-for-building/64386/8 "2025-12-01T14:27:17Z")

</div>

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):

> <https://gist.github.com/KoljaFrahm/bf6055a8114af7e8e115b8fca53e8543>

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.

> [@vpadulan](#):
>
> 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.

I used them before so cmake can only see the conda libraries but it works now without.

> [@vpadulan](#):
>
> I don’t understand where this notion comes from, given the same hardware, why should the conda environment be more performant?

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.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [December 15, 2025, 2:27pm UTC](https://root-forum.cern.ch/t/conda-environment-for-building/64386/9 "2025-12-15T14:27:42Z")

</div>

Closed on December 15, 2025, 2:27pm UTC

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