From 3d5c1e57ea5605b3eda2412df0edab674abb8eea Mon Sep 17 00:00:00 2001 From: Paul Zhu Date: Sat, 19 Oct 2024 22:43:39 -0700 Subject: [PATCH] Move metal flag from AddStep to initial --- CMakeLists.txt | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 61eac0fb..a2de85e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,27 +103,14 @@ if(LLAMA_BUILD) -DCMAKE_CXX_STANDARD=17 -DLLAMA_CUDA=${LLAMA_CUDA} -DLLAMA_METAL=${LLAMA_METAL} + -DGGML_AVX=$,$>>,OFF,ON> + -DGGML_AVX2=$,$>>,OFF,ON> + -DGGML_FMA=$,$>>,OFF,ON> + -DGGML_F16C=$,$>>,OFF,ON> + -DGGML_METAL_EMBED_LIBRARY=$,ON,OFF> BUILD_ALWAYS 1 INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install ) - - if (APPLE AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") - ExternalProject_Add_Step(llama_project disable_optimizations - COMMAND ${CMAKE_COMMAND} -E echo "Disabling optimizations for x86_64 Apple" - COMMAND ${CMAKE_COMMAND} -DGGML_AVX=Off -DGGML_AVX2=Off -DGGML_FMA=Off -DGGML_F16C=Off ${CMAKE_CURRENT_BINARY_DIR}/llama_build - DEPENDEES configure - DEPENDERS build - ) - endif() - - if (APPLE) - ExternalProject_Add_Step(llama_project enable_metal_embed - COMMAND ${CMAKE_COMMAND} -E echo "Enabling Metal library embedding for Apple" - COMMAND ${CMAKE_COMMAND} -DGGML_METAL_EMBED_LIBRARY=On ${CMAKE_CURRENT_BINARY_DIR}/llama_build - DEPENDEES configure - DEPENDERS build - ) - endif() endif() # bark_cpp project