Skip to content

Boost.compute does not compile with clang++ -std=c++11 #6

@ddemidov

Description

@ddemidov

Hi,

The compilation succeeds with default settings, but fails if c++11 standard is used:

$ cd compute/build
$ CC=clang CXX=clang++ cmake -DCMAKE_CXX_FLAGS=-std=c++11 -DBOOST_COMPUTE_BUILD_BENCHMARKS=ON -DBOOST_COMPUTE_BUILD_EXAMPLES=ON -DBOOST_COMPUTE_BUILD_TESTS=ON ..
-- The C compiler identification is Clang 3.2.0
-- The CXX compiler identification is Clang 3.2.0
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found OpenCL: /usr/lib64/libOpenCL.so  
-- Boost version: 1.52.0
-- Boost version: 1.52.0
-- Found the following Boost libraries:
--   unit_test_framework
-- Configuring done
-- Generating done
-- Build files have been written to: /home/demidov/work/opencl/compute/build

$ make 
Scanning dependencies of target copy_data
[  1%] Building CXX object example/CMakeFiles/copy_data.dir/copy_data.cpp.o
In file included from /home/demidov/work/opencl/compute/example/copy_data.cpp:14:
In file included from /home/demidov/work/opencl/compute/include/boost/compute.hpp:14:
In file included from /home/demidov/work/opencl/compute/include/boost/compute/algorithm.hpp:16:
In file included from /home/demidov/work/opencl/compute/include/boost/compute/algorithm/adjacent_find.hpp:17:
In file included from /home/demidov/work/opencl/compute/include/boost/compute/algorithm/find.hpp:14:
In file included from /home/demidov/work/opencl/compute/include/boost/compute/lambda.hpp:14:
/home/demidov/work/opencl/compute/include/boost/compute/lambda/context.hpp:360:58: error: no type named 'type' in
      'boost::result_of<boost::compute::lambda::expression<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal,
      boost::proto::argsns_::term<boost::compute::lambda::placeholder<0> >, 0> > ()>'
        typename ::boost::result_of<expression<Expr>()>::type
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/demidov/work/opencl/compute/include/boost/compute/lambda/placeholders.hpp:27:58: note: in instantiation of template class
      'boost::compute::lambda::expression<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::compute::lambda::placeholder<0> >, 0>
      >' requested here
expression<proto::terminal<placeholder<0> >::type> const _1;
                                                         ^
In file included from /home/demidov/work/opencl/compute/example/copy_data.cpp:14:
In file included from /home/demidov/work/opencl/compute/include/boost/compute.hpp:14:
In file included from /home/demidov/work/opencl/compute/include/boost/compute/algorithm.hpp:16:
In file included from /home/demidov/work/opencl/compute/include/boost/compute/algorithm/adjacent_find.hpp:17:
In file included from /home/demidov/work/opencl/compute/include/boost/compute/algorithm/find.hpp:14:
In file included from /home/demidov/work/opencl/compute/include/boost/compute/lambda.hpp:14:
/home/demidov/work/opencl/compute/include/boost/compute/lambda/context.hpp:360:58: error: no type named 'type' in
      'boost::result_of<boost::compute::lambda::expression<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal,
      boost::proto::argsns_::term<boost::compute::lambda::placeholder<1> >, 0> > ()>'
        typename ::boost::result_of<expression<Expr>()>::type
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/demidov/work/opencl/compute/include/boost/compute/lambda/placeholders.hpp:28:58: note: in instantiation of template class
      'boost::compute::lambda::expression<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::compute::lambda::placeholder<1> >, 0>
      >' requested here
expression<proto::terminal<placeholder<1> >::type> const _2;
                                                         ^
2 errors generated.
make[2]: *** [example/CMakeFiles/copy_data.dir/copy_data.cpp.o] Error 1
make[1]: *** [example/CMakeFiles/copy_data.dir/all] Error 2
make: *** [all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions