8000 Fix for shared library not found and compile issues in Windows (#848) · kp-forks/llama-cpp-python@7b136bb · GitHub
[go: up one dir, main page]

Skip to content

Commit 7b136bb

Browse files
authored
Fix for shared library not found and compile issues in Windows (abetlen#848)
* fix windows library dll name issue * Updated README.md Windows instructions * Update llama_cpp.py to handle different windows dll file versions
1 parent eefd76f commit 7b136bb

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ Then, call `pip` after setting the variables:
9292
pip install llama-cpp-python
9393
```
9494

95+
If you run into issues where it complains it can't find `'nmake'` `'?'` or CMAKE_C_COMPILER, you can extract w64devkit as [mentioned in llama.cpp repo](https://github.com/ggerganov/llama.cpp#openblas) and add those manually to CMAKE_ARGS before running `pip` install:
96+
```ps
97+
$env:CMAKE_GENERATOR = "MinGW Makefiles"
98+
$env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on -DCMAKE_C_COMPILER=C:/w64devkit/bin/gcc.exe -DCMAKE_CXX_COMPILER=C:/w64devkit/bin/g++.exe"
99+
```
100+
95101
See the above instructions and set `CMAKE_ARGS` to the BLAS backend you want to use.
96102

97103
#### MacOS remarks

llama_cpp/llama_cpp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def _load_shared_library(lib_base_name: str):
4242
elif sys.platform == "win32":
4343
_lib_paths += [
4444
_base_path / f"{lib_base_name}.dll",
45+
_base_path / f"lib{lib_base_name}.dll",
4546
]
4647
else:
4748
raise RuntimeError("Unsupported platform")

0 commit comments

Comments
 (0)
0