# \-Dtmva=OFF in master?

**URL:** <https://root-forum.cern.ch/t/dtmva-off-in-master/32765>\
**Category:** TMVA\
**Created:** [February 16, 2019, 6:41pm UTC](https://root-forum.cern.ch/t/dtmva-off-in-master/32765 "2019-02-16T18:41:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 16, 2019, 6:41pm UTC](https://root-forum.cern.ch/t/dtmva-off-in-master/32765/1 "2019-02-16T18:41:57Z")

</div>

In the master branch, althought the tmva flag is ON by default, unless I set the tmva flag to ON manually(-Dtmva=ON), the tmva conditional blocks in [https://github.com/root-project/root/blob/master/cmake/modules/SearchInstalledSoftware.cmake](https://github.com/root-project/root/blob/master/cmake/modules/SearchInstalledSoftware.cmake) do not get executed. (It works for cmake-gui).  
In the v6-16-00-patches branch, I do not need to set the tmva flag to ON.  
Was this on purpose?

Is this a CMake issue?

---

<div class="post-metadata">

**Author:** ![kialbert](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kialbert/32/16537_2.png) [@kialbert](https://root-forum.cern.ch/u/kialbert)\
**Post date:** [February 16, 2019, 6:56pm UTC](https://root-forum.cern.ch/t/dtmva-off-in-master/32765/2 "2019-02-16T18:56:28Z")

</div>

Hmm, that sounds weird. Could it be that you at some point tried to compile ROOT with -Dtmva=off?

Indeed the default option is tmva=on but with With CMake, the last configuration is cached, so if you at some point specified tmva=off that will be remembered until you overwrite that value.

Cheers,  
Kim

---

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 16, 2019, 6:59pm UTC](https://root-forum.cern.ch/t/dtmva-off-in-master/32765/3 "2019-02-16T18:59:53Z")

</div>

I do not recall compiling ROOT with -Dtmva=off.  
I got the error after a fresh clone of the repository. Also, if the cache got saved outside of the root repository clone, I should face the same issue when building the v6-16-00-patches branch which I do not.

---

<div class="post-metadata">

**Author:** ![kialbert](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kialbert/32/16537_2.png) [@kialbert](https://root-forum.cern.ch/u/kialbert)\
**Post date:** [February 16, 2019, 7:16pm UTC](https://root-forum.cern.ch/t/dtmva-off-in-master/32765/4 "2019-02-16T19:16:25Z")

</div>

The configuration is saved in the build directory. You can check the value of the cached variable by: `grep /path/to/root/build/CMakeCache.txt -e 'TMVA:BOOL'`.

Could you post the error message that you get?

Cheers,  
Kim

---

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 17, 2019, 8:58am UTC](https://root-forum.cern.ch/t/dtmva-off-in-master/32765/5 "2019-02-17T08:58:41Z")

</div>

To generate the cmake configuration, I ran - `cmake -Dbuiltin_lz4=ON -Dbuiltin_lzma=ON -Dbuiltin_zlib=ON -Dcuda=ON -DCMAKE_CXX_STANDARD=14 -Droot7=ON -Dtmva-gpu=ON -Dxrootd=ON ..`

Since I did not set `-Dtmva=ON`, the tmva-gpu features were not enabled and blas was not detected - `No blas or cblas found . TMVA-DNN-CPU is disabled`

Also, `-- Enabled support for: asimage astiff builtin_afterimage builtin_clang builtin_davix builtin_ftgl builtin_glew builtin_llvm builtin_lz4 builtin_lzma builtin_zlib clad cling cuda davix exceptions explicitlink fftw3 fitsio gdml http imt mathmore mysql opengl pch pgsql python roofit root7 shared sqlite ssl thread tmva vdt x11 xft xml xrootd`  
no tmva-gpu even though I specified it. tmva=ON by default as shown, but I need to enable tmva manually for tmva-gpu(and blas detection) to work.

`grep CMakeCache.txt -e 'TMVA:BOOL'` in the build directory did not return anything.

`cat CMakeCache.txt | grep TMVA` returned -

```auto
Genetic_LIB_DEPENDS:STATIC=general;Core;general;MathCore;general;TMVA;
TMVAGui_LIB_DEPENDS:STATIC=general;RIO;general;Hist;general;Tree;general;TreeViewer;general;MLP;general;Minuit;general;XMLIO;general;TMVA;general;Gui;general;Core;
TMVA_LIB_DEPENDS:STATIC=general;Core;general;MathCore;general;Matrix;general;RIO;general;Hist;general;Tree;general;TreePlayer;general;MLP;general;Minuit;general;XMLIO;general;Imt;
//Build TMVA multi variate analysis library
// (Build TMVA with CPU support for deep learning (requires BLAS))
//Disabled because cuda not found (Build TMVA with GPU support
//Enable support for Python in TMVA (requires numpy)
//Enable support for R in TMVA

```

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [February 17, 2019, 7:00pm UTC](https://root-forum.cern.ch/t/dtmva-off-in-master/32765/6 "2019-02-17T19:00:40Z")

</div>

> [@Reik](#):
>
> Disabled because cuda not found (Build TMVA with GPU support)

Do you have Nvidia CUDA toolkit installed and in a path CMake knows about?

---

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 17, 2019, 7:17pm UTC](https://root-forum.cern.ch/t/dtmva-off-in-master/32765/7 "2019-02-17T19:17:25Z")

</div>

Yes.  
If I did not, it wouldn’t have worked even when I set -Dtmva=ON I think. Also, in version 6.16.00, it seems to work perfectly.

> [@amadio](#):
>
> > [@reikdas](#):
> >
> > Disabled because cuda not found (Build TMVA with GPU support)

This is because the CUDA checking section in the SearchInstalledSoftware.cmake file does not get executed unless the tmva, tmva-gpu and cuda flags are enabled and in this case I manually enabled just the tmva-gpu and cuda flags.

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [February 18, 2019, 7:13am UTC](https://root-forum.cern.ch/t/dtmva-off-in-master/32765/8 "2019-02-18T07:13:05Z")

</div>

> [@Reik](#):
>
> This is because the CUDA checking section in the SearchInstalledSoftware.cmake file does not get executed unless the tmva, tmva-gpu and cuda flags are enabled and in this case I manually enabled just the tmva-gpu and cuda flags.

I see. I don’t remember why the `tmva-gpu` flag was added, it does seem redundant with `tmva + cuda`, which existed first. I think that it was added as a counter-part to `tmva-cpu`. In any case, I think `tmva` should imply `tmva-cpu`, and `tmva + cuda` should imply `tmva-gpu`, then we can remove `tmva-cpu` and `tmva-gpu`. I’m reluctant to remove `cuda` since other things will support CUDA in ROOT in the future.

---

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 18, 2019, 9:31am UTC](https://root-forum.cern.ch/t/dtmva-off-in-master/32765/9 "2019-02-18T09:31:51Z")

</div>

I don’t think that is the issue in this case.  
There seems to be some problem with the tmva flag being enabled by default but not being registered in a specific case unless I manually enable it.

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [February 18, 2019, 9:54am UTC](https://root-forum.cern.ch/t/dtmva-off-in-master/32765/10 "2019-02-18T09:54:16Z")

</div>

I found the bug. It’s due to faulty logic in `cmake/modules/RootBuildOptions.cmake`. I will provide a fix soon.

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [February 18, 2019, 4:37pm UTC](https://root-forum.cern.ch/t/dtmva-off-in-master/32765/11 "2019-02-18T16:37:54Z")

</div>

Fix has just been merged to master. Now the default should take effect (i.e., you won’t need to pass `-Dtmva=ON` on the command line anymore).
