From be0994b7282a4b8bf2220ed2d5df84d025bdb921 Mon Sep 17 00:00:00 2001 From: Cheng Date: Sun, 8 Dec 2024 12:47:45 +0900 Subject: [PATCH] Link with openblas statically --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10dc29587..0eba3cb30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,13 +152,13 @@ if(MLX_BUILD_CPU) GIT_REPOSITORY https://github.com/OpenMathLib/OpenBLAS.git GIT_TAG v0.3.28 EXCLUDE_FROM_ALL) - set(NOFORTRAN ON) # msvc has no fortran compiler + set(BUILD_STATIC_LIBS ON) # link statically + set(NOFORTRAN ON) # msvc has no fortran compiler FetchContent_MakeAvailable(openblas) target_link_libraries(mlx PRIVATE openblas) target_include_directories( mlx PRIVATE "${openblas_SOURCE_DIR}/lapack-netlib/LAPACKE/include" - "${CMAKE_BINARY_DIR}/generated" - "${CMAKE_BINARY_DIR}") + "${CMAKE_BINARY_DIR}/generated" "${CMAKE_BINARY_DIR}") else() if(${CMAKE_HOST_APPLE}) # The blas shipped in macOS SDK is not supported, search homebrew for