build failure in test_xadaptor_semantic.cpp with xsimd on arm64
A build of xtensor 0.23.10 with xsimd support on arm64 fails with this error:
[ 4%] Building CXX object test/CMakeFiles/test_xtensor_lib.dir/test_xadaptor_semantic.cpp.o
cd /<<PKGBUILDDIR>>/obj-aarch64-linux-gnu/test && /usr/bin/c++ -DXSIMD_ENABLE_XTL_COMPLEX -DXTENSOR_USE_XSIMD -I/<<PKGBUILDDIR>>/include -isystem /<<PKGBUILDDIR>>/obj-aarch64-linux-gnu/test/googletest-src/googletest/include -isystem /<<PKGBUILDDIR>>/obj-aarch64-linux-gnu/test/googletest-src/googletest -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -march=native -std=c++14 -Wunused-parameter -Wextra -Wreorder -Wconversion -Wsign-conversion -Wold-style-cast -Wunused-variable -ftemplate-backtrace-limit=0 -DGTEST_HAS_PTHREAD=1 -o CMakeFiles/test_xtensor_lib.dir/test_xadaptor_semantic.cpp.o -c /<<PKGBUILDDIR>>/test/test_xadaptor_semantic.cpp
In file included from /usr/include/xsimd/types/xsimd_types_include.hpp:69,
from /usr/include/xsimd/types/xsimd_traits.hpp:17,
from /usr/include/xsimd/xsimd.hpp:16,
from /<<PKGBUILDDIR>>/include/xtensor/xtensor_config.hpp:75,
from /<<PKGBUILDDIR>>/include/xtensor/xbuffer_adaptor.hpp:21,
from /<<PKGBUILDDIR>>/include/xtensor/xarray.hpp:19,
from /<<PKGBUILDDIR>>/test/test_xjson.cpp:14:
/usr/include/xsimd/types/xsimd_neon_complex.hpp:369:15: error: ‘template<class X> class xsimd::simd_complex_batch_bool’ used without template arguments
369 | using simd_complex_batch_bool::simd_complex_batch_bool;
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/xsimd/types/xsimd_neon_complex.hpp: In constructor ‘xsimd::batch_bool<xtl::xcomplex<float, float, i3ec>, 4>::batch_bool(bool, bool, bool, bool)’:
/usr/include/xsimd/types/xsimd_neon_complex.hpp:374:15: error: class ‘xsimd::batch_bool<xtl::xcomplex<float, float, i3ec>, 4>’ does not have any field named ‘simd_complex_batch_bool’
374 | : simd_complex_batch_bool(real_batch(b0, b1, b2, b3))
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/xsimd/types/xsimd_neon_complex.hpp: At global scope:
/usr/include/xsimd/types/xsimd_neon_complex.hpp:410:26: error: type ‘xsimd::batch<xtl::xcomplex<float, float, i3ec>, 4>::base_type’ is not a base type for type ‘xsimd::batch<xtl::xcomplex<float, float, i3ec>, 4>’
410 | using base_type::base_type;
| ^~~~~~~~~
/usr/include/xsimd/types/xsimd_neon_complex.hpp:419:26: error: type ‘xsimd::batch<xtl::xcomplex<float, float, i3ec>, 4>::base_type’ is not a base type for type ‘xsimd::batch<xtl::xcomplex<float, float, i3ec>, 4>’
419 | using base_type::load_aligned;
...
The full log is available at https://buildd.debian.org/status/fetch.php?pkg=xtensor&arch=arm64&ver=0.23.10-5&stamp=1631536972&raw=0
The problem seems to be related to but not the same as #1898 . I've applied the patch suggested there (#include <xsimd/xsimd.hpp> in xcomplex.hpp)
xsimd is 7.5.0, building with g++ 10.3.0. xsimd passes its own tests on arm64, https://ci.debian.net/packages/x/xsimd/testing/arm64/
xsimd passes its own tests on arm64
Mind you, the xsimd tests don't seem to be touching simd_complex, https://ci.debian.net/data/autopkgtest/testing/arm64/x/xsimd/14648837/log.gz
Perhaps xtensor is hitting a bug in xsimd?
Looks like this is xsimd issue 400, https://github.com/xtensor-stack/xsimd/issues/400