livekit / python-sdks

LiveKit real-time and server SDKs for Python

Home Page:https://docs.livekit.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

whisper example: linking issue

mcantillon21 opened this issue · comments

g++ -O3 -std=c++11 -pthread --shared -fPIC -static-libstdc++ whisper.cpp ggml.o -o libwhisper.so

This line gives a linking error. I'm on a Mac, in whisper.cpp folder and ran the previous command successfully. In fact, if I split it up into

g++ -O3 -std=c++11 -pthread -fPIC -c whisper.cpp -o whisper.o
g++ -pthread --shared -static-libstdc++ whisper.o ggml.o -o libwhisper.so

Only the second line fails with
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Hey, is it possible to get more verbose logs?

Yep here is what I got:

(base) mc@MacBook-Air-8 whisper.cpp % g++ -O3 -std=c++11 -pthread --shared -fPIC -static-libstdc++ whisper.cpp ggml.o -o libwhisper.so clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument] ld: Undefined symbols: _dequantize_row_iq2_xs, referenced from: _type_traits in ggml.o _dequantize_row_iq2_xxs, referenced from: _type_traits in ggml.o _dequantize_row_q2_K, referenced from: _type_traits in ggml.o _dequantize_row_q3_K, referenced from: _type_traits in ggml.o _dequantize_row_q4_0, referenced from: _type_traits in ggml.o _dequantize_row_q4_1, referenced from: _type_traits in ggml.o _dequantize_row_q4_K, referenced from: _type_traits in ggml.o _dequantize_row_q5_0, referenced from: _type_traits in ggml.o _dequantize_row_q5_1, referenced from: _type_traits in ggml.o _dequantize_row_q5_K, referenced from: _type_traits in ggml.o _dequantize_row_q6_K, referenced from: _type_traits in ggml.o _dequantize_row_q8_0, referenced from: _type_traits in ggml.o _ggml_allocr_alloc, referenced from: kv_cache_init(whisper_hparams const&, whisper_kv_cache&, ggml_backend*, ggml_type, int) in whisper-d896aa.o kv_cache_init(whisper_hparams const&, whisper_kv_cache&, ggml_backend*, ggml_type, int) in whisper-d896aa.o whisper_model_load(whisper_model_loader*, whisper_context&) in whisper-d896aa.o whisper_build_graph_conv(whisper_context&, whisper_state&, int) in whisper-d896aa.o whisper_build_graph_decoder(whisper_context&, whisper_state&, whisper_batch const&) in whisper-d896aa.o whisper_build_graph_decoder(whisper_context&, whisper_state&, whisper_batch const&) in whisper-d896aa.o whisper_build_graph_decoder(whisper_context&, whisper_state&, whisper_batch const&) in whisper-d896aa.o ... _ggml_allocr_alloc_graph, referenced from: whisper_allocr_graph_init(whisper_allocr&, ggml_backend*, std::__1::function<ggml_cgraph* ()>&&) in whisper-d896aa.o whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_decode_internal(whisper_context&, whisper_state&, whisper_batch const&, int, bool (*)(void*), void*) in whisper-d896aa.o _ggml_allocr_free, referenced from: _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o kv_cache_init(whisper_hparams const&, whisper_kv_cache&, ggml_backend*, ggml_type, int) in whisper-d896aa.o whisper_model_load(whisper_model_loader*, whisper_context&) in whisper-d896aa.o _whisper_free_state in whisper-d896aa.o _whisper_free_state in whisper-d896aa.o _whisper_free_state in whisper-d896aa.o _whisper_free_state in whisper-d896aa.o ... _ggml_allocr_is_measure, referenced from: whisper_build_graph_conv(whisper_context&, whisper_state&, int) in whisper-d896aa.o whisper_build_graph_decoder(whisper_context&, whisper_state&, whisper_batch const&) in whisper-d896aa.o whisper_build_graph_decoder(whisper_context&, whisper_state&, whisper_batch const&) in whisper-d896aa.o whisper_build_graph_decoder(whisper_context&, whisper_state&, whisper_batch const&) in whisper-d896aa.o whisper_build_graph_decoder(whisper_context&, whisper_state&, whisper_batch const&) in whisper-d896aa.o whisper_build_graph_decoder(whisper_context&, whisper_state&, whisper_batch const&) in whisper-d896aa.o _ggml_allocr_max_size, referenced from: _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o ... _ggml_allocr_new_from_buffer, referenced from: _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o kv_cache_init(whisper_hparams const&, whisper_kv_cache&, ggml_backend*, ggml_type, int) in whisper-d896aa.o whisper_model_load(whisper_model_loader*, whisper_context&) in whisper-d896aa.o _ggml_allocr_new_measure_from_backend, referenced from: whisper_allocr_graph_init(whisper_allocr&, ggml_backend*, std::__1::function<ggml_cgraph* ()>&&) in whisper-d896aa.o _ggml_allocr_reset, referenced from: whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_decode_internal(whisper_context&, whisper_state&, whisper_batch const&, int, bool (*)(void*), void*) in whisper-d896aa.o _ggml_backend_alloc_buffer, referenced from: _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o _whisper_init_state in whisper-d896aa.o kv_cache_init(whisper_hparams const&, whisper_kv_cache&, ggml_backend*, ggml_type, int) in whisper-d896aa.o whisper_model_load(whisper_model_loader*, whisper_context&) in whisper-d896aa.o _ggml_backend_buffer_free, referenced from: _whisper_free in whisper-d896aa.o _whisper_free_state in whisper-d896aa.o _whisper_free_state in whisper-d896aa.o _whisper_free_state in whisper-d896aa.o _whisper_free_state in whisper-d896aa.o _whisper_free_state in whisper-d896aa.o _whisper_free_state in whisper-d896aa.o ... _ggml_backend_cpu_init, referenced from: _whisper_init_state in whisper-d896aa.o whisper_model_load(whisper_model_loader*, whisper_context&) in whisper-d896aa.o _ggml_backend_cpu_set_n_threads, referenced from: whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_decode_internal(whisper_context&, whisper_state&, whisper_batch const&, int, bool (*)(void*), void*) in whisper-d896aa.o _ggml_backend_free, referenced from: _whisper_free in whisper-d896aa.o _whisper_free_state in whisper-d896aa.o _ggml_backend_graph_compute, referenced from: whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_decode_internal(whisper_context&, whisper_state&, whisper_batch const&, int, bool (*)(void*), void*) in whisper-d896aa.o _ggml_backend_is_cpu, referenced from: whisper_model_load(whisper_model_loader*, whisper_context&) in whisper-d896aa.o whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_encode_internal(whisper_context&, whisper_state&, int, int, bool (*)(void*), void*) in whisper-d896aa.o whisper_decode_internal(whisper_context&, whisper_state&, whisper_batch const&, int, bool (*)(void*), void*) in whisper-d896aa.o _ggml_backend_name, referenced from: whisper_model_load(whisper_model_loader*, whisper_context&) in whisper-d896aa.o _ggml_backend_tensor_get, referenced from: whisper_decode_internal(whisper_context&, whisper_state&, whisper_batch const&, int, bool (*)(void*), void*) in whisper-d896aa.o _ggml_backend_tensor_set, referenced from: whisper_model_load(whisper_model_loader*, whisper_context&) in whisper-d896aa.o whisper_build_graph_conv(whisper_context&, whisper_state&, int) in whisper-d896aa.o whisper_build_graph_decoder(whisper_context&, whisper_state&, whisper_batch const&) in whisper-d896aa.o whisper_build_graph_decoder(whisper_context&, whisper_state&, whisper_batch const&) in whisper-d896aa.o whisper_build_graph_decoder(whisper_context&, whisper_state&, whisper_batch const&) in whisper-d896aa.o _ggml_quantize_iq2_xs, referenced from: _ggml_quantize_chunk in ggml.o _ggml_quantize_iq2_xxs, referenced from: _ggml_quantize_chunk in ggml.o _ggml_quantize_q2_K, referenced from: _ggml_quantize_chunk in ggml.o _ggml_quantize_q3_K, referenced from: _ggml_quantize_chunk in ggml.o _ggml_quantize_q4_K, referenced from: _ggml_quantize_chunk in ggml.o _ggml_quantize_q5_K, referenced from: _ggml_quantize_chunk in ggml.o _ggml_quantize_q6_K, referenced from: _ggml_quantize_chunk in ggml.o _ggml_vec_dot_iq2_xs_q8_K, referenced from: _type_traits in ggml.o _ggml_vec_dot_iq2_xxs_q8_K, referenced from: _type_traits in ggml.o _ggml_vec_dot_q2_K_q8_K, referenced from: _type_traits in ggml.o _ggml_vec_dot_q3_K_q8_K, referenced from: _type_traits in ggml.o _ggml_vec_dot_q4_0_q8_0, referenced from: _type_traits in ggml.o _ggml_vec_dot_q4_1_q8_1, referenced from: _type_traits in ggml.o _ggml_vec_dot_q4_K_q8_K, referenced from: _type_traits in ggml.o _ggml_vec_dot_q5_0_q8_0, referenced from: _type_traits in ggml.o _ggml_vec_dot_q5_1_q8_1, referenced from: _type_traits in ggml.o _ggml_vec_dot_q5_K_q8_K, referenced from: _type_traits in ggml.o _ggml_vec_dot_q6_K_q8_K, referenced from: _type_traits in ggml.o _ggml_vec_dot_q8_0_q8_0, referenced from: _type_traits in ggml.o _quantize_row_iq2_xs, referenced from: _type_traits in ggml.o _quantize_row_iq2_xs_reference, referenced from: _type_traits in ggml.o _quantize_row_iq2_xxs, referenced from: _type_traits in ggml.o _quantize_row_iq2_xxs_reference, referenced from: _type_traits in ggml.o _quantize_row_q2_K, referenced from: _type_traits in ggml.o _quantize_row_q2_K_reference, referenced from: _type_traits in ggml.o _quantize_row_q3_K, referenced from: _type_traits in ggml.o _quantize_row_q3_K_reference, referenced from: _type_traits in ggml.o _quantize_row_q4_0, referenced from: _type_traits in ggml.o _quantize_row_q4_0_reference, referenced from: _ggml_quantize_q4_0 in ggml.o _ggml_quantize_q4_0 in ggml.o _type_traits in ggml.o _quantize_row_q4_1, referenced from: _type_traits in ggml.o _quantize_row_q4_1_reference, referenced from: _ggml_quantize_q4_1 in ggml.o _ggml_quantize_q4_1 in ggml.o _type_traits in ggml.o _quantize_row_q4_K, referenced from: _type_traits in ggml.o _quantize_row_q4_K_reference, referenced from: _type_traits in ggml.o _quantize_row_q5_0, referenced from: _type_traits in ggml.o _quantize_row_q5_0_reference, referenced from: _ggml_quantize_q5_0 in ggml.o _ggml_quantize_q5_0 in ggml.o _type_traits in ggml.o _quantize_row_q5_1, referenced from: _type_traits in ggml.o _quantize_row_q5_1_reference, referenced from: _ggml_quantize_q5_1 in ggml.o _ggml_quantize_q5_1 in ggml.o _type_traits in ggml.o _quantize_row_q5_K, referenced from: _type_traits in ggml.o _quantize_row_q5_K_reference, referenced from: _type_traits in ggml.o _quantize_row_q6_K, referenced from: _type_traits in ggml.o _quantize_row_q6_K_reference, referenced from: _type_traits in ggml.o _quantize_row_q8_0, referenced from: _type_traits in ggml.o _quantize_row_q8_0_reference, referenced from: _ggml_quantize_q8_0 in ggml.o _ggml_quantize_q8_0 in ggml.o _type_traits in ggml.o _quantize_row_q8_1, referenced from: _type_traits in ggml.o _quantize_row_q8_1_reference, referenced from: _type_traits in ggml.o _quantize_row_q8_K, referenced from: _type_traits in ggml.o clang: error: linker command failed with exit code 1 (use -v to see invocation)

Hey, the code from whisper.cpp changed, we were not maintaining this example. Although we have plan to add a local whisper implementation to our new agents framework