File ollama-lib64-runner-path.patch of Package ollama
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f685b19..9e0c9b06 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,8 +54,8 @@ if(APPLE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
endif()
-set(OLLAMA_BUILD_DIR ${CMAKE_BINARY_DIR}/lib/ollama)
-set(OLLAMA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/ollama/${OLLAMA_RUNNER_DIR})
+set(OLLAMA_BUILD_DIR ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/ollama)
+set(OLLAMA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/ollama)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OLLAMA_BUILD_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${OLLAMA_BUILD_DIR})
diff --git a/ml/backend/ggml/ggml/src/ggml.go b/ml/backend/ggml/ggml/src/ggml.go
index 7e215916..f2e9b40d 100644
--- a/ml/backend/ggml/ggml/src/ggml.go
+++ b/ml/backend/ggml/ggml/src/ggml.go
@@ -65,7 +65,7 @@ var OnceLoad = sync.OnceFunc(func() {
case "windows":
value = filepath.Join(filepath.Dir(exe), "lib", "ollama")
default:
- value = filepath.Join(filepath.Dir(exe), "..", "lib", "ollama")
+ value = filepath.Join(filepath.Dir(exe), "..", "lib64", "ollama")
}
// Avoid potentially loading incompatible GGML libraries
@@ -84,7 +84,7 @@ var OnceLoad = sync.OnceFunc(func() {
continue
}
- if abspath != filepath.Dir(exe) && !strings.Contains(abspath, filepath.FromSlash("lib/ollama")) {
+ if abspath != filepath.Dir(exe) && !strings.Contains(abspath, filepath.FromSlash("lib64/ollama")) {
slog.Debug("skipping path which is not part of ollama", "path", abspath)
continue
}
diff --git a/ml/path.go b/ml/path.go
index ac93af40..042e52a0 100644
--- a/ml/path.go
+++ b/ml/path.go
@@ -28,22 +28,22 @@ var LibOllamaPath string = func() string {
case "windows":
libPath = filepath.Join(filepath.Dir(exe), "lib", "ollama")
case "linux":
- libPath = filepath.Join(filepath.Dir(exe), "..", "lib", "ollama")
+ libPath = filepath.Join(filepath.Dir(exe), "..", "lib64", "ollama")
case "darwin":
libPath = filepath.Dir(exe)
}
- cwd, err := os.Getwd()
- if err != nil {
- return ""
- }
+ //cwd, err := os.Getwd()
+ //if err != nil {
+ // return ""
+ //}
paths := []string{
libPath,
// build paths for development
- filepath.Join(filepath.Dir(exe), "build", "lib", "ollama"),
- filepath.Join(cwd, "build", "lib", "ollama"),
+ //filepath.Join(filepath.Dir(exe), "build", "lib", "ollama"),
+ //filepath.Join(cwd, "build", "lib", "ollama"),
}
for _, p := range paths {