Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whisper-cpp: add ROCm and Vulkan support, rename from openai-whisper-cpp #365033

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aviallon
Copy link
Contributor

@aviallon aviallon commented Dec 13, 2024

Rewrite to use CMake build
Add aviallon to whisper-cpp's maintainers

Fixes #357736
Fixes #349669
Closes #358174

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@aviallon
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review


x86_64-linux

✅ 2 packages built:
  • whisper-cpp
  • whisper-cpp-vulkan

@aviallon
Copy link
Contributor Author

If someone could test on Darwin, it would be awesome.

@ofborg ofborg bot added 8.has: clean-up 8.has: package (new) This PR adds a new package labels Dec 15, 2024
@ofborg ofborg bot requested review from dit7ya and hughobrien December 15, 2024 00:25
@ofborg ofborg bot added the 11.by: package-maintainer This PR was created by the maintainer of the package it changes label Dec 15, 2024
@PapayaJackal
Copy link
Contributor

Great job! I tested it on Darwin, but unfortunately, it didn't work:

dyld[98714]: Library not loaded: libwhisper.1.dylib
  Referenced from: <snip> /nix/store/kxk6zw08rfq61apq09mr5n8z6lndngv8-whisper-cpp-1.7.2/bin/whisper-cpp
  Reason: tried: 'libwhisper.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibwhisper.1.dylib' (no such file), 'libwhisper.1.dylib' (no such file), '/usr/local/lib/libwhisper.1.dylib' (no such file), '/usr/lib/libwhisper.1.dylib' (no such file, not in dyld cache), '/Users/<snip>/libwhisper.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/<snip>/libwhisper.1.dylib' (no such file), '/Users/<snip>/libwhisper.1.dylib' (no such file), '/usr/local/lib/libwhisper.1.dylib' (no such file), '/usr/lib/libwhisper.1.dylib' (no such file, not in dyld cache)
[1]    98714 abort      whisper-cpp

@aviallon
Copy link
Contributor Author

Great job! I tested it on Darwin, but unfortunately, it didn't work:

dyld[98714]: Library not loaded: libwhisper.1.dylib
  Referenced from: <snip> /nix/store/kxk6zw08rfq61apq09mr5n8z6lndngv8-whisper-cpp-1.7.2/bin/whisper-cpp
  Reason: tried: 'libwhisper.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibwhisper.1.dylib' (no such file), 'libwhisper.1.dylib' (no such file), '/usr/local/lib/libwhisper.1.dylib' (no such file), '/usr/lib/libwhisper.1.dylib' (no such file, not in dyld cache), '/Users/<snip>/libwhisper.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/<snip>/libwhisper.1.dylib' (no such file), '/Users/<snip>/libwhisper.1.dylib' (no such file), '/usr/local/lib/libwhisper.1.dylib' (no such file), '/usr/lib/libwhisper.1.dylib' (no such file, not in dyld cache)
[1]    98714 abort      whisper-cpp

It looks like the RPATH is not set correctly.
It could be because of the fact the binaries are not installation targets, and may need specific patching.
Can you try adding an explicit patchelf rpath fix in postInstall?

I'll also see if I can create a KVM-OSX VM to test the derivation directly.

Copy link
Contributor

@sersorrel sersorrel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested Vulkan support with:

$ nixpkgs-review pr 365033
$ mkdir /tmp/whisper
$ ./results/whisper-cpp-vulkan-x86_64-linux/bin/whisper-cpp-download-ggml-model base.en /tmp/whisper/
$ ./results/whisper-cpp-vulkan-x86_64-linux/bin/whisper-cpp -m /tmp/whisper/ggml-base.en.bin -m /tmp/whisper/ggml-base.en.bin ~/Downloads/jfk.wav

and it seems to work ok:

ggml_vulkan: Found 1 Vulkan devices:
ggml_vulkan: 0 = AMD Radeon RX 7900 XTX (RADV NAVI31) ((null)) | uma: 1 | fp16: 1986290034 | warp size: 0

with rocmSupport = true, it seems to work fine as well (though it takes ~25 minutes to build locally):

ggml_cuda_init: found 1 ROCm devices:
  Device 0: AMD Radeon RX 7900 XTX, compute capability 11.0, VMM: no

@hughobrien
Copy link
Contributor

The vanilla build works (and fixes the SIMD issues thank you)

[nix-shell:~/.cache/nixpkgs-review/pr-365033]$ ./results/whisper-cpp-x86_64-linux/bin/whisper-cpp-bench --model "$model"
whisper_init_from_file_with_params_no_state: loading model from '/home/hugh/.local/share/whisper/ggml-medium.en.bin'
whisper_init_with_params_no_state: use gpu    = 1
whisper_init_with_params_no_state: flash attn = 0
whisper_init_with_params_no_state: gpu_device = 0
whisper_init_with_params_no_state: dtw        = 0
whisper_init_with_params_no_state: backends   = 1
whisper_model_load: loading model
whisper_model_load: n_vocab       = 51864
whisper_model_load: n_audio_ctx   = 1500
whisper_model_load: n_audio_state = 1024
whisper_model_load: n_audio_head  = 16
whisper_model_load: n_audio_layer = 24
whisper_model_load: n_text_ctx    = 448
whisper_model_load: n_text_state  = 1024
whisper_model_load: n_text_head   = 16
whisper_model_load: n_text_layer  = 24
whisper_model_load: n_mels        = 80
whisper_model_load: ftype         = 1
whisper_model_load: qntvr         = 0
whisper_model_load: type          = 4 (medium)
whisper_model_load: adding 1607 extra tokens
whisper_model_load: n_langs       = 99
whisper_model_load:      CPU total size =  1533.14 MB
whisper_model_load: model size    = 1533.14 MB
whisper_init_state: kv self size  =   50.33 MB
whisper_init_state: kv cross size =  150.99 MB
whisper_init_state: kv pad  size  =    6.29 MB
whisper_init_state: compute buffer (conv)   =   28.55 MB
whisper_init_state: compute buffer (encode) =  170.15 MB
whisper_init_state: compute buffer (cross)  =    7.72 MB
whisper_init_state: compute buffer (decode) =   98.18 MB

system_info: n_threads = 4 / 16 | AVX = 1 | AVX2 = 1 | AVX512 = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | METAL = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 0 | SSE3 = 1 | SSSE3 = 1 | VSX = 0 | CUDA = 0 | COREML = 0 | OPENVINO = 0 | CANN = 0

whisper_print_timings:     load time =  1724.71 ms
whisper_print_timings:     fallbacks =   0 p /   0 h
whisper_print_timings:      mel time =     0.00 ms
whisper_print_timings:   sample time =     0.00 ms /     1 runs (    0.00 ms per run)
whisper_print_timings:   encode time = 18957.00 ms /     1 runs (18957.00 ms per run)
whisper_print_timings:   decode time =  7771.20 ms /   256 runs (   30.36 ms per run)
whisper_print_timings:   batchd time =  5600.82 ms /   320 runs (   17.50 ms per run)
whisper_print_timings:   prompt time = 62897.61 ms /  4096 runs (   15.36 ms per run)
whisper_print_timings:    total time = 95227.88 ms

However the vulkan build did not:

[nix-shell:~/.cache/nixpkgs-review/pr-365033]$ ./results/whisper-cpp-vulkan-x86_64-linux/bin/whisper-cpp-bench --model "$model"
whisper_init_from_file_with_params_no_state: loading model from '/home/hugh/.local/share/whisper/ggml-medium.en.bin'
whisper_init_with_params_no_state: use gpu    = 1
whisper_init_with_params_no_state: flash attn = 0
whisper_init_with_params_no_state: gpu_device = 0
whisper_init_with_params_no_state: dtw        = 0
ggml_vulkan: Found 1 Vulkan devices:
Segmentation fault (core dumped)

[nix-shell:~/.cache/nixpkgs-review/pr-365033]$ ./results/whisper-cpp-vulkan-x86_64-linux/bin/whisper-cpp --model "$model" /tmp/out.wav 
whisper_init_from_file_with_params_no_state: loading model from '/home/hugh/.local/share/whisper/ggml-medium.en.bin'
whisper_init_with_params_no_state: use gpu    = 1
whisper_init_with_params_no_state: flash attn = 0
whisper_init_with_params_no_state: gpu_device = 0
whisper_init_with_params_no_state: dtw        = 0
ggml_vulkan: Found 1 Vulkan devices:
Segmentation fault (core dumped)

@PapayaJackal
Copy link
Contributor

Great job! I tested it on Darwin, but unfortunately, it didn't work:

dyld[98714]: Library not loaded: libwhisper.1.dylib
  Referenced from: <snip> /nix/store/kxk6zw08rfq61apq09mr5n8z6lndngv8-whisper-cpp-1.7.2/bin/whisper-cpp
  Reason: tried: 'libwhisper.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibwhisper.1.dylib' (no such file), 'libwhisper.1.dylib' (no such file), '/usr/local/lib/libwhisper.1.dylib' (no such file), '/usr/lib/libwhisper.1.dylib' (no such file, not in dyld cache), '/Users/<snip>/libwhisper.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/<snip>/libwhisper.1.dylib' (no such file), '/Users/<snip>/libwhisper.1.dylib' (no such file), '/usr/local/lib/libwhisper.1.dylib' (no such file), '/usr/lib/libwhisper.1.dylib' (no such file, not in dyld cache)
[1]    98714 abort      whisper-cpp

It looks like the RPATH is not set correctly. It could be because of the fact the binaries are not installation targets, and may need specific patching. Can you try adding an explicit patchelf rpath fix in postInstall?

I'll also see if I can create a KVM-OSX VM to test the derivation directly.

I'm a bit swamped with other stuff right now, so I won't be able to dive into debugging this further. Sorry!

@aviallon aviallon force-pushed the feature/rework-whisper-cpp branch from d05678a to bfc4257 Compare December 16, 2024 23:06
@aviallon
Copy link
Contributor Author

@PapayaJackal I tried adding addAutoPatchelfSearchPath, to see how it goes on macOS.

@rodfersou
Copy link

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 365033


aarch64-darwin

❌ 2 packages failed to build:
  • whisper-cpp
  • whisper-cpp-vulkan

@rodfersou
Copy link

$ nix build --file /nix/store/w1hgvm5rb3rblya8if90cdx5lvwyf4wc-nixpkgs-review-2.12.0/lib/python3.12/site-packages/nixpkgs_review/nix/review-shell.nix --nix-path 'nixpkgs=/Users/rodrigo/.cache/nixpkgs-review/pr-365033-1/nixpkgs nixpkgs-overlays=/var/folders/by/9xt1lyys0qvds8zzbx60c58m0000gn/T/tmppcq_ecwm' --extra-experimental-features 'nix-command no-url-literals' --no-link --keep-going --no-allow-import-from-derivation --argstr local-system aarch64-darwin --argstr nixpkgs-path /Users/rodrigo/.cache/nixpkgs-review/pr-365033-1/nixpkgs --argstr nixpkgs-config-path /var/folders/by/9xt1lyys0qvds8zzbx60c58m0000gn/T/tmp0qmt4adr.nix --argstr attrs-path /Users/rodrigo/.cache/nixpkgs-review/pr-365033-1/attrs.nix
error: builder for '/nix/store/dinzb2x13v9ssxvp36p7m76fk35dc13a-whisper-cpp-1.7.2.drv' failed with exit code 1;
       last 10 log lines:
       >           ^^^^^^^^^^^^^^^
       >   File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/elf/elffile.py", line 84, in __init__
       >     self._identify_file()
       >   File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/elf/elffile.py", line 570, in _identify_file
       >     elf_assert(magic == b'\x7fELF', 'Magic number does not match')
       >   File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/common/utils.py", line 80, in elf_assert
       >     _assert_with_exception(cond, msg, ELFError)
       >   File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/common/utils.py", line 143, in _assert_with_exception
       >     raise exception_type(msg)
       > elftools.common.exceptions.ELFError: Magic number does not match
       For full logs, run 'nix-store -l /nix/store/dinzb2x13v9ssxvp36p7m76fk35dc13a-whisper-cpp-1.7.2.drv'.
error: builder for '/nix/store/gdcg3r5pwz8m8w0vbf6jk7cy6w76jylc-whisper-cpp-1.7.2.drv' failed with exit code 1;
       last 10 log lines:
       >           ^^^^^^^^^^^^^^^
       >   File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/elf/elffile.py", line 84, in __init__
       >     self._identify_file()
       >   File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/elf/elffile.py", line 570, in _identify_file
       >     elf_assert(magic == b'\x7fELF', 'Magic number does not match')
       >   File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/common/utils.py", line 80, in elf_assert
       >     _assert_with_exception(cond, msg, ELFError)
       >   File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/common/utils.py", line 143, in _assert_with_exception
       >     raise exception_type(msg)
       > elftools.common.exceptions.ELFError: Magic number does not match
       For full logs, run 'nix-store -l /nix/store/gdcg3r5pwz8m8w0vbf6jk7cy6w76jylc-whisper-cpp-1.7.2.drv'.
error: 2 dependencies of derivation '/nix/store/dasbp7ay07cbiw4l4rp56bxfk5ink0jp-review-shell.drv' failed to build

@rodfersou
Copy link

@aviallon, this is the first time I've run those commands, and my environment might also be broken.

Please let me know if there is anything more I can do to help

@aviallon
Copy link
Contributor Author

@rodfersou thank you very much.
I think I'll set up a Hackintosh VM in order to debug it.

@rodfersou
Copy link

@aviallon I run the command for full logs looks like the target macos (12) is different from the one I have (11)

note: 'whisper_encoder_impl' has been marked as being introduced in macOS 12.0 here, but the deployment target is macOS 11.0.0

[2/55] Building CXX object src/CMakeFiles/whisper.coreml.dir/coreml/whisper-encoder.mm.o
/tmp/nix-build-whisper-cpp-1.7.2.drv-1/source/src/coreml/whisper-encoder.mm:31:44: warning: 'whisper_encoder_impl' is only available on macOS 12.0 or newer [-
Wunguarded-availability-new]
    const void * data = CFBridgingRetain([[whisper_encoder_impl alloc] initWithContentsOfURL:url_model configuration:config error:nil]);
                                           ^~~~~~~~~~~~~~~~~~~~
/tmp/nix-build-whisper-cpp-1.7.2.drv-1/source/src/coreml/whisper-encoder-impl.h:41:12: note: 'whisper_encoder_impl' has been marked as being introduced in macOS 12.0 here, but the deployment target is macOS 11.0.0
@interface whisper_encoder_impl : NSObject
           ^
/tmp/nix-build-whisper-cpp-1.7.2.drv-1/source/src/coreml/whisper-encoder.mm:31:44: note: enclose 'whisper_encoder_impl' in an @available check to silence this warning
    const void * data = CFBridgingRetain([[whisper_encoder_impl alloc] initWithContentsOfURL:url_model configuration:config error:nil]);
                                           ^~~~~~~~~~~~~~~~~~~~
/tmp/nix-build-whisper-cpp-1.7.2.drv-1/source/src/coreml/whisper-encoder.mm:65:9: warning: 'whisper_encoder_implOutput' is only available on macOS 12.0 or newer [-Wunguarded-availability-new]
        whisper_encoder_implOutput * outCoreML = [(__bridge id) ctx->data predictionFromLogmel_data:inMultiArray error:nil];
        ^~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/nix-build-whisper-cpp-1.7.2.drv-1/source/src/coreml/whisper-encoder-impl.h:29:12: note: 'whisper_encoder_implOutput' has been marked as being introduced in macOS 12.0 here, but the deployment target is macOS 11.0.0
@interface whisper_encoder_implOutput : NSObject<MLFeatureProvider>
           ^
/tmp/nix-build-whisper-cpp-1.7.2.drv-1/source/src/coreml/whisper-encoder.mm:65:9: note: enclose 'whisper_encoder_implOutput' in an @available check to silence this warning
        whisper_encoder_implOutput * outCoreML = [(__bridge id) ctx->data predictionFromLogmel_data:inMultiArray error:nil];
        ^~~~~~~~~~~~~~~~~~~~~~~~~~

@rodfersou
Copy link

@aviallon can we try with SDK12 instead?

@rodfersou
Copy link

this is what happens when try to run the failed binary

 ...failed_results/whisper-cpp-aarch64-darwin/bin 
$ ./whisper-cpp
dyld[10672]: Library not loaded: libwhisper.1.dylib
  Referenced from: <3DC12AEA-5D8F-3F2A-8F4F-964BFAD19413> /nix/store/xp339mpr218ppnkm6fcrr9j3c6ckhx09-whisper-cpp-1.7.2/bin/whisper-cpp
  Reason: tried: 'libwhisper.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibwhisper.1.dylib' (no such file), 'libwhisper.1.dylib' (no such file), '/usr/local/lib/libwhisper.1.dylib' (no such file), '/usr/lib/libwhisper.1.dylib' (no such file, not in dyld cache), '/nix/store/xp339mpr218ppnkm6fcrr9j3c6ckhx09-whisper-cpp-1.7.2/bin/libwhisper.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/nix/store/xp339mpr218ppnkm6fcrr9j3c6ckhx09-whisper-cpp-1.7.2/bin/libwhisper.1.dylib' (no such file), '/nix/store/xp339mpr218ppnkm6fcrr9j3c6ckhx09-whisper-cpp-1.7.2/bin/libwhisper.1.dylib' (no such file), '/usr/local/lib/libwhisper.1.dylib' (no such file), '/usr/lib/libwhisper.1.dylib' (no such file, not in dyld cache)
[1]    10672 abort      ./whisper-cpp

@rodfersou
Copy link

@rodfersou
Copy link

@aviallon this should help https://stackoverflow.com/a/11585225

@hughobrien
Copy link
Contributor

Looking forward to this landing, please let us know if we can assist.

@lucasew
Copy link
Contributor

lucasew commented Dec 30, 2024

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 365033


x86_64-linux

✅ 8 packages built:
  • kodiPackages.iagl
  • kodiPackages.youtube
  • netbird-dashboard
  • nixos-firewall-tool
  • nzbhydra2
  • qownnotes
  • whisper-cpp
  • whisper-cpp-vulkan

@DontEatOreo
Copy link
Member

DontEatOreo commented Jan 5, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 365033


x86_64-darwin

❌ 2 packages failed to build:
  • whisper-cpp
  • whisper-cpp-vulkan

aarch64-darwin

❌ 2 packages failed to build:
  • whisper-cpp
  • whisper-cpp-vulkan

Log:

Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/rwjn197xn0iv5hixl7lsq0yci71amkjp-source
source root is source
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
applying patch /nix/store/snd07fjxx6qmm1n9gkwhr1jwshxrr97a-download-models.patch
patching file models/download-ggml-model.sh
Hunk #2 succeeded at 54 (offset 2 lines).
Hunk #3 succeeded at 84 (offset 2 lines).
Hunk #4 succeeded at 106 (offset 4 lines).
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
fixing cmake files...
cmake flags: -GNinja -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/share/doc/whisper-cpp -DCMAKE_INSTALL_INFODIR=/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include -DCMAKE_INSTALL_SBINDIR=/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/nn6blgh7kybrzxkpbg5ngdk379w4gpw6-cctools-binutils-darwin-wrapper-1010.6/bin/strip -DCMAKE_RANLIB=/nix/store/nn6blgh7kybrzxkpbg5ngdk379w4gpw6-cctools-binutils-darwin-wrapper-1010.6/bin/ranlib -DCMAKE_AR=/nix/store/nn6blgh7kybrzxkpbg5ngdk379w4gpw6-cctools-binutils-darwin-wrapper-1010.6/bin/ar -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_INSTALL_PREFIX=/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2 -DCMAKE_SKIP_BUILD_RPATH:BOOL=TRUE -DGGML_CUDA:BOOL=FALSE -DGGML_HIPBLAS:BOOL=FALSE -DGGML_VULKAN:BOOL=FALSE -DWHISPER_SDL2:BOOL=TRUE -DGGML_LTO:BOOL=TRUE -DGGML_NATIVE:BOOL=FALSE -DBUILD_SHARED_LIBS:BOOL=TRUE -DGGML_BACKEND_DL:BOOL=TRUE -DGGML_CPU_ALL_VARIANTS:BOOL=TRUE -DGGML_METAL:BOOL=FALSE -DGGML_METAL_EMBED_LIBRARY:BOOL=FALSE -DWHISPER_COREML:BOOL=TRUE -DWHISPER_COREML_ALLOW_FALLBACK:BOOL=TRUE
-- The C compiler identification is Clang 19.1.5
-- The CXX compiler identification is Clang 19.1.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/p7ck87mq20ngn4rv8w52imx4c80qj801-clang-wrapper-19.1.5/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: /nix/store/p7ck87mq20ngn4rv8w52imx4c80qj801-clang-wrapper-19.1.5/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Git (missing: GIT_EXECUTABLE) 
-- Could NOT find Git (missing: GIT_EXECUTABLE) 
�[33mCMake Warning at cmake/build-info.cmake:14 (message):
  Git not found.  Build info will not be accurate.
Call Stack (most recent call first):
  CMakeLists.txt:90 (include)

�[0m
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Accelerate framework found
-- 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) 
�[33mCMake Warning at ggml/src/CMakeLists.txt:174 (message):
  OpenMP not found

�[0m
-- Looking for dgemm_
-- Looking for dgemm_ - found
-- Found BLAS: /nix/store/xaz8wm57948ymrxbjvdfk8mnqli3xvyp-apple-sdk-11.3/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework
-- BLAS found, Libraries: /nix/store/xaz8wm57948ymrxbjvdfk8mnqli3xvyp-apple-sdk-11.3/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework
-- BLAS found, Includes: 
�[33mCMake Warning at ggml/src/CMakeLists.txt:1068 (message):
  IPO is not supported: Change Dir:
  '/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/build/ggml/src/CMakeFiles/_CMakeLTOTest-CXX/bin'




  Run Build Command(s):
  /nix/store/w8ngrsfh2zimq4a16rgrrm23skcss5v4-ninja-1.12.1/bin/ninja -v

  [1/4]
  /nix/store/p7ck87mq20ngn4rv8w52imx4c80qj801-clang-wrapper-19.1.5/bin/clang++
  -flto=thin -isysroot
  /nix/store/xaz8wm57948ymrxbjvdfk8mnqli3xvyp-apple-sdk-11.3/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
  -MD -MT CMakeFiles/foo.dir/foo.cpp.o -MF CMakeFiles/foo.dir/foo.cpp.o.d -o
  CMakeFiles/foo.dir/foo.cpp.o -c
  /tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/build/ggml/src/CMakeFiles/_CMakeLTOTest-CXX/src/foo.cpp


  [2/4]
  /nix/store/p7ck87mq20ngn4rv8w52imx4c80qj801-clang-wrapper-19.1.5/bin/clang++
  -flto=thin -isysroot
  /nix/store/xaz8wm57948ymrxbjvdfk8mnqli3xvyp-apple-sdk-11.3/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
  -MD -MT CMakeFiles/boo.dir/main.cpp.o -MF CMakeFiles/boo.dir/main.cpp.o.d
  -o CMakeFiles/boo.dir/main.cpp.o -c
  /tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/build/ggml/src/CMakeFiles/_CMakeLTOTest-CXX/src/main.cpp


  [3/4] : &&
  /nix/store/6fxjmcjgfz338702p9ps26r0s1bakqbk-cmake-3.30.5/bin/cmake -E rm -f
  libfoo.a && "CMAKE_CXX_COMPILER_AR-NOTFOUND" qc libfoo.a
  CMakeFiles/foo.dir/foo.cpp.o && "CMAKE_CXX_COMPILER_RANLIB-NOTFOUND"
  libfoo.a &&
  /nix/store/6fxjmcjgfz338702p9ps26r0s1bakqbk-cmake-3.30.5/bin/cmake -E touch
  libfoo.a && :

  FAILED: libfoo.a

  : && /nix/store/6fxjmcjgfz338702p9ps26r0s1bakqbk-cmake-3.30.5/bin/cmake -E
  rm -f libfoo.a && "CMAKE_CXX_COMPILER_AR-NOTFOUND" qc libfoo.a
  CMakeFiles/foo.dir/foo.cpp.o && "CMAKE_CXX_COMPILER_RANLIB-NOTFOUND"
  libfoo.a &&
  /nix/store/6fxjmcjgfz338702p9ps26r0s1bakqbk-cmake-3.30.5/bin/cmake -E touch
  libfoo.a && :

  /bin/sh: CMAKE_CXX_COMPILER_AR-NOTFOUND: command not found

  ninja: build stopped: subcommand failed.




�[0m
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- x86 detected
-- CoreML framework found
-- SDL2_INCLUDE_DIRS = /nix/store/559pp9a0iv0zc78ajjp8465w6nc99x94-SDL2-2.30.6-dev/include;/nix/store/559pp9a0iv0zc78ajjp8465w6nc99x94-SDL2-2.30.6-dev/include/SDL2;/nix/store/559pp9a0iv0zc78ajjp8465w6nc99x94-SDL2-2.30.6-dev/include/SDL2;/nix/store/559pp9a0iv0zc78ajjp8465w6nc99x94-SDL2-2.30.6-dev/include/SDL2
-- SDL2_LIBRARIES    = SDL2::SDL2
-- Configuring done (36.3s)
�[33mCMake Warning (dev):
  Policy CMP0068 is not set: RPATH settings on macOS do not affect
  install_name.  Run "cmake --help-policy CMP0068" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  For compatibility with older versions of CMake, the install_name fields for
  the following targets are still affected by RPATH settings:

   whisper
   whisper.coreml

This warning is for project developers.  Use -Wno-dev to suppress it.
�[0m
-- Generating done (0.1s)
�[33mCMake Warning:
  Manually-specified variables were not used by the project:

    BUILD_TESTING
    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CMAKE_POLICY_DEFAULT_CMP0025
    GGML_BACKEND_DL
    GGML_CPU_ALL_VARIANTS
    GGML_METAL_EMBED_LIBRARY

�[0m
-- Build files have been written to: /tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/build
cmake: enabled parallel building
cmake: enabled parallel installing
configurePhase completed in 46 seconds
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
build flags: -j8
[1/47] Building C object ggml/src/CMakeFiles/ggml.dir/ggml-alloc.c.o
[2/47] Building CXX object src/CMakeFiles/whisper.coreml.dir/coreml/whisper-encoder.mm.o
/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/src/coreml/whisper-encoder.mm:31:44: warning: 'whisper_encoder_impl' is only available on macOS 12.0 or newer [-Wunguarded-availability-new]
   31 |     const void * data = CFBridgingRetain([[whisper_encoder_impl alloc] initWithContentsOfURL:url_model configuration:config error:nil]);
      |                                            ^~~~~~~~~~~~~~~~~~~~
/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/src/coreml/whisper-encoder-impl.h:41:12: note: 'whisper_encoder_impl' has been marked as being introduced in macOS 12.0 here, but the deployment target is macOS 11.3.0
   41 | @interface whisper_encoder_impl : NSObject
      |            ^
/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/src/coreml/whisper-encoder.mm:31:44: note: enclose 'whisper_encoder_impl' in an @available check to silence this warning
   31 |     const void * data = CFBridgingRetain([[whisper_encoder_impl alloc] initWithContentsOfURL:url_model configuration:config error:nil]);
      |                                            ^~~~~~~~~~~~~~~~~~~~
   32 | 
   33 |     if (data == NULL) {
   34 |         return NULL;
   35 |     }
   36 | 
   37 |     whisper_coreml_context * ctx = new whisper_coreml_context;
   38 | 
   39 |     ctx->data = data;
      |                      
/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/src/coreml/whisper-encoder.mm:65:9: warning: 'whisper_encoder_implOutput' is only available on macOS 12.0 or newer [-Wunguarded-availability-new]
   65 |         whisper_encoder_implOutput * outCoreML = [(__bridge id) ctx->data predictionFromLogmel_data:inMultiArray error:nil];
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/src/coreml/whisper-encoder-impl.h:29:12: note: 'whisper_encoder_implOutput' has been marked as being introduced in macOS 12.0 here, but the deployment target is macOS 11.3.0
   29 | @interface whisper_encoder_implOutput : NSObject<MLFeatureProvider>
      |            ^
/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/src/coreml/whisper-encoder.mm:65:9: note: enclose 'whisper_encoder_implOutput' in an @available check to silence this warning
   65 |         whisper_encoder_implOutput * outCoreML = [(__bridge id) ctx->data predictionFromLogmel_data:inMultiArray error:nil];
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                          
2 warnings generated.
[3/47] Building C object ggml/src/CMakeFiles/ggml.dir/ggml-aarch64.c.o
[4/47] Building C object src/CMakeFiles/whisper.coreml.dir/coreml/whisper-encoder-impl.m.o
[5/47] Linking CXX shared library src/libwhisper.coreml.dylib
[6/47] Building CXX object ggml/src/CMakeFiles/ggml.dir/ggml-backend.cpp.o
[7/47] Building C object ggml/src/CMakeFiles/ggml.dir/ggml.c.o
[8/47] Building CXX object ggml/src/CMakeFiles/ggml.dir/ggml-blas.cpp.o
[9/47] Building CXX object examples/CMakeFiles/common.dir/grammar-parser.cpp.o
[10/47] Building CXX object examples/CMakeFiles/common-sdl.dir/common-sdl.cpp.o
[11/47] Linking CXX static library examples/libcommon-sdl.a
[12/47] Building CXX object examples/wchess/libwchess/CMakeFiles/wchess-core.dir/WChess.cpp.o
[13/47] Building C object ggml/src/CMakeFiles/ggml.dir/ggml-quants.c.o
[14/47] Building CXX object examples/CMakeFiles/common.dir/common-ggml.cpp.o
[15/47] Building CXX object examples/wchess/libwchess/CMakeFiles/wchess-core.dir/Chessboard.cpp.o
[16/47] Building CXX object examples/bench/CMakeFiles/bench.dir/bench.cpp.o
[17/47] Building CXX object examples/main/CMakeFiles/main.dir/main.cpp.o
[18/47] Building C object ggml/src/CMakeFiles/ggml.dir/ggml-cpu.c.o
[19/47] Building CXX object examples/stream/CMakeFiles/stream.dir/stream.cpp.o
[20/47] Linking CXX shared library ggml/src/libggml.dylib
[21/47] Building CXX object examples/CMakeFiles/common.dir/common.cpp.o
/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/examples/common.cpp:266:31: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
  266 |     std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
      |                               ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/codecvt:193:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
  193 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/__config:723:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
  723 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/__config:688:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  688 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/examples/common.cpp:266:10: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
  266 |     std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
      |          ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/locale:3145:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
 3145 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/__config:723:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
  723 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/__config:688:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  688 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/examples/common.cpp:272:31: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
  272 |     std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
      |                               ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/codecvt:193:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
  193 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/__config:723:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
  723 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/__config:688:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  688 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/examples/common.cpp:272:10: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
  272 |     std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
      |          ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/locale:3145:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
 3145 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/__config:723:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
  723 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/__config:688:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  688 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
4 warnings generated.
[22/47] Building CXX object examples/command/CMakeFiles/command.dir/command.cpp.o
[23/47] Building CXX object examples/quantize/CMakeFiles/quantize.dir/quantize.cpp.o
[24/47] Building CXX object examples/talk-llama/CMakeFiles/talk-llama.dir/llama-vocab.cpp.o
[25/47] Building CXX object examples/talk-llama/CMakeFiles/talk-llama.dir/llama-grammar.cpp.o
[26/47] Building CXX object examples/talk-llama/CMakeFiles/talk-llama.dir/talk-llama.cpp.o
[27/47] Building CXX object src/CMakeFiles/whisper.dir/whisper.cpp.o
[28/47] Building CXX object examples/talk-llama/CMakeFiles/talk-llama.dir/llama-sampling.cpp.o
[29/47] Linking CXX shared library src/libwhisper.1.7.2.dylib
[30/47] Building CXX object examples/talk-llama/CMakeFiles/talk-llama.dir/unicode-data.cpp.o
[31/47] Creating library symlink src/libwhisper.1.dylib src/libwhisper.dylib
[32/47] Linking CXX static library examples/libcommon.a
[33/47] Linking CXX static library examples/wchess/libwchess/libwchess-core.a
[34/47] Linking CXX executable bin/bench
[35/47] Linking CXX executable bin/main
[36/47] Linking CXX executable bin/stream
[37/47] Linking CXX executable bin/command
[38/47] Linking CXX executable bin/quantize
[39/47] Building CXX object examples/wchess/wchess.cmd/CMakeFiles/wchess.dir/wchess.cmd.cpp.o
[40/47] Linking CXX executable bin/wchess
[41/47] Building CXX object examples/talk-llama/CMakeFiles/talk-llama.dir/unicode.cpp.o
/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/examples/talk-llama/unicode.cpp:204:31: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
  204 |     std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
      |                               ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/codecvt:193:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
  193 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/__config:723:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
  723 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/__config:688:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  688 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/examples/talk-llama/unicode.cpp:204:10: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
  204 |     std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
      |          ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/locale:3145:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
 3145 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/__config:723:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
  723 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/nix/store/qrw2pm57j03w61djcwzxww1bg6sigsgp-libcxx-19.1.5-dev/include/c++/v1/__config:688:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  688 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
2 warnings generated.
[42/47] Building CXX object examples/lsp/CMakeFiles/lsp.dir/lsp.cpp.o
[43/47] Linking CXX executable bin/lsp
[44/47] Building CXX object examples/server/CMakeFiles/server.dir/server.cpp.o
/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/examples/server/server.cpp:680:57: warning: 'tmpnam' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead. [-Wdeprecated-declarations]
  680 |             const std::string temp_filename_base = std::tmpnam(nullptr);
      |                                                         ^
/nix/store/xaz8wm57948ymrxbjvdfk8mnqli3xvyp-apple-sdk-11.3/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:186:1: note: 'tmpnam' has been explicitly marked deprecated here
  186 | __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.")
      | ^
/nix/store/xaz8wm57948ymrxbjvdfk8mnqli3xvyp-apple-sdk-11.3/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:200:48: note: expanded from macro '__deprecated_msg'
  200 |         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
      |                                                       ^
1 warning generated.
[45/47] Linking CXX executable bin/server
[46/47] Building CXX object examples/talk-llama/CMakeFiles/talk-llama.dir/llama.cpp.o
[47/47] Linking CXX executable bin/talk-llama
buildPhase completed in 1 minutes 32 seconds
Running phase: installPhase
@nix { "action": "setPhase", "phase": "installPhase" }
install flags: -j8 install
[0/1] Install the project...
-- Install configuration: "Release"
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/lib/libwhisper.1.7.2.dylib
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/lib/libwhisper.1.dylib
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/lib/libwhisper.dylib
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/whisper.h
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/lib/cmake/whisper/whisper-config.cmake
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/lib/cmake/whisper/whisper-version.cmake
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/lib/pkgconfig/whisper.pc
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/lib/libggml.dylib
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml.h
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-cpu.h
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-alloc.h
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-backend.h
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-blas.h
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-cann.h
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-cuda.h
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-kompute.h
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-metal.h
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-rpc.h
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-sycl.h
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-vulkan.h
-- Installing: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/lib/libggml.dylib
-- Up-to-date: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml.h
-- Up-to-date: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-cpu.h
-- Up-to-date: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-alloc.h
-- Up-to-date: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-backend.h
-- Up-to-date: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-blas.h
-- Up-to-date: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-cann.h
-- Up-to-date: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-cuda.h
-- Up-to-date: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-kompute.h
-- Up-to-date: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-metal.h
-- Up-to-date: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-rpc.h
-- Up-to-date: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-sycl.h
-- Up-to-date: /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/include/ggml-vulkan.h
install: creating directory '/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin'
'./bin/main' -> '/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin/whisper-cpp'
/private/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/build/bin /private/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/build
'bench' -> '/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin/whisper-cpp-bench'
'command' -> '/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin/whisper-cpp-command'
'lsp' -> '/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin/whisper-cpp-lsp'
'quantize' -> '/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin/whisper-cpp-quantize'
'server' -> '/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin/whisper-cpp-server'
'stream' -> '/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin/whisper-cpp-stream'
'talk-llama' -> '/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin/whisper-cpp-talk-llama'
'wchess' -> '/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin/whisper-cpp-wchess'
/private/tmp/nix-build-whisper-cpp-1.7.2.drv-2/source/build
'/nix/store/rwjn197xn0iv5hixl7lsq0yci71amkjp-source/models/download-ggml-model.sh' -> '/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin/whisper-cpp-download-ggml-model'
Running phase: fixupPhase
@nix { "action": "setPhase", "phase": "fixupPhase" }
checking for references to /private/tmp/nix-build-whisper-cpp-1.7.2.drv-2/ in /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2...
patching script interpreter paths in /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2
/nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin/.whisper-cpp-download-ggml-model-wrapped: interpreter directive changed from "#!/bin/sh" to "/nix/store/45a4hms3bsmk23bzn0g0qfn663izq3f8-bash-5.2p37/bin/sh"
stripping (with command strip and flags -S) in  /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/lib /nix/store/8mlcvcfgnz19k6lv7a23frkhi4966p8j-whisper-cpp-1.7.2/bin
Traceback (most recent call last):
  File "/nix/store/k6zx9v9d72zlgq2bcm7i6y53lih5i2vz-auto-patchelf-0-unstable-2024-08-14/bin/auto-patchelf", line 435, in <module>
    with open_elf(interpreter_path) as interpreter:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/fpmkmdzgd1q7kqadc7czcjdhjj7bsc0i-python3-3.12.8/lib/python3.12/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/nix/store/k6zx9v9d72zlgq2bcm7i6y53lih5i2vz-auto-patchelf-0-unstable-2024-08-14/bin/auto-patchelf", line 30, in open_elf
    yield ELFFile(stream)
          ^^^^^^^^^^^^^^^
  File "/nix/store/708jxxfvgz9c954nxlwd7iwzmdcwq5dg-python3-3.12.8-env/lib/python3.12/site-packages/elftools/elf/elffile.py", line 84, in __init__
    self._identify_file()
  File "/nix/store/708jxxfvgz9c954nxlwd7iwzmdcwq5dg-python3-3.12.8-env/lib/python3.12/site-packages/elftools/elf/elffile.py", line 570, in _identify_file
    elf_assert(magic == b'\x7fELF', 'Magic number does not match')
  File "/nix/store/708jxxfvgz9c954nxlwd7iwzmdcwq5dg-python3-3.12.8-env/lib/python3.12/site-packages/elftools/common/utils.py", line 80, in elf_assert
    _assert_with_exception(cond, msg, ELFError)
  File "/nix/store/708jxxfvgz9c954nxlwd7iwzmdcwq5dg-python3-3.12.8-env/lib/python3.12/site-packages/elftools/common/utils.py", line 143, in _assert_with_exception
    raise exception_type(msg)
elftools.common.exceptions.ELFError: Magic number does not match

@aviallon
Copy link
Contributor Author

aviallon commented Jan 6, 2025

Quite frankly, I can't fix macOS support.
It is probably best if I mark it broken, and a macOS user spends the time troubleshooting this.

@DontEatOreo
Copy link
Member

DontEatOreo commented Jan 6, 2025

I daily drive an aarch64-darwin system and I'm interested in whsper-cpp, so I'll give it a try. Python and C++ are kind of outside my scope, but if I figure out a fix, I'll make a PR

I suppose it's best to mark it broken for now to not delay this PR any further

While this PR is not merged yet, I think it will be a good idea to bump the version to 1.7.4

@rodfersou
Copy link

@aviallon did you try my suggestions? I'm pretty sure adding the environment variables I told should fix..

Copy link

@rodfersou rodfersou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the environment variables to make it work for OSX, as requested in the review.

@aviallon
Copy link
Contributor Author

@rodfersou I can try, but it is unlikely to make any difference, as the issue is caused by a wrong RPATH due to the binaries not being part of CMake's install target.
The environment variables are no longer used by the project, per CMake's warnings and the project's source code.

@rodfersou
Copy link

did you notice the typo that you keep LLAMA instead of WHISPER in the environment variable?

@aviallon aviallon force-pushed the feature/rework-whisper-cpp branch from bfc4257 to aa40380 Compare January 21, 2025 12:18
@aviallon aviallon requested a review from rodfersou January 21, 2025 12:18
@aviallon
Copy link
Contributor Author

@rodfersou @lucasew I reworked the PR to patch CMakeLists.txt instead, which means we now have proper install targets, and proper RPATH.
I also added a trivial installCheckPhase, to make sure the built binary doesn't crash outright.

@aviallon
Copy link
Contributor Author

@rodfersou According to https://logs.ofborg.org/?attempt_id=d3509326-6aa2-439d-a4a1-7388ad8189a1&key=nixos%2Fnixpkgs.365033, it doesn't even build for x86_64-darwin...

FAILED: src/CMakeFiles/whisper.coreml.dir/coreml/whisper-encoder.mm.o 
/nix/store/raqax5qp65an4jcwj1bzd5lq589ywpg0-clang-wrapper-16.0.6/bin/clang++ -Dwhisper_coreml_EXPORTS -I/tmp/nix-build-whisper-cpp-1.7.2.drv-0/source/src/. -F/nix/store/6fb3yzhx0dlhzjk8s1mwkmn505yqbmmb-apple-sdk-10.12.2/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks -O3 -DNDEBUG -isysroot /nix/store/6fb3yzhx0dlhzjk8s1mwkmn505yqbmmb-apple-sdk-10.12.2/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -fPIC -fobjc-arc -MD -MT src/CMakeFiles/whisper.coreml.dir/coreml/whisper-encoder.mm.o -MF src/CMakeFiles/whisper.coreml.dir/coreml/whisper-encoder.mm.o.d -o src/CMakeFiles/whisper.coreml.dir/coreml/whisper-encoder.mm.o -c /tmp/nix-build-whisper-cpp-1.7.2.drv-0/source/src/coreml/whisper-encoder.mm
In file included from /tmp/nix-build-whisper-cpp-1.7.2.drv-0/source/src/coreml/whisper-encoder.mm:6:
/tmp/nix-build-whisper-cpp-1.7.2.drv-0/source/src/coreml/whisper-encoder-impl.h:8:9: fatal error: 'CoreML/CoreML.h' file not found
#import <CoreML/CoreML.h>
        ^~~~~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.

@aviallon
Copy link
Contributor Author

aviallon commented Jan 21, 2025

I tried disabling CoreML support by default, and marking the package broken when CoreML is enabled.

Wait, apple-sdk has changed. I have to rework things.

@aviallon aviallon force-pushed the feature/rework-whisper-cpp branch 2 times, most recently from f72f772 to d97db76 Compare January 21, 2025 13:41
@rodfersou
Copy link

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 365033

@rodfersou
Copy link

$ nixpkgs-review pr --post-result 365033
$ git -c fetch.prune=false fetch --no-tags --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/365033/head:refs/nixpkgs-review/1
$ git worktree add /Users/rodrigo/.cache/nixpkgs-review/pr-365033-5/nixpkgs 489c04e40ca17f831e45cefc4a72e8884bf7a51a
Preparing worktree (detached HEAD 489c04e40ca1)
Updating files: 100% (45779/45779), done.
HEAD is now at 489c04e40ca1 miniflux: 2.2.4 -> 2.2.5 (#375556)
$ git merge --no-commit --no-ff d97db76924bd0185e1f9aebb1ecd3520cd1acea2
Auto-merging pkgs/top-level/aliases.nix
Auto-merging pkgs/top-level/all-packages.nix
Automatic merge went well; stopped before committing as requested
Nothing to be built.

Link to currently reviewing PR:
https://github.com/NixOS/nixpkgs/pull/365033

Posting result comment on https://github.com/NixOS/nixpkgs/pull/365033

$ /nix/store/c4kw7qpffsq7vd6brwgkfnglvj85ivqk-nix-2.24.11/bin/nix-shell --argstr local-system aarch64-darwin --argstr nixpkgs-path /Users/rodrigo/.cache/nixpkgs-review/pr-365033-5/nixpkgs --argstr nixpkgs-config-path /var/folders/by/9xt1lyys0qvds8zzbx60c58m0000gn/T/tmpn9m2a4bs.nix --argstr attrs-path /Users/rodrigo/.cache/nixpkgs-review/pr-365033-5/attrs.nix --nix-path 'nixpkgs=/Users/rodrigo/.cache/nixpkgs-review/pr-365033-5/nixpkgs nixpkgs-overlays=/var/folders/by/9xt1lyys0qvds8zzbx60c58m0000gn/T/tmpc3n6y285' /nix/store/w1hgvm5rb3rblya8if90cdx5lvwyf4wc-nixpkgs-review-2.12.0/lib/python3.12/site-packages/nixpkgs_review/nix/review-shell.nix

[nix-shell:~/.cache/nixpkgs-review/pr-365033-5]$

@rodfersou
Copy link

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 365033

@rodfersou
Copy link

@aviallon I'm confused, not sure if it's working

@aviallon aviallon force-pushed the feature/rework-whisper-cpp branch from d97db76 to 27a56b6 Compare January 21, 2025 17:21
@rodfersou
Copy link

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 365033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: clean-up 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
8 participants