diff --git a/CMakeLists.txt b/CMakeLists.txt index b802edd3194ba..c5b035de3812c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,10 +305,11 @@ if (LLAMA_BLAS) add_compile_definitions(GGML_USE_OPENBLAS) - add_subdirectory(../OpenBLAS ${CMAKE_CURRENT_BINARY_DIR}/OpenBLAS) + set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} openblas) - set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} openblas_shared) - set(LLAMA_EXTRA_INCLUDES ${LLAMA_EXTRA_INCLUDES} ../OpenBLAS ${CMAKE_CURRENT_BINARY_DIR}/OpenBLAS) + # we need to add the shared openblas library we built in our over-arching project + # this directory includes the "config.h" file generated by OpenBLAS + set(LLAMA_EXTRA_INCLUDES ${LLAMA_EXTRA_INCLUDES} ../OpenBLAS ${CMAKE_CURRENT_BINARY_DIR}/../../openblas) endif() if (LLAMA_LLAMAFILE)