Skip to content

Commit ece96e1

Browse files
committed
clean up makefile
1 parent d0d1d92 commit ece96e1

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

Makefile

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Add custom options to Makefile.local rather than editing this file.
22
-include $(abspath $(lastword ${MAKEFILE_LIST})).local
33

4-
default: koboldcpp_default koboldcpp_failsafe koboldcpp_noavx2 koboldcpp_clblast koboldcpp_clblast_noavx2 koboldcpp_cublas koboldcpp_hipblas koboldcpp_vulkan koboldcpp_vulkan_noavx2
4+
.PHONY: finishedmsg
5+
6+
default: koboldcpp_default koboldcpp_failsafe koboldcpp_noavx2 koboldcpp_clblast koboldcpp_clblast_noavx2 koboldcpp_cublas koboldcpp_hipblas koboldcpp_vulkan koboldcpp_vulkan_noavx2 finishedmsg
57
tools: quantize_gpt2 quantize_gptj quantize_gguf quantize_neox quantize_mpt quantize_clip whispermain sdmain gguf-split
68
dev: koboldcpp_default
79
dev2: koboldcpp_clblast
8-
dev3: koboldcpp_vulkan
10+
dev3: koboldcpp_vulkan finishedmsg
911

1012
ifndef UNAME_S
1113
UNAME_S := $(shell uname -s)
@@ -134,7 +136,7 @@ endif
134136
# Architecture specific
135137
# TODO: probably these flags need to be tweaked on some architectures
136138
# feel free to update the Makefile for your architecture and send a pull request or issue
137-
ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686))
139+
ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686 amd64))
138140
# Use all CPU extensions that are available:
139141
# old library NEEDS mf16c to work. so we must build with it. new one doesnt
140142
ifeq ($(OS),Windows_NT)
@@ -309,9 +311,13 @@ endif # LLAMA_METAL
309311
ifneq ($(filter aarch64%,$(UNAME_M)),)
310312
# Apple M1, M2, etc.
311313
# Raspberry Pi 3, 4, Zero 2 (64-bit)
312-
CFLAGS +=
313-
CXXFLAGS +=
314+
ifdef LLAMA_PORTABLE
315+
else
316+
CFLAGS += -mcpu=native
317+
CXXFLAGS += -mcpu=native
318+
endif
314319
endif
320+
315321
ifneq ($(filter armv6%,$(UNAME_M)),)
316322
# Raspberry Pi 1, Zero
317323
CFLAGS += -mfpu=neon-fp-armv8 -mfp16-format=ieee -mno-unaligned-access
@@ -343,6 +349,7 @@ CLBLAST_BUILD =
343349
CUBLAS_BUILD =
344350
HIPBLAS_BUILD =
345351
VULKAN_BUILD =
352+
NOTIFY_MSG =
346353

347354
ifeq ($(OS),Windows_NT)
348355
DEFAULT_BUILD = $(CXX) $(CXXFLAGS) $^ -shared -o [email protected] $(LDFLAGS)
@@ -360,9 +367,11 @@ ifeq ($(OS),Windows_NT)
360367
else
361368
DEFAULT_BUILD = $(CXX) $(CXXFLAGS) $^ -shared -o [email protected] $(LDFLAGS)
362369
ifdef LLAMA_PORTABLE
370+
ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686 amd64))
363371
FAILSAFE_BUILD = $(CXX) $(CXXFLAGS) $^ -shared -o [email protected] $(LDFLAGS)
364372
NOAVX2_BUILD = $(CXX) $(CXXFLAGS) $^ -shared -o [email protected] $(LDFLAGS)
365373
endif
374+
endif
366375

367376
ifdef LLAMA_CLBLAST
368377
ifeq ($(UNAME_S),Darwin)
@@ -385,7 +394,9 @@ else
385394
ifndef LLAMA_CUBLAS
386395
ifndef LLAMA_HIPBLAS
387396
ifndef LLAMA_VULKAN
388-
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.'
397+
ifndef LLAMA_METAL
398+
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.'
399+
endif
389400
endif
390401
endif
391402
endif
@@ -721,3 +732,8 @@ simpleclinfo: simpleclinfo.cpp
721732

722733
build-info.h:
723734
$(DONOTHING)
735+
736+
#phony for printing messages
737+
finishedmsg:
738+
$(NOTIFY_MSG)
739+
$(DONOTHING)

0 commit comments

Comments
 (0)