2023-02-15 17:46:55 +00:00
|
|
|
require 'mkmf'
|
|
|
|
system("cp #{File.join(File.dirname(__FILE__),'..','..','..','whisper.cpp')} .")
|
|
|
|
system("cp #{File.join(File.dirname(__FILE__),'..','..','..','whisper.h')} .")
|
2024-06-04 06:32:23 +00:00
|
|
|
system("cp #{File.join(File.dirname(__FILE__),'..','..','..','whisper-mel.hpp')} .")
|
2023-02-15 17:46:55 +00:00
|
|
|
system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml.h')} .")
|
|
|
|
system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml.c')} .")
|
2023-11-03 19:35:05 +00:00
|
|
|
system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-impl.h')} .")
|
2023-09-18 13:15:45 +00:00
|
|
|
system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-alloc.h')} .")
|
|
|
|
system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-alloc.c')} .")
|
2023-11-03 19:35:05 +00:00
|
|
|
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.c')} .")
|
2024-03-21 05:40:09 +00:00
|
|
|
system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-common.h')} .")
|
2023-11-03 19:35:05 +00:00
|
|
|
system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-quants.h')} .")
|
|
|
|
system("cp #{File.join(File.dirname(__FILE__),'..','..','..','ggml-quants.c')} .")
|
2023-02-15 17:46:55 +00:00
|
|
|
system("cp #{File.join(File.dirname(__FILE__),'..','..','..','examples','dr_wav.h')} .")
|
|
|
|
|
|
|
|
|
|
|
|
# need to use c++ compiler flags
|
|
|
|
$CXXFLAGS << ' -std=c++11'
|
|
|
|
# Set to true when building binary gems
|
|
|
|
if enable_config('static-stdlib', false)
|
|
|
|
$LDFLAGS << ' -static-libgcc -static-libstdc++'
|
|
|
|
end
|
|
|
|
|
|
|
|
if enable_config('march-tune-native', false)
|
|
|
|
$CFLAGS << ' -march=native -mtune=native'
|
|
|
|
$CXXFLAGS << ' -march=native -mtune=native'
|
|
|
|
end
|
|
|
|
|
|
|
|
create_makefile('whisper')
|