Open feribg opened 4 years ago
when installing 0.21.4 from conda, it's missing the xaxis_slice_iterator
Good catch! This file is missing from the header list in the CMakeLists.txt.
I can't quite tell the difference between xaxis_slice_iterator and xaxis_iterator.
xaxis_slice_iterator
returns 1-D slices along a given axis while xaxis_iterator
returns (N-1)-D slices along the given axis. See these examples.
Any kind of call to a reference of xtensor or a view with ref.begin(), fails with the following [...]
Iterators are not expressions, you need to dereference them to get a view:
auto xend1 = x_end(1);
auto next_gs = (d(0)-b(0)*(*xend1)/a(0);
But in the example above x_end is actually a view and not an iterator. The error is triggered on something like x_end.begin()
Ah my bad, I read too fast. Do you have a minimal example to reproduce the error you posted? Iterators are heavily tested and work with xtensor
and view objects, so I guess there's something else.
Here's a sample, both fail, I'm more interested in the second one really
xt::xtensor<double, 2> U = xt::zeros<double>({1000L,1000L});
auto step_result_v = xt::view(U, 1, xt::range(1, 999));
auto it = U.begin();
auto end = U.end();
xt::xtensor<double, 2> U = xt::zeros<double>({1000L,1000L});
auto step_result_v = xt::view(U, 1, xt::range(1, 999));
auto it = step_result_v.begin();
auto end = step_result_v.end();
Can you precise which compiler you use? I could not reproduce the issue with the CI, see #2011
I just ran that unit test and it works fine. I think what happened is my code was working on .21.3 then I couldn't find the header above so I upgraded to 0.21.4 and now the code fails with an obscure iterator template, which doesn't seem to be what I pasted above.
Here's the full compiler error if that helps to narrow it down. It's weird because I don't see any iterators being used in my code so seems like the header includes are causing it. Wondering if it's a library version conflict: https://pastebin.com/dTB9fZgk
Apple clang version 11.0.3 (clang-1103.0.32.29)
Target: x86_64-apple-darwin19.3.0
nlohmann_json version: 3.7.3
benchmark version: 0.0.0
xtensor version: 0.21.4
xsimd version: 7.4.6
xtl version: 0.6.13
blas version:
lapack version:
blaze version: 3.7
Can you try with the master branch? If not, can you copy paste the missing header and test again?
If you still have the issue, please post the few lines of code that trigger the error you posted above, because for now I cannot rely it to anything.
I can't easily try master because it relies on conda
to install all the dependencies. But when I downgrade to 0.21.3
it builds fine. Here's the full snippet that breaks:
This is on a mac with the clang version mentioned. It's not possible to be a LAPACK related issue right? Because I added Blaze to the build and it conflicted with xtensor-blas
so I removed the latter, but I don't see that impacting the xtensor
core.
https://gist.github.com/feribg/5a9966960b0a6a949fec7c0c9ee3d77a
I can't easily try master because it relies on conda to install all the dependencies. But when I downgrade to 0.21.3 it builds fine.
One solution is to manullay copy / paste the missing file in your conda environment. The headers of xtensor are located in $CONDA_PREFIX/include/xtensor
. Or wait a few days for the next release.
Here's the full snippet that breaks:
I meant "the few lines of code", this is a big long for investigating ;) The idea when we ask for snippets to reproduce is that we can copy paste them and start investigating immediatly without having to fix the code nor having "noise" around what produces the error. Ideally we will add your snippet as a new unit test and run the CI to check for specific compiler issue if we cannot reproduce locally.
This is on a mac with the clang version mentioned. It's not possible to be a LAPACK related issue right? Because I added Blaze to the build and it conflicted with xtensor-blas so I removed the latter, but I don't see that impacting the xtensor core.
I don't think so, especially if you don't include any header from xtensor-blas / lapack in your snippet (thus the importance to narrow down the code to have the few lines required to reproduce).
I'm not sure why but when installing 0.21.4 from conda, it's missing the
xaxis_slice_iterator
header. Further I can't quite tell the difference betweenxaxis_slice_iterator
andxaxis_iterator
.I'm trying to rewrite this code to avoid the access operators and instead use an iterator (not sure about the performance gain to be had but seems the majority of the time is spent in the () calls):
Any kind of call to a reference of xtensor or a view with ref.begin(), fails with the following: