LLM inference in C/C++
C++ ggml
cmake : fix build when GGML_CPU=OFF and GGML_CUDA=ON (#29026)
Nikita Gordeev8ed1a55efcd7
diff --git a/examples/convert-llama2c-to-ggml/CMakeLists.txt b/examples/convert-llama2c-to-ggml/CMakeLists.txtindex 2162da4fdf..d921af9a49 100644--- a/examples/convert-llama2c-to-ggml/CMakeLists.txt+++ b/examples/convert-llama2c-to-ggml/CMakeLists.txt@@ -1,5 +1,7 @@-set(TARGET llama-convert-llama2c-to-ggml)-add_executable(${TARGET} convert-llama2c-to-ggml.cpp)-install(TARGETS ${TARGET} RUNTIME)-target_link_libraries(${TARGET} PRIVATE llama-common llama ${CMAKE_THREAD_LIBS_INIT})-target_compile_features(${TARGET} PRIVATE cxx_std_17)+if (GGML_CPU)+ set(TARGET llama-convert-llama2c-to-ggml)+ add_executable(${TARGET} convert-llama2c-to-ggml.cpp)+ install(TARGETS ${TARGET} RUNTIME)+ target_link_libraries(${TARGET} PRIVATE llama-common llama ${CMAKE_THREAD_LIBS_INIT})+ target_compile_features(${TARGET} PRIVATE cxx_std_17)+endif()diff --git a/pocs/CMakeLists.txt b/pocs/CMakeLists.txtindex d49d14dee4..93c76d609a 100644--- a/pocs/CMakeLists.txt+++ b/pocs/CMakeLists.txt@@ -8,7 +8,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})if (EMSCRIPTEN)else()- if (NOT GGML_BACKEND_DL)+ if (NOT GGML_BACKEND_DL AND GGML_CPU)add_subdirectory(vdot)endif()endif()diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txtindex a398344c89..9b3a4fcc4b 100644--- a/tests/CMakeLists.txt+++ b/tests/CMakeLists.txt@@ -322,7 +322,7 @@ if (APPLE)llama_build(test-rset-release.cpp)endif()-if (NOT GGML_BACKEND_DL)+if (NOT GGML_BACKEND_DL AND GGML_CPU)# these tests use the backends directly and cannot be built with dynamic loadingllama_build_and_test(test-barrier.cpp)llama_build_and_test(test-quantize-fns.cpp)