diff --git a/Makefile b/Makefile index 551e052aa..6b0d2bc01 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,13 @@ # Add custom options to Makefile.local rather than editing this file. -include $(abspath $(lastword ${MAKEFILE_LIST})).local -default: koboldcpp_default koboldcpp_failsafe koboldcpp_noavx2 koboldcpp_clblast koboldcpp_clblast_noavx2 koboldcpp_cublas koboldcpp_hipblas koboldcpp_vulkan koboldcpp_vulkan_noavx2 +.PHONY: finishedmsg + +default: koboldcpp_default koboldcpp_failsafe koboldcpp_noavx2 koboldcpp_clblast koboldcpp_clblast_noavx2 koboldcpp_cublas koboldcpp_hipblas koboldcpp_vulkan koboldcpp_vulkan_noavx2 finishedmsg tools: quantize_gpt2 quantize_gptj quantize_gguf quantize_neox quantize_mpt quantize_clip whispermain sdmain gguf-split dev: koboldcpp_default dev2: koboldcpp_clblast -dev3: koboldcpp_vulkan +dev3: koboldcpp_vulkan finishedmsg ifndef UNAME_S UNAME_S := $(shell uname -s) @@ -134,7 +136,7 @@ endif # Architecture specific # TODO: probably these flags need to be tweaked on some architectures # feel free to update the Makefile for your architecture and send a pull request or issue -ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686)) +ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686 amd64)) # Use all CPU extensions that are available: # old library NEEDS mf16c to work. so we must build with it. new one doesnt ifeq ($(OS),Windows_NT) @@ -309,9 +311,13 @@ endif # LLAMA_METAL ifneq ($(filter aarch64%,$(UNAME_M)),) # Apple M1, M2, etc. # Raspberry Pi 3, 4, Zero 2 (64-bit) - CFLAGS += - CXXFLAGS += + ifdef LLAMA_PORTABLE + else + CFLAGS += -mcpu=native + CXXFLAGS += -mcpu=native + endif endif + ifneq ($(filter armv6%,$(UNAME_M)),) # Raspberry Pi 1, Zero CFLAGS += -mfpu=neon-fp-armv8 -mfp16-format=ieee -mno-unaligned-access @@ -343,6 +349,7 @@ CLBLAST_BUILD = CUBLAS_BUILD = HIPBLAS_BUILD = VULKAN_BUILD = +NOTIFY_MSG = ifeq ($(OS),Windows_NT) DEFAULT_BUILD = $(CXX) $(CXXFLAGS) $^ -shared -o $@.dll $(LDFLAGS) @@ -360,9 +367,11 @@ ifeq ($(OS),Windows_NT) else DEFAULT_BUILD = $(CXX) $(CXXFLAGS) $^ -shared -o $@.so $(LDFLAGS) ifdef LLAMA_PORTABLE + ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686 amd64)) FAILSAFE_BUILD = $(CXX) $(CXXFLAGS) $^ -shared -o $@.so $(LDFLAGS) NOAVX2_BUILD = $(CXX) $(CXXFLAGS) $^ -shared -o $@.so $(LDFLAGS) endif + endif ifdef LLAMA_CLBLAST ifeq ($(UNAME_S),Darwin) @@ -385,7 +394,9 @@ else ifndef LLAMA_CUBLAS ifndef LLAMA_HIPBLAS ifndef LLAMA_VULKAN - VULKAN_BUILD = @echo 'Your OS $(OS) does not appear to be Windows. For faster speeds, install and link a BLAS library. Set LLAMA_VULKAN=1 to compile with Vulkan support. This is just a reminder, not an error.' + ifndef LLAMA_METAL + NOTIFY_MSG = @echo -e '\nYou did a basic CPU build. For faster speeds, install and link a BLAS library. \nSet LLAMA_VULKAN=1 to compile with Vulkan support. This is just a reminder, not an error.' + endif endif endif endif @@ -721,3 +732,8 @@ simpleclinfo: simpleclinfo.cpp build-info.h: $(DONOTHING) + +#phony for printing messages +finishedmsg: + $(NOTIFY_MSG) + $(DONOTHING) \ No newline at end of file