xtensor-stack / xtensor-r

R bindings for xtensor
BSD 3-Clause "New" or "Revised" License
87 stars 15 forks source link

Upstream changes with `xsimd` in master? #115

Closed DavisVaughan closed 5 years ago

DavisVaughan commented 5 years ago

Did an #include get removed upstream that would cause this to error now?

I'm trying to use the current master branches of all 4 header library dependencies.

─  installing *source* package ‘xtensor’ ...
   Vendoring of xtensor headers is enabled.
   Cloning into 'xtl'...
   Cloning into 'xsimd'...
   Cloning into 'xtensor'...
   Cloning into 'xtensor-r'...
   > library('Rcpp');Rcpp::compileAttributes();
   > 
   > 
   clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include  -I../inst/include --std=c++14 -fPIC  -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
   ** libs
   In file included from RcppExports.cpp:4:
   In file included from ./../inst/include/xtensor.h:4:
   ../inst/include/xtensor-r/roptional.hpp:90:34: error: use of undeclared identifier 'xsimd'
           using simd_return_type = xsimd::simd_return_type<xunderlying_type, requested_type>;
                                    ^
   1 error generated.
   make: *** [RcppExports.o] Error 1
   ERROR: compilation failed for package ‘xtensor’
DavisVaughan commented 5 years ago

I think it needs this one?

#include <xsimd/types/xsimd_traits.hpp>
JohanMabille commented 5 years ago

Indeed there was some change regarding the way we include xsimd, now everything lies in xt_simd namespace instead of xsimd. I didn't notice that downstream packages were also using some xsimd related stuff and wrongly considered this change as backward compatible.

You can replace xsimd with xt_simd everywhere, that should fix the build. You can open a PR with these changes, since the change in xtensor has been released in version 0.20.5.