abetlen / abetlen/llama-cpp-python
using `cmake .. -DBUILD_SHARED_LIBS=ON` failed
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 1.4k
- PR merge metrics
- PR metrics pending
Description
```bash
# Build llama.cpp standalone
git clone https://github.com/ggerganov/llama.cpp
mkdir llama.cpp
mkdir build
cd build
cmake .. -DBUILD_SHARED_LIBS=ON
cmake --build . --config Release
# Export path
export LLAMA_CPP_LIB=/path/to/shared/library
# Install llama-cpp-python with LLAMA_BUILD_OFF
CMAKE_ARGS="LLAMA_BUILD=OFF" pip install llama-cpp-python
```
_Originally posted by @abetlen in https://github.com/abetlen/llama-cpp-python/issues/1070#issuecomment-1881737418_
When I want to use an local existed [PR](https://github.com/jart/llama.cpp/tree/sgemm) from llama.cpp to install llama-cpp-python, it faid at build stage. When I use `cmake .. -DBUILD_SHARED_LIBS=ON`to compile, the following error occurs. What is the reason?In addition, what path should the Export path point to? Thank you~~
```/usr/bin/ld: CMakeFiles/test-tokenizer-1-llama.dir/test-tokenizer-1-llama.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.17'
/usr/bin/ld: /lib/aarch64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [tests/CMakeFiles/test-tokenizer-1-llama.dir/build.make:117: bin/test-tokenizer-1-llama] Error 1
make[1]: *** [CMakeFiles/Makefile2:1912: tests/CMakeFiles/test-tokenizer-1-llama.dir/all] Error 2```
Contributor guide
Assessment
This issue has not been assessed yet.