Open Karthik-Dulam opened 1 day ago
Here is some help brought to you by chatGPT!: The error you're encountering when attempting to build the llama-cpp-python package indicates that the build process is failing due to missing dependencies related to OpenMP (libgomp.so.1) and possible issues with the build environment configuration. Here's a step-by-step guide to resolve it:
The error mentions missing libgomp.so.1, which is part of the GNU OpenMP implementation. Install it using the following command:
sudo apt update sudo apt install libgomp1
Ensure you have all necessary build tools and libraries installed:
sudo apt install build-essential cmake ninja-build libomp-dev
Ensure the GCC and G++ compilers are compatible. llama-cpp-python may require a version that supports the needed features (you have GCC 11.4.0, which should be fine). If needed, update GCC:
sudo apt install gcc g++
Using a virtual environment ensures a clean Python environment:
python3 -m venv llama-env source llama-env/bin/activate
Some Python environments (e.g., Conda) override system paths, leading to errors. Set the environment variables to use system-installed compilers:
export CC=/usr/bin/gcc export CXX=/usr/bin/g++ export LDFLAGS="-L/usr/lib/x86_64-linux-gnu" export LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"
Reinstall the package and its dependencies in the virtual environment:
pip install -r requirements.txt
If pip continues to fail, manually build and install the package:
git clone https://github.com/abetlen/llama-cpp-python.git cd llama-cpp-python pip install .
I ran into a similar issue. Make sure gcc and g++ are installed.
You might get some ideas from one of my personal scripts for ways you can make this work. I know you need to have nvcc in the PATH.
no joy on win 11 I've installed vs_BuildTools
no joy cmake is installed
I tried the direct build of cpp as well.
git clone https://github.com/abetlen/llama-cpp-python.git cd llama-cpp-python pip install .
It failed too.
CMake configuration failed
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for llama_cpp_python
Failed to build llama_cpp_python
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (llama_cpp_python)
Aside from dumping windows(a good idea!) what other things can I try?
thank you!
Yeah I don't use windows and I don't think windows will work with the program sorry!
Try windows subsystem for linux
@synth-mania That is what I use!
OS: 22.04.1-Ubuntu Python: Python 3.12.2
Build fails for llama-cpp-python