mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-10 07:46:59 +00:00
Add RPATH for CUDA libraries in Linux builds
- Configure CMakeLists.txt to embed RPATH for CUDA library paths - Includes $ORIGIN, CUDA 11.4 paths, and system library paths - Eliminates need for LD_LIBRARY_PATH at runtime - Binary can now find CUDA libraries automatically
This commit is contained in:
@@ -36,6 +36,13 @@ if (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
|
||||
set(CMAKE_INSTALL_RPATH "@loader_path")
|
||||
endif()
|
||||
|
||||
# Set RPATH for Linux to find CUDA libraries at runtime
|
||||
if (UNIX AND NOT APPLE)
|
||||
set(CMAKE_BUILD_RPATH "$ORIGIN:/usr/local/cuda-11.4/lib64:/usr/local/cuda-11.4/targets/x86_64-linux/lib:/usr/lib64:/usr/local/lib64")
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN:/usr/local/cuda-11.4/lib64:/usr/local/cuda-11.4/targets/x86_64-linux/lib:/usr/lib64:/usr/local/lib64")
|
||||
set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
|
||||
endif()
|
||||
|
||||
set(OLLAMA_BUILD_DIR ${CMAKE_BINARY_DIR}/lib/ollama)
|
||||
set(OLLAMA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/ollama)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user