-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Description
Hi,
whisper.cpp is great for me as a mac user and Ruby binding is also great as a Rubyist. Thank you so much.
I found gem install whispercpp
fails on my machine and I investigated what happened. I needed some fixes for extconf.rb
:
diff --git a/bindings/ruby/ext/extconf.rb b/bindings/ruby/ext/extconf.rb
index 5518928..aec1f0d 100644
--- a/bindings/ruby/ext/extconf.rb
+++ b/bindings/ruby/ext/extconf.rb
@@ -1,19 +1,20 @@
require 'mkmf'
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','whisper.cpp')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','whisper.h')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml.h')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml.c')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-impl.h')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-aarch64.h')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-aarch64.c')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-alloc.h')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-alloc.c')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-backend-impl.h')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-backend.h')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-backend.cpp')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-common.h')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-quants.h')} .")
-system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-quants.c')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','src','whisper.cpp')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','include','whisper.h')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','include','ggml.h')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','src','ggml.c')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','src','ggml-impl.h')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','src','ggml-aarch64.h')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','src','ggml-aarch64.c')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','include','ggml-alloc.h')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','src','ggml-alloc.c')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','src','ggml-backend-impl.h')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','include','ggml-backend.h')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','src','ggml-backend.cpp')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','src','ggml-common.h')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','src','ggml-quants.h')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','src','ggml-quants.c')} .")
+system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml','src','ggml-cpu-impl.h')} .")
system("cp #{File.join(File.dirname(__FILE__),'..','..','..','examples','dr_wav.h')} .")
That's almost good, but one problem remains:
% uname -a
Darwin XXX 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:37:13 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T8112 arm64
% ruby -v
ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [arm64-darwin23]
% ruby extconf.rb
creating Makefile
source files duplication - ggml-backend.{c,cpp}
Which should I choose C or C++ source file for ggml-backend
? It seems C++ source is suitable because the compile fails if I remove ggml-backend.cpp
. But, I'm not familiar with C and C++, so I'm not sure.
Thanks.
Metadata
Metadata
Assignees
Labels
No labels