llm
                                
                                 llm copied to clipboard
                                
                                    llm copied to clipboard
                            
                            
                            
                        broken build on fedora
The build is broken on fedora 37.
full logs : https://gist.github.com/sylvain-reynaud/fe73ccc7edad1f4f98688cb48b1f101c
--- stderr
  ggml/ggml.h:177:10: fatal error: 'stddef.h' file not found
  thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("ggml/ggml.h:177:10: fatal error: 'stddef.h' file not found\n")', ggml-raw/build.rs:31:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Fix
On Fedora, to avoid build errors due to the missing stddef.h file, you may need to install the following packages:
sudo dnf groupinstall "Development Tools" "Development Libraries"
Then build with CPATH set to the location of the gcc headers :
CPATH="/usr/lib/gcc/x86_64-redhat-linux/12/include/" cargo build --release
Tested on my laptop fedora 37 and fedora:latest docker image.
That's odd... Of all the possible distros, I happen to be on Fedora 37! 🤣
The thing is, I had to do nothing of the sort. I probably already had the C compiler + headers from other projects, but I definitely didn't have to set up CPATH, the C code builds for me just fine.
Can you try the same fix, minus the CPATH to see whether it works?
@setzer22 ahah, sure, I had tested it:
docker run -it fedora bash
Then
ls /usr/lib/        #no gcc
dnf groupinstall "Development Tools" "Development Libraries"
ls /usr/lib/gcc/x86_64-redhat-linux/12/include/        #installed
git clone https://github.com/sylvain-reynaud/llama-rs
cd llama-rs/
curl https://sh.rustup.rs -sSf | sh
source "$HOME/.cargo/env"
cargo build --release        #still fails
CPATH="/usr/lib/gcc/x86_64-redhat-linux/12/include/" cargo build --release        #success
thank you for your fast response btw
I just tried by opening a new bash in the previous container, cargo clean and cargo build --release. It is still broken.
Thanks again! Will try to investigate a bit more why exactly the CPATH isn't needed on my system 🤔
Could this have anything to do with the fact I have llvm and clang installed on my system?
@setzer22 I'm sorry I have no idea. I may take a look this evening.
Yeah, I just realised that we need llvm/clang for bindgen.
Should be solved by #73.