ggerganov / llama.cpp

LLM inference in C/C++
MIT License
67.99k stars 9.75k forks source link

Bug: Failing to build using cmake on tag b3912 #9913

Open Martin-HZK opened 1 month ago

Martin-HZK commented 1 month ago

What happened?

I can successfully build llama.cpp using make, but failing to do it using cmake. I tried this on Ubuntu 22.04 LTS and 24.04 LTS on my Intel Core Ultra 9 185H. It seems that is searching the glibc in the wrong path.

Name and Version

$ ./llama-cli --version version: 3912 (edc26566) built with cc (conda-forge gcc 14.2.0-1) 14.2.0 for x86_64-conda-linux-gnu

What operating system are you seeing the problem on?

Linux

Relevant log output

$ cmake --build build --config Release -j 22
[  0%] Generating build details from Git
[  1%] Built target sha1
[  1%] Built target sha256
-- Found Git: /usr/bin/git (found version "2.43.0") 
[  2%] Built target xxhash
[  3%] Building C object ggml/src/CMakeFiles/ggml.dir/ggml-alloc.c.o
[  4%] Building CXX object common/CMakeFiles/build_info.dir/build-info.cpp.o
[  4%] Built target build_info
[  5%] Linking CXX shared library libggml.so
/usr/bin/ld: cannot find /lib64/libpthread.so.0: No such file or directory
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a: No such file or directory
collect2: error: ld returned 1 exit status
gmake[2]: *** [ggml/src/CMakeFiles/ggml.dir/build.make:179: ggml/src/libggml.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1591: ggml/src/CMakeFiles/ggml.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
xiaoran007 commented 1 month ago

I had the same problem. In fact make works fine and cmake doesn't.

JohannesGaessler commented 1 month ago

Are you perhaps just missing packages?

Martin-HZK commented 1 month ago

Are you perhaps just missing packages? Actually, the related libc can be found elsewhere, but not in the lib64. I just installed the Ubuntu24.04 by default image. But in terms of the static library, like libpthread_nonshared.a, I didn't really find it in my GLibc 2.35 version for Ubuntu22.04

rajesh-s commented 1 week ago

Did anyone manage to resolve this? Same problem on RHEL!

rajesh-s commented 4 days ago

@Martin-HZK where is the glibc found in your case?