Comments (9)
Hi! You are having two different C++ interpreters running there. The one of ROOT and the one of cppyy
. I don't really understand why you do that. Maybe it's an artifact of how you constructed the reproducer? What about using PyROOT all the way?
import ROOT
ROOT.gInterpreter.LoadText("""
#include <tuple>
#include <string>
using ATuple = std::tuple<int, float, std::string, double>;
""")
from ROOT import ATuple
ROOT.std.tuple_element[1, ATuple].type
If you mix the independent interpreters in such a crazy way that you use the types from PyROOT as template parameters for cppyy types, it's not surprising that it fails.
from root.
I think in this case the cppyy
that we pick up is the one that comes bundled with ROOT1, and this seems to be working in all other OS'es (or at least we have not yet heard any complaints) except for macOS. I simply assumed that ROOT
will just forward to its cppyy
internally which is why I went for cppyy
directly.
Let me try via PyROOT to see if that indeed already solves this.
Footnotes
-
At least
python -c 'import cppyy; print(cppyy.__file__)'
yields<root-prefix>/lib/root/cppyy/__init__.py
. ↩
from root.
Just tested this and we get the same error message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: <class cppyy.gbl.tuple_element<1,tuple<int,float,string,double> > at 0x146607890> has no attribute 'type'. Full details:
type object 'tuple_element<1,tuple<int,float,string,double> >' has no attribute 'type'
'tuple_element<1,tuple<int,float,string,double> >::type' is not a known C++ class
'type' is not a known C++ template
'type' is not a known C++ enum
>>>
This looks a bit like some mismatch between clang or libc++ versions(?), but I don't know where the specifics would enter in this case.
from root.
Ah okay, interesting I didn't know you would pick up the cppyy from ROOT like this! Will investigate further next week when I can reproduce it. Interestingly, on my computer it works, even your original reproducer! So I think you're right, there must be some mismatch that happens with ROOT in your environment.
from root.
Has there been any resolution to this issue ?
I observe the same error on a rather virgin macbook pro (coreI5, 14.3) after installing ROOT w/ homebrew (no LCG or Ke4hep stack involved).
from root.
@gaede, I still fail to reproduce the issue, but I'm intending to make the reproducer a unit test, hoping to see the failure on some of the platforms.
from root.
@guitargeek, excellent thanks. Then we hope that it can be reproduced - and fixed ;-)
from root.
It doesn't look like it can be reproduced so far :( Maybe after merging the roottest PR, we will see the failure at some point somewhere in the nightlies.
from root.
Strange that you cannot reproduce this on any macos. I see this error even with using cppyy standalone:
import cppyy
cppyy.cppdef("""
#include <tuple>
#include <string>
using ATuple = std::tuple<int, float, std::string, double>;
""")
from cppyy.gbl import ATuple
cppyy.gbl.std.tuple_element[1, ATuple].type
print( cppyy )
Gives with cppyy and no root in the path:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: <class cppyy.gbl.std.tuple_element<1,std::tuple<int,float,std::string,double>> at 0x7f9365f9b1d0> has no attribute 'type'. Full details:
type object 'tuple_element<1,std::tuple<int,float,std::string,d' has no attribute 'type'
'std::tuple_element<1,std::tuple<int,float,std::string,double>>::type' is not a known C++ class
'type' is not a known C++ template
'type' is not a known C++ enum
>>> print (cppyy)
<module 'cppyy' from '/usr/local/lib/python3.9/site-packages/cppyy/__init__.py'>
And of course the same error using the cppyy shipped with root 6.26.06 and 6.28.04.
So to me it seems cppyy
cannot deal with std::tuple
on macos.
from root.
Related Issues (20)
- Build error with "nlohmann/json.hpp: No such file or directory" in spack (unit tests build, with --test=root option) HOT 8
- TBuffer* classes should abort in case the 1GB limit is being hit HOT 2
- [cling] Undocumented behaviour of root macro_C.so
- `-Dbuiltin_llvm=OFF` conflicts with use of 3D graphics (via Mesa built with LLVM) HOT 5
- Teach the CI to add a note in the summary comment if the failure is observed on other PRs
- Error at the prompt may lead to the JIT not finding std::basic_ostream symbol
- interpreter fails with assertion in debug builds on ARM when upgrading gcc HOT 3
- 1D `std::array` "has both a leaf count and a static length" HOT 1
- 6.26 cannot read file written with 6.30.4 HOT 17
- TEfficiency drawing to .C is broken
- [ntuple] TObject serialization faulty
- [ntuple] Incorrect treatment of unsplittable classes HOT 2
- Allow ROOT::RDF::RCutFlowReport and ROOT::RDF::TCutInfo to be written to a file. HOT 3
- root -a shows splash screen cut between two display monitors HOT 1
- The imp module is removed in Python 3.12 HOT 3
- Problems with Confidence Band of TRatioPlot HOT 4
- TRatioplot gives "different" results with Web Graphics HOT 4
- TRatioPlot crashes if loaded from the file HOT 5
- [hist] TH1::SaveAs missing default option argument causes compilation errors HOT 2
- [ntuple] add streamer info records to TFile
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from root.