Open VanyaBelyaev opened 8 months ago
Hi @VanyaBelyaev!
Can you use C++17? That would simplify the code with if constexpr
, and also work in the ROOT nightlies thanks to our cppyy upgrade last week:
// the same with functions
template <unsigned int K,unsigned int N>
auto fun_2 (A<N>&) {
if constexpr(K < N) return "ququ";
else return K;
If this is not a solution for you and you absolutely need to support the reproducer above, please also open this issue also in cppyy upstream since its also present there.
If I am not mistaken sometime ago the situations was just an opposite - standalone template functions were OK, but template methods were not OK... but now I am not 100% sure...
What do you mean by "sometime ago"? I checked with ROOT 6.30, and the situation is the same as with ROOT master, meaning the cppyy upgrade didn't cause any regression in this regard.
Anyway, I can't encourage you enough to move to C++17, implementing the patterns that you implement there is a nightmare without if constexpr
:slightly_smiling_face:
Hi Jonas,
Thank you. I'll start to move into the direction with C++17. - but it is a slow process. And for some cases two overloads a bit better (each has aronug 30 lines of unique code.. Better to keep them separated.
"Sometime ago" belongs to arounbg ROOT 6.22 (a really long time ago) - I see there is some swicth in my legacy code..
dear @guitargeek
It seems that my project has one more problem with new cppyy.
While I am trying to prepare "easy" reproducer, I need to ask you some advice/recipe.
The issue is with "python"-RooAbsPdf. I need to have a RooAbdPdf class with the major
method implemented in python. Previously I have such solution, but with new cppyy
I've got two problems - first, and the drawing phase, there are error messages
that servers are not redirected. ButI have "correct" fit results and the plot.
And, the main problem is that at the end of the script the program stalls -
likely in ROOT finalization.
It is not easy to make short, simple & easy reproducer, but I'll try to do it asap.
But, might be it is a known issue?
What is the "correct/recommended" way for implementation of such "hybrid" pythonic RooAbdPdf?
Hi @guitargeek
I've prepared an relatively easy reproducer with pythonic PDF see this gist
It hangs at the end (the fit it successfull) for ROOT 6.31/01 (LCG dev3 cvmfs nightly slot) but it workd fo the reviosu verisons of ROOT/cppyy.
Thank you very much in advance for advice.
Hi @VanyaBelyaev, with the current ROOT nightlies, at least the problem with PyROOT hanging at the end should be gone. Can you confirm?
If it's gone also for you, does it mean your only issue with the new PyROOT at this point is the one you report in the original post of this thread, plus the enum issue?
Dear @guitargeek Thank you very much. In my tests I see positive changes for LCG dev3 cvmfs nightluies
x86_64-el9-clang16-opt
platform it either succeded or make segfaults at the end with approximately ~50% probabilityx86_64-el9-gcc13-opt
is still hangs at the end Dear @guitargeek
... and I have one more problem with another test no my project. It also hangs.. Unforunately it i not so simple to isolate,(that's why I am not reporting this problem since I have no simple reproducer) but since it also involves C++ virtual functions reimplemented in python, migth be the unnderlying reason is the same..
Check duplicate issues.
Description
Recent version of PyROOT/cppyy fails for relatively simple templated function overload with SFINAE. The reproducer is here. There is templated C++ class A and there are template functions
fun_2
overloaded with SFINAE - see below.For completeness:
I am using LCG-dev3 cvmfs nightly builds with ROOT 6.31/01
Reproducer
And the output is:
ROOT version
6.31/01 Linux, LCG-dev3 cvmvs nightly builds
Installation method
LCG-dev3 cvmfs nightly build
Operating system
Linux
Additional context
If I am not mistaken semtime ago the situations was just an opposite - stanalone template fuctions were OK, but template methods were not OK... but now I am not 100% sure...