From dbd3a6d1ed8416a8fd800127251e730153afa305 Mon Sep 17 00:00:00 2001 From: Andrei Betlen Date: Thu, 14 Sep 2023 18:25:44 -0400 Subject: [PATCH] Fix issue installing on m1 macs --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 633431b..c503d48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,15 +7,13 @@ option(LLAMA_BUILD "Build llama.cpp shared library and install alongside python if (LLAMA_BUILD) set(BUILD_SHARED_LIBS "On") - if (APPLE) - # Need to disable these llama.cpp flags on Apple + if (APPLE AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") + # Need to disable these llama.cpp flags on Apple x86_64, # otherwise users may encounter invalid instruction errors set(LLAMA_AVX "Off" CACHE BOOL "llama: enable AVX" FORCE) set(LLAMA_AVX2 "Off" CACHE BOOL "llama: enable AVX2" FORCE) set(LLAMA_FMA "Off" CACHE BOOL "llama: enable FMA" FORCE) set(LLAMA_F16C "Off" CACHE BOOL "llama: enable F16C" FORCE) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mtune=native") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mtune=native") endif() add_subdirectory(vendor/llama.cpp) install(