Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:birdwatcher:machinelearning
ollama
ollama-add-install-targets.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ollama-add-install-targets.patch of Package ollama
diff --git a/llama/Makefile b/llama/Makefile index 70d9049..06c5f13 100644 --- a/llama/Makefile +++ b/llama/Makefile @@ -53,6 +53,17 @@ $(RUNNER_TARGETS): exe dist_exe: @$(MAKE) --no-print-directory -f make/Makefile.ollama $@ +ifeq ($(OS),linux) +INSTALL_TARGETS = $(addprefix install_, $(RUNNER_TARGETS) ollama) + +install_%: + @$(MAKE) --no-print-directory -f make/Makefile.$* install + +install: $(INSTALL_TARGETS) + +.PHONY: install +endif + help-sync apply-patches create-patches sync: @$(MAKE) --no-print-directory -f make/Makefile.sync $@ diff --git a/llama/make/Makefile.ollama b/llama/make/Makefile.ollama index b412048..24aea54 100644 --- a/llama/make/Makefile.ollama +++ b/llama/make/Makefile.ollama @@ -13,6 +13,13 @@ $(OLLAMA_EXE) $(DIST_OLLAMA_EXE): TARGET_CPU_FLAGS=$(CUSTOM_CPU_FLAGS) $(OLLAMA_EXE) $(DIST_OLLAMA_EXE): $(COMMON_SRCS) $(COMMON_HDRS) $(PAYLOADS) $(GO_DEPS) cd .. && GOARCH=$(ARCH) go build -buildmode=pie $(CPU_GOFLAGS) -trimpath $(if $(CUSTOM_CPU_FLAGS),-tags $(subst $(space),$(comma),$(CUSTOM_CPU_FLAGS))) -o $(patsubst ../%,%,$@) . +ifeq ($(OS),linux) +install: exe + install -m 0755 -D $(OLLAMA_EXE) $(DESTDIR)/$(PREFIX)/bin/ollama + +.PHONY: install +endif + .PHONY: ollama dist_ollama exe dist_exe # Handy debugging for make variables diff --git a/llama/make/common-defs.make b/llama/make/common-defs.make index ae36994..e52f5cc 100644 --- a/llama/make/common-defs.make +++ b/llama/make/common-defs.make @@ -37,6 +37,7 @@ else DIST_BASE = ../dist/$(OS)-$(ARCH) RUNNERS_PAYLOAD_DIR = ../build/$(OS)/$(ARCH) DIST_OLLAMA_EXE=$(DIST_BASE)/bin/ollama$(EXE_EXT) + PREFIX ?= /usr endif DIST_LIB_DIR = $(DIST_BASE)/lib/ollama RUNNERS_DIST_DIR = $(DIST_LIB_DIR)/runners diff --git a/llama/make/gpu.make b/llama/make/gpu.make index e2f9fd3..3d625f6 100644 --- a/llama/make/gpu.make +++ b/llama/make/gpu.make @@ -91,6 +91,15 @@ $(RUNNERS_PAYLOAD_DIR)/$(GPU_RUNNER_NAME)$(GPU_RUNNER_EXTRA_VARIANT)/%.gz: $(RUN @-mkdir -p $(dir $@) ${GZIP} --best -c $< > $@ +ifeq ($(OS),linux) +# Install all built runners +install: $(GPU_RUNNER_NAME) + install -D -m 0755 $(RUNNERS_BUILD_DIR)/$(GPU_RUNNER_NAME)$(GPU_RUNNER_EXTRA_VARIANT)/ollama_llama_server$(EXE_EXT) $(DESTDIR)/$(PREFIX)/lib64/ollama/runners/$(GPU_RUNNER_NAME)/ollama_llama_server$(EXE_EXT) + install -D -m 0755 $(BUILD_DIR)/$(SHARED_PREFIX)ggml_$(GPU_RUNNER_NAME).$(SHARED_EXT) $(DESTDIR)/$(PREFIX)/lib64/ollama/runners/$(GPU_RUNNER_NAME)/$(SHARED_PREFIX)ggml_$(GPU_RUNNER_NAME).$(SHARED_EXT) + +.PHONY: install +endif + clean: rm -f $(GPU_RUNNER_OBJS) $(BUILD_RUNNERS) $(DIST_RUNNERS) $(PAYLOAD_RUNNERS)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor