membraneframework / membrane_core

The core of the Membrane Framework, advanced multimedia processing framework
https://membrane.stream
Apache License 2.0
1.22k stars 34 forks source link

[bundlex] Bundle whisper.cpp #832

Closed johns10 closed 6 days ago

johns10 commented 1 week ago

Team,

I'd like to write some bindings to whisper.cpp using bundlex. At this point, I think the best approach is to use their makefile on the target machine to build the .so file, and use that and the .h file to run the library.

My bundlex.exs looks like this:

defmodule TodoApp.BundlexProject do
  use Bundlex.Project

  def project() do
    [
      natives: natives(Bundlex.get_target())
    ]
  end

  defp natives(_platform) do
    [
      test: [
        interface: [:nif],
        sources: ["main.cpp"],
        libs: ["whisper"],
        lib_dirs: ["c_src/whisper/"],
        includes: ["c_src/whisper"],
        language: :cpp
      ]
    ]
  end
end

I put the entire whisper proejct in c_src/whisper, and ran make libwhisper.so and am trying to run with that tack. I'm cribbing from the agora_sdk example for this.

mat-hek commented 1 week ago

Hi there, I didn't get what's the problem here, can you elaborate? And out of curiosity, why not use Whisper via Bumblebee? ;)

johns10 commented 1 week ago

Because I'd like to use this on the client device. I haven't been able to get this to work. I have kind of bailed on this approach and am looking at elixir_make with raw make files.

mat-hek commented 6 days ago

Got it, that's tricky. I'm closing this then, feel free to reopen or just comment if you have any more thoughts.