[PR #13469] [MERGED] fix: define GGML_VERSION variables for proper SOVERSION expansion #40095

Closed
opened 2026-04-23 01:05:16 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13469
Author: @nathannewyen
Created: 12/14/2025
Status: Merged
Merged: 12/15/2025
Merged by: @dhiltgen

Base: mainHead: fix/ggml-soversion


📝 Commits (1)

  • f7dbcf3 fix: define GGML_VERSION variables for proper SOVERSION expansion

📊 Changes

1 file changed (+7 additions, -0 deletions)

View changed files

📝 CMakeLists.txt (+7 -0)

📄 Description

Summary

Fixes the issue where libggml-base.so was being installed with a literal "SOVERSION" suffix instead of the actual version number.

Before: libggml-base.so.SOVERSION (broken)
After: libggml-base.so.0 (correct)

Problem

The ggml/src/CMakeLists.txt uses ${GGML_VERSION_MAJOR} for the shared library SOVERSION property:

set_target_properties(ggml-base PROPERTIES
    VERSION ${GGML_VERSION}
    SOVERSION ${GGML_VERSION_MAJOR}
)

However, ollama's CMakeLists.txt directly includes the ggml/src subdirectory without the parent CMakeLists.txt that defines these variables in the upstream ggml project.

Since GGML_VERSION_MAJOR was undefined, CMake used an empty/literal string, resulting in the malformed library name.

Solution

Added the required GGML_VERSION variables before including the ggml subdirectory:

set(GGML_VERSION_MAJOR 0)
set(GGML_VERSION_MINOR 0)
set(GGML_VERSION_PATCH 0)
set(GGML_VERSION "${GGML_VERSION_MAJOR}.${GGML_VERSION_MINOR}.${GGML_VERSION_PATCH}")

Test plan

  • Go tests pass
  • Linux build produces correctly named library files (needs CI verification)

Fixes #13436


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/13469 **Author:** [@nathannewyen](https://github.com/nathannewyen) **Created:** 12/14/2025 **Status:** ✅ Merged **Merged:** 12/15/2025 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `fix/ggml-soversion` --- ### 📝 Commits (1) - [`f7dbcf3`](https://github.com/ollama/ollama/commit/f7dbcf3ec3dea7e9c90485808dcb99fd9206313d) fix: define GGML_VERSION variables for proper SOVERSION expansion ### 📊 Changes **1 file changed** (+7 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+7 -0) </details> ### 📄 Description ## Summary Fixes the issue where `libggml-base.so` was being installed with a literal "SOVERSION" suffix instead of the actual version number. **Before:** `libggml-base.so.SOVERSION` (broken) **After:** `libggml-base.so.0` (correct) ## Problem The `ggml/src/CMakeLists.txt` uses `${GGML_VERSION_MAJOR}` for the shared library SOVERSION property: ```cmake set_target_properties(ggml-base PROPERTIES VERSION ${GGML_VERSION} SOVERSION ${GGML_VERSION_MAJOR} ) ``` However, ollama's `CMakeLists.txt` directly includes the `ggml/src` subdirectory without the parent CMakeLists.txt that defines these variables in the upstream ggml project. Since `GGML_VERSION_MAJOR` was undefined, CMake used an empty/literal string, resulting in the malformed library name. ## Solution Added the required GGML_VERSION variables before including the ggml subdirectory: ```cmake set(GGML_VERSION_MAJOR 0) set(GGML_VERSION_MINOR 0) set(GGML_VERSION_PATCH 0) set(GGML_VERSION "${GGML_VERSION_MAJOR}.${GGML_VERSION_MINOR}.${GGML_VERSION_PATCH}") ``` ## Test plan - [x] Go tests pass - [ ] Linux build produces correctly named library files (needs CI verification) Fixes #13436 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 01:05:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#40095