@@ -3,7 +3,7 @@ GOTEST=$(GOCMD) test
3
3
GOVET =$(GOCMD ) vet
4
4
BINARY_NAME =local-ai
5
5
6
- GOLLAMA_VERSION? =eb99b5438787cbd687682da445e879e02bfeaa07
6
+ GOLLAMA_VERSION? =7f9ae4246088f0c08ed322acbae21d69cd2eb547
7
7
GPT4ALL_REPO? =https://github.com/go-skynet/gpt4all
8
8
GPT4ALL_VERSION? =a330bfe26e9e35ca402e16df18973a3b162fb4db
9
9
GOGPT2_VERSION? =92421a8cf61ed6e03babd9067af292b094cb1307
@@ -12,7 +12,9 @@ RWKV_VERSION?=07166da10cb2a9e8854395a4f210464dcea76e47
12
12
WHISPER_CPP_VERSION? =1d17cd5bb37a3212679d6055ad69ba5a8d58eb71
13
13
BERT_VERSION? =33118e0da50318101408986b86a331daeb4a6658
14
14
BLOOMZ_VERSION? =e9366e82abdfe70565644fbfae9651976714efd1
15
-
15
+ BUILD_TYPE? =
16
+ CGO_LDFLAGS? =
17
+ CUDA_LIBPATH? =/usr/local/cuda/lib64/
16
18
17
19
GREEN := $(shell tput -Txterm setaf 2)
18
20
YELLOW := $(shell tput -Txterm setaf 3)
@@ -23,15 +25,12 @@ RESET := $(shell tput -Txterm sgr0)
23
25
C_INCLUDE_PATH =$(shell pwd) /go-llama:$(shell pwd) /gpt4all/gpt4all-bindings/golang/:$(shell pwd) /go-gpt2:$(shell pwd) /go-rwkv:$(shell pwd) /whisper.cpp:$(shell pwd) /go-bert:$(shell pwd) /bloomz
24
26
LIBRARY_PATH =$(shell pwd) /go-llama:$(shell pwd) /gpt4all/gpt4all-bindings/golang/:$(shell pwd) /go-gpt2:$(shell pwd) /go-rwkv:$(shell pwd) /whisper.cpp:$(shell pwd) /go-bert:$(shell pwd) /bloomz
25
27
26
- # Use this if you want to set the default behavior
27
- ifndef BUILD_TYPE
28
- BUILD_TYPE:=default
28
+ ifeq ($(BUILD_TYPE ) ,openblas)
29
+ CGO_LDFLAGS+="-lopenblas"
29
30
endif
30
31
31
- ifeq ($(BUILD_TYPE ) , "generic")
32
- GENERIC_PREFIX:=generic-
33
- else
34
- GENERIC_PREFIX:=
32
+ ifeq ($(BUILD_TYPE ) ,cublas)
33
+ CGO_LDFLAGS+="-lcublas -lcudart -L$(CUDA_LIBPATH)"
35
34
endif
36
35
37
36
.PHONY : all test build vendor
@@ -94,7 +93,7 @@ go-bert/libgobert.a: go-bert
94
93
$(MAKE ) -C go-bert libgobert.a
95
94
96
95
gpt4all/gpt4all-bindings/golang/libgpt4all.a : gpt4all
97
- $(MAKE ) -C gpt4all/gpt4all-bindings/golang/ $( GENERIC_PREFIX ) libgpt4all.a
96
+ $(MAKE ) -C gpt4all/gpt4all-bindings/golang/ libgpt4all.a
98
97
99
98
# # CEREBRAS GPT
100
99
go-gpt2 :
@@ -113,7 +112,7 @@ go-gpt2:
113
112
@find ./go-gpt2 -type f -name " *.cpp" -exec sed -i' ' -e ' s/json_/json_gpt2_/g' {} +
114
113
115
114
go-gpt2/libgpt2.a : go-gpt2
116
- $(MAKE ) -C go-gpt2 $( GENERIC_PREFIX ) libgpt2.a
115
+ $(MAKE ) -C go-gpt2 libgpt2.a
117
116
118
117
whisper.cpp :
119
118
git clone https://github.com/ggerganov/whisper.cpp.git
@@ -127,7 +126,7 @@ go-llama:
127
126
cd go-llama && git checkout -b build $(GOLLAMA_VERSION ) && git submodule update --init --recursive --depth 1
128
127
129
128
go-llama/libbinding.a : go-llama
130
- $(MAKE ) -C go-llama $( GENERIC_PREFIX ) libbinding.a
129
+ $(MAKE ) -C go-llama BUILD_TYPE= $( BUILD_TYPE ) libbinding.a
131
130
132
131
replace :
133
132
$(GOCMD ) mod edit -replace github.com/go-skynet/go-llama.cpp=$(shell pwd) /go-llama
0 commit comments