viennacl/viennacl-dev

Missing dependency on GNU/Linux?

Closed this issue · 3 comments

Hi, I am trying to compile the developer edition, but I am having the following error:

/home/vicente/src/viennacl-dev/tests/src/scheduler_matrix.cpp: In instantiation of ‘int run_test(double, UBLASMatrixType&, UBLASMatrixType&, UBLASMatrixType&, ViennaCLMatrixType1&, ViennaCLMatrixType2&, ViennaCLMatrixType3) [with UBLASMatrixType = boost::numeric::ublas::matrix<double, boost::numeric::ublas::basic_row_major<>, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >; ViennaCLMatrixType1 = viennacl::matrix_slice<viennacl::matrix<double, viennacl::column_major> >; ViennaCLMatrixType2 = viennacl::matrix_slice<viennacl::matrix<double, viennacl::column_major> >; ViennaCLMatrixType3 = viennacl::matrix_slice<viennacl::matrix<double, viennacl::column_major> >]’:
/home/vicente/src/viennacl-dev/tests/src/scheduler_matrix.cpp:953:17:   required from ‘int run_test(double) [with T = viennacl::column_major; ScalarType = double]’
/home/vicente/src/viennacl-dev/tests/src/scheduler_matrix.cpp:997:57:   required from here
/home/vicente/src/viennacl-dev/tests/src/scheduler_matrix.cpp:345:56: error: ‘rsqrt’ was not declared in this scope
       ublas_C(i,j) = static_cast<cpu_value_type>(OPNAME(ublas_A(i,j))); \
                                                        ^
/home/vicente/src/viennacl-dev/tests/src/scheduler_matrix.cpp:389:3: note: in expansion of macro ‘GENERATE_UNARY_OP_TEST’
   GENERATE_UNARY_OP_TEST(rsqrt);
   ^
/home/vicente/src/viennacl-dev/tests/src/scheduler_matrix.cpp:354:56: error: ‘rsqrt’ was not declared in this scope
       ublas_C(i,j) = static_cast<cpu_value_type>(OPNAME(ublas_A(i,j) / cpu_value_type(2))); \
                                                        ^
/home/vicente/src/viennacl-dev/tests/src/scheduler_matrix.cpp:389:3: note: in expansion of macro ‘GENERATE_UNARY_OP_TEST’
   GENERATE_UNARY_OP_TEST(rsqrt);
   ^
/home/vicente/src/viennacl-dev/tests/src/scheduler_matrix.cpp:345:56: error: ‘sign’ was not declared in this scope
       ublas_C(i,j) = static_cast<cpu_value_type>(OPNAME(ublas_A(i,j))); \
                                                        ^
/home/vicente/src/viennacl-dev/tests/src/scheduler_matrix.cpp:390:3: note: in expansion of macro ‘GENERATE_UNARY_OP_TEST’
   GENERATE_UNARY_OP_TEST(sign);
   ^
/home/vicente/src/viennacl-dev/tests/src/scheduler_matrix.cpp:354:56: error: ‘sign’ was not declared in this scope
       ublas_C(i,j) = static_cast<cpu_value_type>(OPNAME(ublas_A(i,j) / cpu_value_type(2))); \
                                                        ^
/home/vicente/src/viennacl-dev/tests/src/scheduler_matrix.cpp:390:3: note: in expansion of macro ‘GENERATE_UNARY_OP_TEST’
   GENERATE_UNARY_OP_TEST(sign);

And equivalent to that repeated times. My configure is:

cmake .. \
-DCMAKE_BUILD_TYPE=Release                                      \
-DCMAKE_C_COMPILER=/usr/bin/gcc-5	              	        \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-5			       	\
-DENABLE_PEDANTIC_FLAGS=ON                                      \
-DBOOST_ROOT="~/src/boost_1_66_0"                               \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -msse3 -std=c++11 -O3 -g" \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -msse3 -O3 -g"                \
-DCUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS} -Xcompiler -std=c++11"    \
-DENABLE_OPENMP=ON                                              \
-DENABLE_CUDA=OFF                                               \
-DENABLE_OPENCL=ON                                              \
-DENABLE_UBLAS=ON                                               \
-DENABLE_EIGEN=OFF                                              \
-DEIGEN_INCLUDE_DIR="~/src/eigen"                               \

#decomment this to have it verbose
# make VERBOSE=1 -j4
make -j4
# sudo make install

I am using GCC-5 (If I am able to compile the basic I will try with CUDA)

Many thanks in advance

Hi,
I'm afraid that this is a weakness of extra C++11 operator support in ViennaCL: rsqrt(), exp10(), and sign() (possibly also trunc()) are incorrectly used. I'll delete the respective operators in a day or two (I'm currently on travel).

A workaround is to compile only with C++03 with the flag -std=c++03.

Thanks a lot, I will close this. Regards

I just pushed a fix for the compilation issues in C++11 mode. Thanks for bringing this to my attention!