From 28093882a49bae5d813b4d83791606dda3f1bd94 Mon Sep 17 00:00:00 2001 From: Cheng Date: Wed, 11 Dec 2024 08:55:31 +0900 Subject: [PATCH] Link with BLAS privately --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 245cf10a4..ff3df8aa6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,7 +176,7 @@ if(MLX_BUILD_CPU) message(STATUS "Lapack lib " ${LAPACK_LIBRARIES}) message(STATUS "Lapack include " ${LAPACK_INCLUDE_DIRS}) target_include_directories(mlx PRIVATE ${LAPACK_INCLUDE_DIRS}) - target_link_libraries(mlx PUBLIC ${LAPACK_LIBRARIES}) + target_link_libraries(mlx PRIVATE ${LAPACK_LIBRARIES}) # List blas after lapack otherwise we may accidentally incldue an old # version of lapack.h from the include dirs of blas. find_package(BLAS REQUIRED) @@ -189,7 +189,7 @@ if(MLX_BUILD_CPU) message(STATUS "Blas lib " ${BLAS_LIBRARIES}) message(STATUS "Blas include " ${BLAS_INCLUDE_DIRS}) target_include_directories(mlx PRIVATE ${BLAS_INCLUDE_DIRS}) - target_link_libraries(mlx PUBLIC ${BLAS_LIBRARIES}) + target_link_libraries(mlx PRIVATE ${BLAS_LIBRARIES}) endif() else() set(MLX_BUILD_ACCELERATE OFF)