If cudnn is not installed, it fails to build with: In file included from input_line_11:65: In file included from /var/tmp/portage/sci-physics/root-6.20.00/work/root-6.20.00_build/include/TMVA/MethodDL.h:51: In file included from /var/tmp/portage/sci-physics/root-6.20.00/work/root-6.20.00_build/include/TMVA/DNN/Architectures/Cuda.h:31: /var/tmp/portage/sci-physics/root-6.20.00/work/root-6.20.00_build/include/TMVA/DNN/Architectures/Cuda/CudaTensor.h:23:10: fatal error: 'cudnn.h' file not found #include "cudnn.h" ^~~~~~~~~ Reproducible: Always Steps to Reproduce: USE="cuda" emerge =sci-physics/root-6.20.0 Actually, it's not fully clear if this is the correct approach. CMake outputs: -- cudnn not found - use only Cuda+Cublas at the configure stage. So probably, the breakage is upstream, and also a CUDA-only build should be supported - in which case a separate cudnn USE flag should be introduced in addition to fixing this issue.
Note also this upstream bug report: https://sft.its.cern.ch/jira/browse/ROOT-10597 since the build system does not handle this case correctly (either cudnn should be a separate feature and there should be a -Dcudnn=OFF switch, or it should be a hard dependency if CUDA is activated - neither is done, currently cudnn seems to be an automagic dependency if CUDA is on).
Note that upstream already provides a patch in the linked issue, which might be sufficient in the current status for portage if a cudnn USE flag is added. Build still breaks if CUDA is on and cudnn is left at default with the current patch, though (see comments on upstream issue).
The fix has just been pushed upstream for this. Rather than fixing this in Gentoo, I will wait for the next patch release which should come out in a few days and do a version bump.
That sounds like a good idea, thanks for taking care of this!
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fd9d97bc8d9d3522d9b16d68c107bdb68d39c264 commit fd9d97bc8d9d3522d9b16d68c107bdb68d39c264 Author: Guilherme Amadio <amadio@gentoo.org> AuthorDate: 2020-03-16 12:25:16 +0000 Commit: Guilherme Amadio <amadio@gentoo.org> CommitDate: 2020-03-16 13:32:39 +0000 sci-physics/root: version bump to 6.20.02 The dependency on media-libs/cudnn when USE=cuda has been made optional upstream. Closes: https://bugs.gentoo.org/711470 Package-Manager: Portage-2.3.94, Repoman-2.3.21 Signed-off-by: Guilherme Amadio <amadio@gentoo.org> sci-physics/root/Manifest | 2 +- .../root/{root-6.20.00-r1.ebuild => root-6.20.02.ebuild} | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-)