From: 布客飞龙 Date: Wed, 4 Oct 2023 09:04:16 +0000 (+0800) Subject: cmake : add OPENCL_LIB to solve problem [cannot resolve external symbol clxxxx ]... X-Git-Tag: upstream/0.0.1642~1233 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=043251ca824d82e288ddb155984ef18b28c71faa;p=pkg%2Fggml%2Fsources%2Fggml cmake : add OPENCL_LIB to solve problem [cannot resolve external symbol clxxxx ] (#527) --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 57287e41..c857659f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -177,12 +177,12 @@ if (GGML_CLBLAST) ) find_path(CLBLAST_INC NAMES clblast.h PATHS ${CLBLAST_INCLUDE_SEARCH_PATHS}) find_library(CLBLAST_LIB NAMES clblast) - if (CLBLAST_LIB AND CLBLAST_INC) + find_library(OPENCL_LIB NAMES OpenCL) + if (CLBLAST_LIB AND OPENCL_LIB AND CLBLAST_INC) message(STATUS "clBLAST found") - set(GGML_EXTRA_INCS ${GGML_EXTRA_INCS} ${CLBLAST_INC}) - set(GGML_EXTRA_LIBS ${GGML_EXTRA_LIBS} ${CLBLAST_LIB}) + set(GGML_EXTRA_LIBS ${GGML_EXTRA_LIBS} ${CLBLAST_LIB} ${OPENCL_LIB}) set(GGML_EXTRA_FLAGS ${GGML_EXTRA_FLAGS} -DGGML_USE_CLBLAST) set(GGML_OPENCL_SOURCES ggml-opencl.cpp ggml-opencl.h)