thewh1teagle / pyannote-rs

pyannote audio diarization in rust
http://crates.io/crates/pyannote-rs
MIT License
32 stars 3 forks source link

versions 2.6, 2.5, 2.4 are not working: linking with `link.exe` failed: exit code: 1169 #5

Closed altunenes closed 3 months ago

altunenes commented 3 months ago

2.2 and 2.3 is working without any problem. but those versions always give this annoying error.

  = note: libknf_rs_sys-06335456e6c7c9ad.rlib(knfc.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          libknf_rs_sys-06335456e6c7c9ad.rlib(feature-fbank.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          libknf_rs_sys-06335456e6c7c9ad.rlib(online-feature.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          libknf_rs_sys-06335456e6c7c9ad.rlib(feature-window.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          libknf_rs_sys-06335456e6c7c9ad.rlib(mel-computations.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          libknf_rs_sys-06335456e6c7c9ad.rlib(rfft.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          libknf_rs_sys-06335456e6c7c9ad.rlib(feature-functions.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          libknf_rs_sys-06335456e6c7c9ad.rlib(kaldi-math.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          libknf_rs_sys-06335456e6c7c9ad.rlib(feature-mfcc.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          libknf_rs_sys-06335456e6c7c9ad.rlib(whisper-feature.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          msvcprt.lib(MSVCP140.dll) : error LNK2005: "public: int __cdecl std::ios_base::flags(void)const " (?flags@ios_base@std@@QEBAHXZ) already defined in libcpmt.lib(locale.obj)
          msvcprt.lib(MSVCP140.dll) : error LNK2005: "public: __int64 __cdecl std::ios_base::width(void)const " (?width@ios_base@std@@QEBA_JXZ) already defined in libcpmt.lib(locale.obj)
          msvcprt.lib(MSVCP140.dll) : error LNK2005: "public: __int64 __cdecl std::ios_base::width(__int64)" (?width@ios_base@std@@QEAA_J_J@Z) already defined in libcpmt.lib(locale.obj)
          msvcprt.lib(MSVCP140.dll) : error LNK2005: "public: virtual __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::~basic_streambuf<char,struct std::char_traits<char> >(void)" (??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ) already defined in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          msvcprt.lib(MSVCP140.dll) : error LNK2005: "public: int __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z) already defined in libcpmt.lib(locale.obj)
          msvcprt.lib(MSVCP140.dll) : error LNK2005: "protected: char * __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::gptr(void)const " (?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ) already defined in libcpmt.lib(locale.obj)
          msvcprt.lib(MSVCP140.dll) : error LNK2005: "protected: char * __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::_Pninc(void)" (?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ) already defined in libcpmt.lib(locale.obj)
          msvcprt.lib(MSVCP140.dll) : error LNK2005: "public: virtual __cdecl std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)" (??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ) already defined in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          msvcprt.lib(MSVCP140.dll) : error LNK2005: "public: virtual __cdecl std::basic_ostream<char,struct std::char_traits<char> >::~basic_ostream<char,struct std::char_traits<char> >(void)" (??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ) already defined in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          msvcprt.lib(MSVCP140.dll) : error LNK2005: "public: void __cdecl std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ) already defined in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          msvcprt.lib(MSVCP140.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(float)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z) already defined in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          msvcprt.lib(MSVCP140.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ) already defined in libwhisper_rs_sys-c022e680e0e62b8d.rlib(whisper.obj)
          LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
          C:\Users\enes-\OneDrive\Masaüstü\test_vad2\target\debug\deps\test_vad2.exe : fatal error LNK1169: one or more multiply defined symbols found    

my current cargo file:

[dependencies]
eyre = "0.6.12"
hound = "3.5.1"
pyannote-rs = { version = "=0.2.6"}
rubato = "0.15.0"
whisper-rs = { git = "https://github.com/thewh1teagle/whisper-rs.git", branch = "v1.6.2", features = [
    "whisper-cpp-tracing",
] }
symphonia = "0.5.4"

when I look at the vibe's cargo file https://github.com/thewh1teagle/vibe/blob/main/core/Cargo.toml, I see you use 0.2.5 but no build error, strange...

thewh1teagle commented 3 months ago

The problem I had in Vibe is that ort link msvc statically by default but if cuda enabled it link it dynamic. Also whisper link it dynamic by default. And I discovered that Rust's standard is to link msvc dynamic. So I changed all the libraries to link it dynamic by default.

But I think in your end the issue is that you didn't updated whisper-rs (new commit) Run

cargo update -p whisper-rs

And then

cargo clean -p whisper-rs -p whisper-rs-sys

To control msvc linkage you can set KNF_STATIC_CRT or WHISPER_USE_STATIC_MSVC to 1 or 0 depending on the issue. (must clean their crates with -p name and rebuild)

altunenes commented 3 months ago

oh, interesting!
and thank you!!

thewh1teagle commented 3 months ago

Does it worked?

Related: https://github.com/pykeio/ort/issues/259

altunenes commented 3 months ago

yes its worked

altunenes commented 3 months ago

But I think I will continue with the sherpa-rs + pyannote anyway. I found it much better than whishper-rs thanks to you!

altunenes commented 3 months ago

seems this is fixed with a new ort also. can you update the ort? maybe this will make it even more stable with Whishper?

note that:

https://github.com/pykeio/ort/commit/069ddfdd2c1e8af0ea637ac40082ee176ebf870d ort now depends on ndarray 0.16.

https://github.com/pykeio/ort/discussions/266

thewh1teagle commented 3 months ago

I updated and released new version for pyannote-rs. At least we learned something new: stick to dynamic msvc link and match across all crates / libs.

altunenes commented 3 months ago

oh, thank you! didn't expect that you are too fast haha!

thewh1teagle commented 3 months ago

Thank you, appreciate!