Cannot install current version of llama-cpp-python 0.3.16 on Windows (backend independent)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 領域
- backend, build-system
研究方向
這個錯誤是使用 MinGW 的 Windows 上與 OpenMP 符號(GOMP_barrier、omp_get_thread_num)有關的連結器問題。查看 vendor/llama.cpp/ggml/src/CMakeLists.txt 中的 CMake 設定以及 llama-cpp-python 的建置腳本。檢查 OpenMP 的連結方式,尤其是 Windows 上針對 MinGW 的連結方式。修正可能需要調整 CMake 旗標或連結器旗標,以包含正確的 OpenMP 程式庫。變更後,使用相同的環境變數測試建置。
由索引模型根據 Issue 內容生成。
描述
Prerequisites
Please answer the following questions for yourself before submitting an issue.
- I am running the latest code (
Version 0.3.16). - I carefully followed the README.md.
- I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
- I reviewed the Discussions, and have a new bug or useful enhancement to share.
Expected Behavior
When installing llama-cpp-python with the respective environment variables mentioned in the docs set, the installation of the dependency should succeed.
Current Behavior
The installation failed. See the error log below.
Environment and Context
Environment variables:
CMAKE_GENERATOR=MinGW MakefilesCMAKE_ARGS=-DGGML_OPENBLAS=on -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DGGML_OPENBLAS=on -DCMAKE_C_COMPILER=E:/Development/w64devkit/bin/gcc.exe -DCMAKE_CXX_COMPILER=E:/Development/w64devkit/bin/g++.exe
I also tried this with Vulkan and ROCm backend and got exactly the same error.
System and dependency information:
- AMD Ryzen 7 7800X3D
- AMD 7900 XTX
- Operating System:
Windows - Python version:
3.13.6 - w64devkit version:
2.4.0 - make version:
GNU Make 4.4.1 Built for x86_64-w64-mingw32 - g++ version:
g++.exe (GCC) 15.2.0
Failure Information (for bugs)
The installation failed (see error log below). The error stays the same no matter what backend (OpenBLAS, Vulkan, ROCm) is chosen
Steps to Reproduce
- Set the environment variables as mentioned above
- Install the dependency via
pipor any other package manager (I useuv sync) - See the failing error message
Failure Logs
[ 38%] Linking CXX shared library ..\..\..\..\bin\ggml-cpu.dll
cd /d C:\Users\Tobias\AppData\Local\Temp\tmppea8rsz0\build\vendor\llama.cpp\ggml\src &&
C:\Users\Tobias\AppData\Local\uv\cache\builds-v0\.tmpqQBqx0\Lib\site-packages\cmake\data\bin\cmake.exe -E
cmake_link_script CMakeFiles\ggml-cpu.dir\link.txt --verbose=1
C:\Users\Tobias\AppData\Local\uv\cache\builds-v0\.tmpqQBqx0\Lib\site-packages\cmake\data\bin\cmake.exe -E rm -f
CMakeFiles\ggml-cpu.dir/objects.a
E:\Development\w64devkit\bin\ar.exe qc CMakeFiles\ggml-cpu.dir/objects.a @CMakeFiles\ggml-cpu.dir\objects1.rsp
E:\Development\w64devkit\bin\g++.exe -O3 -DNDEBUG -shared -o ..\..\..\..\bin\ggml-cpu.dll
-Wl,--out-implib,libggml-cpu.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive
CMakeFiles\ggml-cpu.dir/objects.a -Wl,--no-whole-archive @CMakeFiles\ggml-cpu.dir\linkLibs.rsp
make[2]: Leaving directory 'C:/Users/Tobias/AppData/Local/Temp/tmppea8rsz0/build'
make[1]: Leaving directory 'C:/Users/Tobias/AppData/Local/Temp/tmppea8rsz0/build'
CMake Warning (dev) at CMakeLists.txt:21 (install):
Target ggml has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.
Call Stack (most recent call first):
CMakeLists.txt:109 (llama_cpp_python_install_target)
This warning is for project developers. Use -Wno-dev to suppress it.
E:\Development\w64devkit\bin/ld.exe: CMakeFiles\ggml-cpu.dir/objects.a(ggml-cpu.c.obj):ggml-cpu.c:(.text+0x31df):
undefined reference to `GOMP_barrier'
E:\Development\w64devkit\bin/ld.exe: CMakeFiles\ggml-cpu.dir/objects.a(ggml-cpu.c.obj):ggml-cpu.c:(.text+0x44fd):
undefined reference to `GOMP_barrier'
E:\Development\w64devkit\bin/ld.exe: CMakeFiles\ggml-cpu.dir/objects.a(ggml-cpu.c.obj):ggml-cpu.c:(.text+0x4587):
undefined reference to `GOMP_barrier'
E:\Development\w64devkit\bin/ld.exe: CMakeFiles\ggml-cpu.dir/objects.a(ggml-cpu.c.obj):ggml-cpu.c:(.text+0x4f95):
undefined reference to `GOMP_barrier'
E:\Development\w64devkit\bin/ld.exe: CMakeFiles\ggml-cpu.dir/objects.a(ggml-cpu.c.obj):ggml-cpu.c:(.text+0x5aad):
undefined reference to `GOMP_single_start'
E:\Development\w64devkit\bin/ld.exe: CMakeFiles\ggml-cpu.dir/objects.a(ggml-cpu.c.obj):ggml-cpu.c:(.text+0x5ab6):
undefined reference to `GOMP_barrier'
E:\Development\w64devkit\bin/ld.exe: CMakeFiles\ggml-cpu.dir/objects.a(ggml-cpu.c.obj):ggml-cpu.c:(.text+0x5abb):
undefined reference to `omp_get_thread_num'
E:\Development\w64devkit\bin/ld.exe: CMakeFiles\ggml-cpu.dir/objects.a(ggml-cpu.c.obj):ggml-cpu.c:(.text+0x5ae1):
undefined reference to `omp_get_num_threads'
E:\Development\w64devkit\bin/ld.exe: CMakeFiles\ggml-cpu.dir/objects.a(ggml-cpu.c.obj):ggml-cpu.c:(.text+0x6b40):
undefined reference to `GOMP_parallel'
E:\Development\w64devkit\bin/ld.exe: CMakeFiles\ggml-cpu.dir/objects.a(ggml-cpu.c.obj):ggml-cpu.c:(.text+0x90c):
undefined reference to `GOMP_barrier'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [vendor\llama.cpp\ggml\src\CMakeFiles\ggml-cpu.dir\build.make:341: bin/ggml-cpu.dll] Error 1
make[1]: *** [CMakeFiles\Makefile2:350: vendor/llama.cpp/ggml/src/CMakeFiles/ggml-cpu.dir/all] Error 2
make: *** [Makefile:135: all] Error 2
*** CMake build failed
hint: This usually indicates a problem with the package or the build environment.
- 主要語言
- Python
- 星號
- 10.7k
- 分支
- 1.5k
- 平均合併
- 1 小時 40 分鐘
- 30 天內合併 PR
- 5
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
abetlen/llama-cpp-python 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
abetlen/llama-cpp-python#2424 ·
維護者通常 1 天內回覆
-
Seven llama_sampler_init_* bindings admit keyword arguments that the ctypes function object silently drops可能已有人在做 @Belal0066 於 59 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 88/100
abetlen/llama-cpp-python#2371 ·
維護者通常 1 天內回覆
-
uv add llama-cpp-python wheels fails for versions above 0.3.30可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 65/100
abetlen/llama-cpp-python#2352 · 1 則留言 · 3 個 reaction ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
abetlen/llama-cpp-python#2314 ·
維護者通常 1 天內回覆
-
Llama.embed() calls LlamaBatch.add_sequence with old 3-arg signature; missing logits_array可能重新可做 @lxcxjxhx 於 136 天前認領,目前沒有進行中的 PR。 未關閉
難度 2/5 1-3 小時 新手友好度 65/100
abetlen/llama-cpp-python#2211 · 2 則留言 ·
維護者通常 1 天內回覆
查看 abetlen/llama-cpp-python 的全部 Issue
相似的 Issue
-
Bug IronPython Python 3
難度 2/5 1-3 小時 新手友好度 72/100
pyrevitlabs/pyRevit#4184 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 74/100
jqueryscript/awesome-claude-code#1009 ·
-
tests
難度 2/5 1-3 小時 新手友好度 66/100
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 1/5 1-3 小時 新手友好度 74/100