Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boost.compute no longer a self contained library? #810

Open
rosenrodt opened this issue Jan 10, 2019 · 0 comments
Open

Boost.compute no longer a self contained library? #810

rosenrodt opened this issue Jan 10, 2019 · 0 comments

Comments

@rosenrodt
Copy link
Contributor

In the official Boost.Compute documentation, the tutorial starts with how to get Boost.Compute running as succinctly as:

g++ -I/path/to/compute/include main.cpp -lOpenCL

But it won't work.

It seems we also need to add Boost in the include path, as many source files need Boost library features such as BOOST_STATIC_ASSERT(). So maybe the tutorial can be updated to clear up some confusions

The tutorial also implies no external dependencies are needed. I need to define macro BOOST_COMPUTE_NO_BOOST_CHRONO to disable linking with libboost_chrono. Again it seems to go undocumented too

For reference, here is my cmake script for compiling example/hello_world.cpp to make it compile without external dependencies.

find_path(BoostCompute_INCLUDE_DIRS 
  NAME boost/compute.hpp
  PATHS /repo/boost.compute/include)
find_package(OpenCL REQUIRED)
find_package(Boost 1.54 REQUIRED)

add_executable(compute_hello_world hello_world.cpp)
target_include_directories(compute_hello_world PRIVATE 
  ${BoostCompute_INCLUDE_DIRS}
  ${OpenCL_INCLUDE_DIRS}
  ${Boost_INCLUDE_DIRS}
  )
target_link_libraries(compute_hello_world 
  ${OpenCL_LIBRARIES}
  )
target_compile_definitions(compute_hello_world PRIVATE 
  BOOST_COMPUTE_NO_BOOST_CHRONO # disable linking with boost chrono library
  )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant