Repository: abetlen/llama-cpp-python

Issue #1662: Wheel build fails building version 0.2.86
Created: 2024-08-07T08:32:01Z
Prerequisites
Please answer the following questions for yourself before submitting an issue.

 I am running the latest code. Development is very rapid so there are no tagged versions as of now.
 I carefully followed the README.md.
 I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
 I reviewed the Discussions, and have a new bug or useful enhancement to share.

Expected Behavior
Wheel in version 0.2.86 builds properly, just like 0.2.85 and all other versions before
Current Behavior
Wheel doesn't build and fails
Environment and Context

Physical hardware:

Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         39 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  8
  On-line CPU(s) list:   0-7
Vendor ID:               GenuineIntel
  Model name:            Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    CPU family:          6
    Model:               142
    Thread(s) per core:  2
    Core(s) per socket:  4
    Socket(s):           1
    Stepping:            10
    BogoMIPS:            3984.00
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid pni pclmulqdq 
                         vmx ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi ept vpid ept_ad fsgsbase bmi
                         1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves md_clear flush_l1d arch_capabilities
Virtualization features:
  Virtualization:        VT-x
  Hypervisor vendor:     Microsoft
  Virtualization type:   full
Caches (sum of all):
  L1d:                   128 KiB (4 instances)
  L1i:                   128 KiB (4 instances)
  L2:                    1 MiB (4 instances)
  L3:                    8 MiB (1 instance)
Vulnerabilities:
  Gather data sampling:  Unknown: Dependent on hypervisor status
  Itlb multihit:         KVM: Mitigation: VMX disabled
  L1tf:                  Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
  Mds:                   Mitigation; Clear CPU buffers; SMT Host state unknown
  Meltdown:              Mitigation; PTI
  Mmio stale data:       Mitigation; Clear CPU buffers; SMT Host state unknown
  Retbleed:              Mitigation; IBRS
  Spec rstack overflow:  Not affected
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl and seccomp
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; IBRS, IBPB conditional, STIBP conditional, RSB filling, PBRSB-eIBRS Not affected
  Srbds:                 Unknown: Dependent on hypervisor status
  Tsx async abort:       Not affected


Operating System:

5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

SDK versions:

$ python3 --version
Python 3.10.12
$ make --version
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ g++ --version
g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Failure Information (for bugs)
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Run:
GGML_CCACHE=OFF CMAKE_ARGS="-DLLAMA_CUBLAS=off" FORCE_CMAKE=1 pip install  llama-cpp-python --no-cache-dir

Failure Logs
Collecting llama-cpp-python
  Downloading llama_cpp_python-0.2.86.tar.gz (49.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.3/49.3 MB 23.6 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting typing-extensions>=4.5.0
  Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Collecting diskcache>=5.6.1
  Downloading diskcache-5.6.3-py3-none-any.whl (45 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.5/45.5 KB 258.3 MB/s eta 0:00:00
Collecting numpy>=1.20.0
  Downloading numpy-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19.5/19.5 MB 23.6 MB/s eta 0:00:00
Collecting jinja2>=2.11.3
  Downloading jinja2-3.1.4-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.3/133.3 KB 48.4 MB/s eta 0:00:00
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Building wheels for collected packages: llama-cpp-python
  Building wheel for llama-cpp-python (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for llama-cpp-python (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [56 lines of output]
      *** scikit-build-core 0.10.1 using CMake 3.22.1 (wheel)
      *** Configuring CMake...
      loading initial cache file /tmp/tmphykwn8um/build/CMakeInit.txt
      -- The C compiler identification is GNU 11.4.0
      -- The CXX compiler identification is GNU 11.4.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/x86_64-linux-gnu-gcc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/x86_64-linux-gnu-g++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found Git: /usr/bin/git (found version "2.34.1")
      -- Looking for pthread.h
      -- Looking for pthread.h - found
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
      -- Found Threads: TRUE
      -- Found OpenMP_C: -fopenmp (found version "4.5")
      -- Found OpenMP_CXX: -fopenmp (found version "4.5")
      -- Found OpenMP: TRUE (found version "4.5")
      -- OpenMP found
      -- Using llamafile
      -- ccache found, compilation results will be cached. Disable with GGML_CCACHE=OFF.
      -- CMAKE_SYSTEM_PROCESSOR: x86_64
      -- x86 detected
      INSTALL TARGETS - target llama has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.
      INSTALL TARGETS - target llama has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.
      INSTALL TARGETS - target ggml has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.
      INSTALL TARGETS - target ggml has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /tmp/tmphykwn8um/build
      *** Building project with Ninja...
      [1/30] ccache /usr/bin/x86_64-linux-gnu-gcc -DGGML_BUILD -DGGML_SCHED_MAX_COPIES=4 -DGGML_SHARED -DGGML_USE_LLAMAFILE -DGGML_USE_OPENMP -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -Dggml_EXPORTS -I/tmp/pip-install-sviqz_ec/llama-cpp
-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/../include -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/. -O3 -DNDEBUG -fPIC -Wshadow -Wstrict-prototy
pes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int -Werror=implicit-function-declaration -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wdouble-promotion -march=native -fopenmp -std=gnu11 -MD -MT vendor/ll
ama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml-alloc.c.o -MF vendor/llama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml-alloc.c.o.d -o vendor/llama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml-alloc.c.o -c /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/ggml-alloc.c
      [2/30] ccache /usr/bin/x86_64-linux-gnu-gcc -DGGML_BUILD -DGGML_SCHED_MAX_COPIES=4 -DGGML_SHARED -DGGML_USE_LLAMAFILE -DGGML_USE_OPENMP -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -Dggml_EXPORTS -I/tmp/pip-install-sviqz_ec/llama-cpp
-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/../include -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/. -O3 -DNDEBUG -fPIC -Wshadow -Wstrict-prototy
pes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int -Werror=implicit-function-declaration -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wdouble-promotion -march=native -fopenmp -std=gnu11 -MD -MT vendor/ll
ama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml-aarch64.c.o -MF vendor/llama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml-aarch64.c.o.d -o vendor/llama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml-aarch64.c.o -c /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/ggml-aarch64.c
      [3/30] ccache /usr/bin/x86_64-linux-gnu-gcc -DGGML_BUILD -DGGML_SCHED_MAX_COPIES=4 -DGGML_SHARED -DGGML_USE_LLAMAFILE -DGGML_USE_OPENMP -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -Dggml_EXPORTS -I/tmp/pip-install-sviqz_ec/llama-cpp
-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/../include -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/. -O3 -DNDEBUG -fPIC -Wshadow -Wstrict-prototy
pes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int -Werror=implicit-function-declaration -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wdouble-promotion -march=native -fopenmp -std=gnu11 -MD -MT vendor/ll
ama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml-backend.c.o -MF vendor/llama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml-backend.c.o.d -o vendor/llama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml-backend.c.o -c /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/ggml-backend.c
      [4/30] cd /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp && /usr/bin/cmake -DMSVC= -DCMAKE_C_COMPILER_VERSION=11.4.0 -DCMAKE_C_COMPILER_ID=GNU -DCMAKE_VS_PLATFORM_NAME= -DCMAKE_C_COMPILER=/usr/bin/x86_64-linux-gnu-gcc -P /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/common/cmake/build-info-gen-cpp.cmake
      FAILED: /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/common/build-info.cpp
      cd /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp && /usr/bin/cmake -DMSVC= -DCMAKE_C_COMPILER_VERSION=11.4.0 -DCMAKE_C_COMPILER_ID=GNU -DCMAKE_VS_PLATFORM_NAME= -DCMAKE_C_COMPILER=/usr/bin/x86_64-linux-gnu-gcc -P /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/common/cmake/build-info-gen-cpp.cmake
      CMake Error: Error processing file: /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/common/cmake/build-info-gen-cpp.cmake
      [5/30] ccache /usr/bin/x86_64-linux-gnu-g++ -DLLAMA_BUILD -DLLAMA_SHARED -Dllama_EXPORTS -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/. -I/tmp/pip-install-sviqz_ec/llam
a-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/../include -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/../include -O3 -DNDEBUG -fPIC -MD -MT vendor/l
lama.cpp/src/CMakeFiles/llama.dir/llama-grammar.cpp.o -MF vendor/llama.cpp/src/CMakeFiles/llama.dir/llama-grammar.cpp.o.d -o vendor/llama.cpp/src/CMakeFiles/llama.dir/llama-grammar.cpp.o -c /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/llama-grammar.cpp
      [6/30] ccache /usr/bin/x86_64-linux-gnu-g++ -DLLAMA_BUILD -DLLAMA_SHARED -Dllama_EXPORTS -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/. -I/tmp/pip-install-sviqz_ec/llam
a-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/../include -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/../include -O3 -DNDEBUG -fPIC -MD -MT vendor/l
lama.cpp/src/CMakeFiles/llama.dir/llama-sampling.cpp.o -MF vendor/llama.cpp/src/CMakeFiles/llama.dir/llama-sampling.cpp.o.d -o vendor/llama.cpp/src/CMakeFiles/llama.dir/llama-sampling.cpp.o -c /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/llama-sampling.cpp
      [7/30] ccache /usr/bin/x86_64-linux-gnu-g++ -DGGML_BUILD -DGGML_SCHED_MAX_COPIES=4 -DGGML_SHARED -DGGML_USE_LLAMAFILE -DGGML_USE_OPENMP -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -Dggml_EXPORTS -I/tmp/pip-install-sviqz_ec/llama-cpp
-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/../include -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/. -O3 -DNDEBUG -fPIC -Wmissing-declarations -W
missing-noreturn -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-array-bounds -Wno-format-truncation -Wextra-semi -march=native -fopenmp -std=gnu++11 -MD -MT vendor/llama.cpp/ggml/src/CMakeFiles/ggml.dir/llamafile
/sgemm.cpp.o -MF vendor/llama.cpp/ggml/src/CMakeFiles/ggml.dir/llamafile/sgemm.cpp.o.d -o vendor/llama.cpp/ggml/src/CMakeFiles/ggml.dir/llamafile/sgemm.cpp.o -c /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/llamafile/sgemm.cpp
      [8/30] ccache /usr/bin/x86_64-linux-gnu-g++ -DLLAMA_BUILD -DLLAMA_SHARED -Dllama_EXPORTS -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/. -I/tmp/pip-install-sviqz_ec/llam
a-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/../include -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/../include -O3 -DNDEBUG -fPIC -MD -MT vendor/l
lama.cpp/src/CMakeFiles/llama.dir/llama-vocab.cpp.o -MF vendor/llama.cpp/src/CMakeFiles/llama.dir/llama-vocab.cpp.o.d -o vendor/llama.cpp/src/CMakeFiles/llama.dir/llama-vocab.cpp.o -c /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/llama-vocab.cpp
      [9/30] ccache /usr/bin/x86_64-linux-gnu-gcc -DGGML_BUILD -DGGML_SCHED_MAX_COPIES=4 -DGGML_SHARED -DGGML_USE_LLAMAFILE -DGGML_USE_OPENMP -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -Dggml_EXPORTS -I/tmp/pip-install-sviqz_ec/llama-cpp
-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/../include -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/. -O3 -DNDEBUG -fPIC -Wshadow -Wstrict-prototy
pes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int -Werror=implicit-function-declaration -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wdouble-promotion -march=native -fopenmp -std=gnu11 -MD -MT vendor/ll
ama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml-quants.c.o -MF vendor/llama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml-quants.c.o.d -o vendor/llama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml-quants.c.o -c /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/ggml-quants.c
      [10/30] ccache /usr/bin/x86_64-linux-gnu-gcc -DGGML_BUILD -DGGML_SCHED_MAX_COPIES=4 -DGGML_SHARED -DGGML_USE_LLAMAFILE -DGGML_USE_OPENMP -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -Dggml_EXPORTS -I/tmp/pip-install-sviqz_ec/llama-cp
p-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/../include -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/. -O3 -DNDEBUG -fPIC -Wshadow -Wstrict-protot
ypes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int -Werror=implicit-function-declaration -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wdouble-promotion -march=native -fopenmp -std=gnu11 -MD -MT vendor/l
lama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml.c.o -MF vendor/llama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml.c.o.d -o vendor/llama.cpp/ggml/src/CMakeFiles/ggml.dir/ggml.c.o -c /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/ggml.c
      [11/30] ccache /usr/bin/x86_64-linux-gnu-g++ -DLLAMA_BUILD -DLLAMA_SHARED -Dllama_EXPORTS -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/. -I/tmp/pip-install-sviqz_ec/lla
ma-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/../include -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/../include -O3 -DNDEBUG -fPIC -MD -MT vendor/
llama.cpp/src/CMakeFiles/llama.dir/unicode.cpp.o -MF vendor/llama.cpp/src/CMakeFiles/llama.dir/unicode.cpp.o.d -o vendor/llama.cpp/src/CMakeFiles/llama.dir/unicode.cpp.o -c /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/unicode.cpp
      [12/30] ccache /usr/bin/x86_64-linux-gnu-g++ -DLLAMA_BUILD -DLLAMA_SHARED -Dllama_EXPORTS -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/. -I/tmp/pip-install-sviqz_ec/lla
ma-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/../include -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/../include -O3 -DNDEBUG -fPIC -MD -MT vendor/
llama.cpp/src/CMakeFiles/llama.dir/unicode-data.cpp.o -MF vendor/llama.cpp/src/CMakeFiles/llama.dir/unicode-data.cpp.o.d -o vendor/llama.cpp/src/CMakeFiles/llama.dir/unicode-data.cpp.o -c /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/unicode-data.cpp
      [13/30] ccache /usr/bin/x86_64-linux-gnu-g++ -DLLAMA_BUILD -DLLAMA_SHARED -Dllama_EXPORTS -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/. -I/tmp/pip-install-sviqz_ec/lla
ma-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/../include -I/tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/ggml/src/../include -O3 -DNDEBUG -fPIC -MD -MT vendor/
llama.cpp/src/CMakeFiles/llama.dir/llama.cpp.o -MF vendor/llama.cpp/src/CMakeFiles/llama.dir/llama.cpp.o.d -o vendor/llama.cpp/src/CMakeFiles/llama.dir/llama.cpp.o -c /tmp/pip-install-sviqz_ec/llama-cpp-python_53056a2aa3cc45fabd3f645b0c2c9593/vendor/llama.cpp/src/llama.cpp
      ninja: build stopped: subcommand failed.

      *** CMake build 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: Could not build wheels for llama-cpp-python, which is required to install pyproject.toml-based projects

Duplicate issue #1663: Could not build the wheels for 0.2.86 on Mac Silicon
Created: 2024-08-07T08:36:14Z
Prerequisites
Please answer the following questions for yourself before submitting an issue.

[ x ] I am running the latest code. Development is very rapid so there are no tagged versions as of now.
[ x ] I carefully followed the README.md.
[ x ] I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
[ x ] I reviewed the Discussions, and have a new bug or useful enhancement to share.

Expected Behavior
Install llama-cpp-python 0.2.86
Current Behavior
Environment and Context
(llama-cpp-python) ~/Documents/CODING/models
CMAKE_ARGS="-DGGML_METAL=on" pip install llama-cpp-python --upgrade --force-reinstall --no-cache-dir
Collecting llama-cpp-python
Downloading llama_cpp_python-0.2.86.tar.gz (49.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.3/49.3 MB 22.1 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Collecting typing-extensions>=4.5.0 (from llama-cpp-python)
Downloading typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Collecting numpy>=1.20.0 (from llama-cpp-python)
Downloading numpy-2.0.1-cp312-cp312-macosx_14_0_arm64.whl.metadata (60 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.9/60.9 kB 36.2 MB/s eta 0:00:00
Collecting diskcache>=5.6.1 (from llama-cpp-python)
Downloading diskcache-5.6.3-py3-none-any.whl.metadata (20 kB)
Collecting jinja2>=2.11.3 (from llama-cpp-python)
Downloading jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
Collecting MarkupSafe>=2.0 (from jinja2>=2.11.3->llama-cpp-python)
Downloading MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl.metadata (3.0 kB)
Downloading diskcache-5.6.3-py3-none-any.whl (45 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.5/45.5 kB 326.7 MB/s eta 0:00:00
Downloading jinja2-3.1.4-py3-none-any.whl (133 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.3/133.3 kB 48.2 MB/s eta 0:00:00
Downloading numpy-2.0.1-cp312-cp312-macosx_14_0_arm64.whl (5.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.0/5.0 MB 31.5 MB/s eta 0:00:00
Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Downloading MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl (18 kB)
Building wheels for collected packages: llama-cpp-python
Building wheel for llama-cpp-python (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for llama-cpp-python (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [83 lines of output]
*** scikit-build-core 0.10.1 using CMake 3.30.2 (wheel)
*** Configuring CMake...
loading initial cache file /var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/tmpjbiz25qi/build/CMakeInit.txt
-- The C compiler identification is AppleClang 15.0.0.15000309
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.39.3 (Apple Git-146)")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Accelerate framework found
-- Metal framework found
-- The ASM compiler identification is AppleClang
-- Found assembler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
CMake Warning at vendor/llama.cpp/ggml/src/CMakeLists.txt:167 (message):
OpenMP not found
  -- Looking for dgemm_
  -- Looking for dgemm_ - found
  -- Found BLAS: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/System/Library/Frameworks/Accelerate.framework
  -- BLAS found, Libraries: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/System/Library/Frameworks/Accelerate.framework
  -- BLAS found, Includes:
  -- Using llamafile
  -- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF
  -- CMAKE_SYSTEM_PROCESSOR: arm64
  -- ARM detected
  -- Performing Test COMPILER_SUPPORTS_FP16_FORMAT_I3E
  -- Performing Test COMPILER_SUPPORTS_FP16_FORMAT_I3E - Failed
  CMake Warning (dev) at CMakeLists.txt:9 (install):
    Target llama has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.
  Call Stack (most recent call first):
    CMakeLists.txt:73 (llama_cpp_python_install_target)
  This warning is for project developers.  Use -Wno-dev to suppress it.
  
  CMake Warning (dev) at CMakeLists.txt:17 (install):
    Target llama has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.
  Call Stack (most recent call first):
    CMakeLists.txt:73 (llama_cpp_python_install_target)
  This warning is for project developers.  Use -Wno-dev to suppress it.
  
  CMake Warning (dev) at CMakeLists.txt:9 (install):
    Target ggml has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.
  Call Stack (most recent call first):
    CMakeLists.txt:74 (llama_cpp_python_install_target)
  This warning is for project developers.  Use -Wno-dev to suppress it.
  
  CMake Warning (dev) at CMakeLists.txt:17 (install):
    Target ggml has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.
  Call Stack (most recent call first):
    CMakeLists.txt:74 (llama_cpp_python_install_target)
  This warning is for project developers.  Use -Wno-dev to suppress it.
  
  -- Configuring done (0.7s)
  -- Generating done (0.0s)
  -- Build files have been written to: /var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/tmpjbiz25qi/build
  *** Building project with Ninja...
  Change Dir: '/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/tmpjbiz25qi/build'
  
  Run Build Command(s): /private/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/pip-build-env-ylemwrpn/normal/lib/python3.12/site-packages/ninja/data/bin/ninja -v
  [1/34] cd /private/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/pip-install-l07p5mxc/llama-cpp-python_f9d6911d530f4f4988c31d6dcbf10c06/vendor/llama.cpp && /private/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/pip-build-env-ylemwrpn/normal/lib/python3.12/site-packages/cmake/data/bin/cmake -DMSVC= -DCMAKE_C_COMPILER_VERSION=15.0.0.15000309 -DCMAKE_C_COMPILER_ID=AppleClang -DCMAKE_VS_PLATFORM_NAME= -DCMAKE_C_COMPILER=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -P /private/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/pip-install-l07p5mxc/llama-cpp-python_f9d6911d530f4f4988c31d6dcbf10c06/vendor/llama.cpp/common/cmake/build-info-gen-cpp.cmake
  FAILED: /private/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/pip-install-l07p5mxc/llama-cpp-python_f9d6911d530f4f4988c31d6dcbf10c06/vendor/llama.cpp/common/build-info.cpp
  cd /private/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/pip-install-l07p5mxc/llama-cpp-python_f9d6911d530f4f4988c31d6dcbf10c06/vendor/llama.cpp && /private/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/pip-build-env-ylemwrpn/normal/lib/python3.12/site-packages/cmake/data/bin/cmake -DMSVC= -DCMAKE_C_COMPILER_VERSION=15.0.0.15000309 -DCMAKE_C_COMPILER_ID=AppleClang -DCMAKE_VS_PLATFORM_NAME= -DCMAKE_C_COMPILER=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -P /private/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/pip-install-l07p5mxc/llama-cpp-python_f9d6911d530f4f4988c31d6dcbf10c06/vendor/llama.cpp/common/cmake/build-info-gen-cpp.cmake
  CMake Error: Not a file: /private/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/pip-install-l07p5mxc/llama-cpp-python_f9d6911d530f4f4988c31d6dcbf10c06/vendor/llama.cpp/common/cmake/build-info-gen-cpp.cmake
  CMake Error: Error processing file: /private/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/pip-install-l07p5mxc/llama-cpp-python_f9d6911d530f4f4988c31d6dcbf10c06/vendor/llama.cpp/common/cmake/build-info-gen-cpp.cmake
  [2/34] cd /var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/tmpjbiz25qi/build/vendor/llama.cpp/ggml/src && echo Embedding\ Metal\ library && sed -e '/#include "ggml-common.h"/r /private/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/pip-install-l07p5mxc/llama-cpp-python_f9d6911d530f4f4988c31d6dcbf10c06/vendor/llama.cpp/ggml/src/ggml-common.h' -e '/#include "ggml-common.h"/d' < /private/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/pip-install-l07p5mxc/llama-cpp-python_f9d6911d530f4f4988c31d6dcbf10c06/vendor/llama.cpp/ggml/src/ggml-metal.metal > /var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/tmpjbiz25qi/build/autogenerated/ggml-metal-embed.metal && echo .section\ __DATA,__ggml_metallib > /var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/tmpjbiz25qi/build/autogenerated/ggml-metal-embed.s && echo .globl\ _ggml_metallib_start >> /var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/tmpjbiz25qi/build/autogenerated/ggml-metal-embed.s && echo _ggml_metallib_start: >> /var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/tmpjbiz25qi/build/autogenerated/ggml-metal-embed.s && echo .incbin\ \"/var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/tmpjbiz25qi/build/autogenerated/ggml-metal-embed.metal\" >> /var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/tmpjbiz25qi/build/autogenerated/ggml-metal-embed.s && echo .globl\ _ggml_metallib_end >> /var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/tmpjbiz25qi/build/autogenerated/ggml-metal-embed.s && echo _ggml_metallib_end: >> /var/folders/6w/pcwbjyrx3w98xyksqn_y59pr0000gn/T/tmpjbiz25qi/build/autogenerated/ggml-metal-embed.s
  Embedding Metal library
  ninja: build stopped: subcommand failed.
  
  
  *** CMake build 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: Could not build wheels for llama-cpp-python, which is required to install pyproject.toml-based projects

Physical (or virtual) hardware you are using, e.g. for Linux:

$ lscpu

Operating System, e.g. for Linux:

$ uname -a

SDK version, e.g. for Linux:

$ python3 --version
$ make --version
$ g++ --version

Failure Information (for bugs)
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Please provide detailed steps for reproducing the issue. We are not sitting in front of your screen, so the more detail the better.

step 1
step 2
step 3
etc.

Note: Many issues seem to be regarding functional or performance issues / differences with llama.cpp. In these cases we need to confirm that you're comparing against the version of llama.cpp that was built with your python package, and which parameters you're passing to the context.
Try the following:

git clone https://github.com/abetlen/llama-cpp-python
cd llama-cpp-python
rm -rf _skbuild/ # delete any old builds
python -m pip install .
cd ./vendor/llama.cpp
Follow llama.cpp's instructions to cmake llama.cpp
Run llama.cpp's ./main with the same arguments you previously passed to llama-cpp-python and see if you can reproduce the issue. If you can, log an issue with llama.cpp

Failure Logs
Please include any relevant log snippets or files. If it works under one configuration but not under another, please provide logs for both configurations and their corresponding outputs so it is easy to see where behavior changes.
Also, please try to avoid using screenshots if at all possible. Instead, copy/paste the console output and use Github's markdown to cleanly format your logs for easy readability.
Example environment info:
llama-cpp-python$ git log | head -1
commit 47b0aa6e957b93dbe2c29d53af16fbae2dd628f2

llama-cpp-python$ python3 --version
Python 3.10.10

llama-cpp-python$ pip list | egrep "uvicorn|fastapi|sse-starlette|numpy"
fastapi                  0.95.0
numpy                    1.24.3
sse-starlette            1.3.3
uvicorn                  0.21.1

llama-cpp-python/vendor/llama.cpp$ git log | head -3
commit 66874d4fbcc7866377246efbcee938e8cc9c7d76
Author: Kerfuffle <44031344+KerfuffleV2@users.noreply.github.com>
Date:   Thu May 25 20:18:01 2023 -0600

Closing comment (2024-08-07T14:18:24Z): @mobeetle duplicate of #1662 which should be fixed now in 0.2.87