From 9fe018675fa0cbb4c3c8f82f46da911cd1653577 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Thu, 6 Jul 2023 10:59:21 -0400 Subject: [PATCH] use `Makefile` for dependency building instead of `go generate` --- .gitignore | 1 + Makefile | 18 ++++++++++++++++++ llama/llama.go | 2 -- llama/llama_metal.go | 3 --- 4 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 34010f85..ef88e17e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ build dist __pycache__ ollama +ggml-metal.metal diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..a4482089 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +default: ollama + +.PHONY: llama +llama: + cmake -S llama -B llama/build -DLLAMA_METAL=on + cmake --build llama/build + +.PHONY: ollama +ollama: llama + go build . + +.PHONY: app +app: ollama + npm run --prefix app package + +clean: + go clean + rm -rf llama/build diff --git a/llama/llama.go b/llama/llama.go index f5bddbdc..c9c9c8fd 100644 --- a/llama/llama.go +++ b/llama/llama.go @@ -20,8 +20,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -//go:generate cmake -S . -B build -//go:generate cmake --build build package llama // #cgo LDFLAGS: -Lbuild -lbinding -lllama -lm -lggml_static -lstdc++ diff --git a/llama/llama_metal.go b/llama/llama_metal.go index 111cc5ff..3758ef9b 100644 --- a/llama/llama_metal.go +++ b/llama/llama_metal.go @@ -1,5 +1,2 @@ //go:build metal package llama - -//go:generate cmake -S . -B build --fresh -DLLAMA_METAL=on -//go:generate cmake --build build