ClickHouse/cmake/find/opencl.cmake

26 lines
761 B
CMake
Raw Normal View History

2020-05-18 21:41:23 +00:00
# TODO: enable by default
if(0)
option(ENABLE_OPENCL "Enable OpenCL support" ${ENABLE_LIBRARIES})
endif()
if(NOT ENABLE_OPENCL)
return()
endif()
2020-05-15 00:01:14 +00:00
# Intel OpenCl driver: sudo apt install intel-opencl-icd
2020-05-18 21:41:23 +00:00
# @sa https://github.com/intel/compute-runtime/releases
2020-05-15 00:01:14 +00:00
# OpenCL applications should link with ICD loader
2020-05-15 00:01:14 +00:00
# sudo apt install opencl-headers ocl-icd-libopencl1
# sudo ln -s /usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0 /usr/lib/libOpenCL.so
2020-05-18 21:41:23 +00:00
# TODO: add https://github.com/OCL-dev/ocl-icd as submodule instead
2020-05-15 00:01:14 +00:00
2020-05-18 21:41:23 +00:00
find_package(OpenCL)
2020-05-15 00:01:14 +00:00
if(OpenCL_FOUND)
set(USE_OPENCL 1)
else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't enable OpenCL support")
2020-05-15 00:01:14 +00:00
endif()
message(STATUS "Using opencl=${USE_OPENCL}: ${OpenCL_INCLUDE_DIRS} : ${OpenCL_LIBRARIES}")