-Dtmva=OFF in master?

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 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?

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.


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.

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?


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 -

//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

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

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.

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.

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.

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

1 Like

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

1 Like