File ollama-lib64-runner-path.patch of Package ollama
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b3b5438a..0e2d1ae8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,8 +36,8 @@ if (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
set(CMAKE_INSTALL_RPATH "@loader_path")
endif()
-set(OLLAMA_BUILD_DIR ${CMAKE_BINARY_DIR}/lib/ollama)
-set(OLLAMA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/ollama)
+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/discover/path.go b/discover/path.go
index 68e63009..e3b68209 100644
--- a/discover/path.go
+++ b/discover/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 {
diff --git a/ml/backend/ggml/ggml/src/ggml.go b/ml/backend/ggml/ggml/src/ggml.go
index 91f1f1ad..f17838e5 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
}