xtensor-stack / xtensor-blas

BLAS extension to xtensor
BSD 3-Clause "New" or "Revised" License
155 stars 54 forks source link

google test failed #173

Closed kouui closed 3 years ago

kouui commented 3 years ago

I installed xtl, xsimd, xtensor, xtensor-blas from source. Both xsimd and xtensor passed the google test successfully, while the test in xtensor-blas reported huge bunch of error.

Here is the cmake configuration log

(base) liu at orchiddeMacBook-Pro in ~/local/xtensor-blas/_build on master*
$ cmake .. -DBUILD_TESTS=ON -DUSE_OPENBLAS=ON
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /Users/liu/local/install/gcc-10.2.0/bin/gcc
-- Check for working C compiler: /Users/liu/local/install/gcc-10.2.0/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /Users/liu/local/install/gcc-10.2.0/bin/g++
-- Check for working CXX compiler: /Users/liu/local/install/gcc-10.2.0/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- xtensor-blas v0.17.2
-- Found xtensor: /Users/liu/local/share/xtensor/include/xtensor
-- xtl include : /Users/liu/local/share/xtl/include
-- xtensor include : /Users/liu/local/share/xtensor/include
-- xtensor_blas include : 
-- Setting tests build type to Release
-- Performing Test _flag_works
-- Performing Test _flag_works - Success
-- Found flag -std=c++14 for language CXX is supported
-- Building with C++14
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/liu/local/xtensor-blas/_build/test/googletest-download
Scanning dependencies of target googletest
[ 11%] Creating directories for 'googletest'
[ 22%] Performing download step (DIR copy) for 'googletest'
[ 33%] No patch step for 'googletest'
[ 44%] No update step for 'googletest'
[ 55%] No configure step for 'googletest'
[ 66%] No build step for 'googletest'
[ 77%] No install step for 'googletest'
[ 88%] No test step for 'googletest'
[100%] Completed 'googletest'
[100%] Built target googletest
-- Found PythonInterp: /Users/liu/kouui/anaconda3/bin/python (found version "3.6.7") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- BLAS VENDOR:    
-- BLAS LIBRARIES: /usr/local/Cellar/openblas/0.3.10_1/lib/libopenblas.dylib
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/liu/local/xtensor-blas/_build

then I started the test

(base) liu at orchiddeMacBook-Pro in ~/local/xtensor-blas/_build on master*
$ make xtest
Scanning dependencies of target gtest
[  7%] Building CXX object test/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 14%] Linking CXX static library ../../../lib/libgtest.a
[ 14%] Built target gtest
Scanning dependencies of target gtest_main
[ 21%] Building CXX object test/googletest-build/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[ 28%] Linking CXX static library ../../../lib/libgtest_main.a
[ 28%] Built target gtest_main
Scanning dependencies of target test_xtensor_blas
[ 35%] Building CXX object test/CMakeFiles/test_xtensor_blas.dir/main.cpp.o
[ 42%] Building CXX object test/CMakeFiles/test_xtensor_blas.dir/test_blas.cpp.o
In file included from /Users/liu/local/share/xtl/include/xtl/xfunctional.hpp:16,
                 from /Users/liu/local/share/xtl/include/xtl/xmeta_utils.hpp:17,
                 from /Users/liu/local/share/xtl/include/xtl/xsequence.hpp:20,
                 from /Users/liu/local/share/xtensor/include/xtensor/xarray.hpp:17,
                 from /Users/liu/local/xtensor-blas/test/test_blas.cpp:11:
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:54:49: error: ‘decay_t’ is not a member of ‘std’; did you mean ‘decay’?
   54 |         using type = decltype(std::declval<std::decay_t<T0>>() + std::declval<std::decay_t<T1>>());
      |                                                 ^~~~~~~
      |                                                 decay
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:54:49: error: ‘decay_t’ is not a member of ‘std’; did you mean ‘decay’?
   54 |         using type = decltype(std::declval<std::decay_t<T0>>() + std::declval<std::decay_t<T1>>());
      |                                                 ^~~~~~~
      |                                                 decay
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:54:36: error: parse error in template argument list
   54 |         using type = decltype(std::declval<std::decay_t<T0>>() + std::declval<std::decay_t<T1>>());
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:54:62: error: expected primary-expression before ‘)’ token
   54 |         using type = decltype(std::declval<std::decay_t<T0>>() + std::declval<std::decay_t<T1>>());
      |                                                              ^
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:54:84: error: ‘decay_t’ is not a member of ‘std’; did you mean ‘decay’?
   54 |         using type = decltype(std::declval<std::decay_t<T0>>() + std::declval<std::decay_t<T1>>());
      |                                                                                    ^~~~~~~
      |                                                                                    decay
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:54:84: error: ‘decay_t’ is not a member of ‘std’; did you mean ‘decay’?
   54 |         using type = decltype(std::declval<std::decay_t<T0>>() + std::declval<std::decay_t<T1>>());
[... ...]
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:124:66: error: ‘V’ was not declared in this scope
  124 |         static constexpr bool is_arithmetic = std::is_arithmetic<V>::value;
      |                                                                  ^
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:124:67: error: template argument 1 is invalid
  124 |         static constexpr bool is_arithmetic = std::is_arithmetic<V>::value;
      |                                                                   ^
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:125:58: error: ‘V’ was not declared in this scope
  125 |         static constexpr bool is_signed = std::is_signed<V>::value;
      |                                                          ^
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:125:59: error: template argument 1 is invalid
  125 |         static constexpr bool is_signed = std::is_signed<V>::value;
      |                                                           ^
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:126:62: error: ‘V’ was not declared in this scope
  126 |         static constexpr bool is_integral = std::is_integral<V>::value;
      |                                                              ^
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:126:63: error: template argument 1 is invalid
  126 |         static constexpr bool is_integral = std::is_integral<V>::value;
      |                                                               ^
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:127:61: error: ‘V’ was not declared in this scope
  127 |         static constexpr bool is_long_double = std::is_same<V, long double>::value;
      |                                                             ^
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:127:75: error: template argument 1 is invalid
  127 |         static constexpr bool is_long_double = std::is_same<V, long double>::value;
[... ...]
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:364:51: error: expected ‘>’ before ‘<’ token
  364 | #define XTL_REQUIRES_IMPL(...) xtl::check_requires<__VA_ARGS__>
      |                                                   ^
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:365:27: note: in expansion of macro ‘XTL_REQUIRES_IMPL’
  365 | #define XTL_REQUIRES(...) XTL_REQUIRES_IMPL(__VA_ARGS__) = 0
      |                           ^~~~~~~~~~~~~~~~~
/Users/liu/local/share/xtl/include/xtl/xoptional.hpp:1077:45: note: in expansion of macro ‘XTL_REQUIRES’
 1077 |     template <class T1, class B1, class T2, XTL_REQUIRES(is_not_xoptional_nor_xmasked_value<T2>)>
      |                                             ^~~~~~~~~~~~
/Users/liu/local/share/xtl/include/xtl/xtype_traits.hpp:364:37: error: ‘xtl::check_requires’ has not been declared
  364 | #define XTL_REQUIRES_IMPL(...) xtl::check_requires<__VA_ARGS__>
[... ...]
      |                    ~~~~~~~~~~~~~~~~~~^~~
/Users/liu/local/share/xtensor/include/xtensor/xstrides.hpp: In instantiation of ‘auto xt::detail::raw_data_offset(const S&) [with long unsigned int dim = 2; S = const long int*]’:
/Users/liu/local/share/xtensor/include/xtensor/xstrides.hpp:182:65:   recursively required from ‘auto xt::detail::raw_data_offset(const S&, Arg, Args ...) [with long unsigned int dim = 1; S = const long int*; Arg = long int; Args = {}]’
/Users/liu/local/share/xtensor/include/xtensor/xstrides.hpp:182:65:   required from ‘auto xt::detail::raw_data_offset(const S&, Arg, Args ...) [with long unsigned int dim = 0; S = const long int*; Arg = long int; Args = {long int}]’
/Users/liu/local/share/xtensor/include/xtensor/xstrides.hpp:277:71:   required from ‘offset_type xt::data_offset(const S&, Arg, Args ...) [with offset_type = long unsigned int; S = xt::svector<long int, 4, std::allocator<long int>, true>; Arg = long int; Args = {long int}]’
/Users/liu/local/share/xtensor/include/xtensor/xcontainer.hpp:451:53:   required from ‘xt::xcontainer<D>::const_reference xt::xcontainer<D>::operator()(Args ...) const [with Args = {int, int}; D = xt::xarray_container<xt::uvector<double, std::allocator<double> >, xt::layout_type::row_major, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>; xt::xcontainer<D>::const_reference = const double&]’
/Users/liu/local/xtensor-blas/test/test_blas.cpp:151:15:   required from here
/Users/liu/local/share/xtensor/include/xtensor/xstrides.hpp:176:38: error: ‘strides_value_type’ was not declared in this scope
make[3]: *** [test/CMakeFiles/test_xtensor_blas.dir/test_blas.cpp.o] Error 1
make[2]: *** [test/CMakeFiles/test_xtensor_blas.dir/all] Error 2
make[1]: *** [test/CMakeFiles/xtest.dir/rule] Error 2
make: *** [xtest] Error 2

I don't know what is going wrong since xtensor passed its test.

Is this caused by the confliction of package version?

xtl : 0.6.19
xsimd : 7.4.8
xtensor : 0.21.7
xtensor-blas : 0.17.2

Thanks for you help!

JohanMabille commented 3 years ago

The version of gtest we used before was not building on gcc > 7. This has been fixed and should work now (we've tested up to gcc 9). Closing this since it should be resolved, feel free to reopen it if you still experience problems.