Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add library versioning #1352

Merged
merged 2 commits into from
Mar 4, 2024
Merged

Conversation

kenneth-ge
Copy link
Contributor

This pull request adds library versioning to whisper.cpp.

This is important so applications and distributors can determine when the ABI has changed and see whether the application needs to be recompiled. That way, we can safely compile and use a shared library in other applications and make some guarantees about the shared library's stability.

If library versioning were to be added and maintained (specifically the SOVERSION), this would allow work to start on integrating whisper.cpp into e.g. Gnome Desktop, where it is desperately needed to increase accessibility

…ibutors can determine when the ABI has changed and see whether the application needs to be recompiled. Thus, we can safely compile and use a shared library given its build information
@ggerganov
Copy link
Owner

Thanks, just to make sure I understand: I have to bump the SOVERSION every time there is a backward incompatible change in whisper.h, is this correct?

@petterreinholdtsen
Copy link
Contributor

Yes, that is correct. With VERSION 1.0.0 and SOVERSION 1, the library name will look like this:

lrwxrwxrwx 1 pere pere     15 feb.  22 09:24 libwhisper.so -> libwhisper.so.1
lrwxrwxrwx 1 pere pere     19 feb.  22 09:24 libwhisper.so.1 -> libwhisper.so.1.0.0
-rwxr-xr-x 1 pere pere 985104 feb.  22 09:24 libwhisper.so.1.0.0

The binaries linking with -lwhisper will list "libwhisper.1" in their binary, and when the library become backwards incompatible and switch to major number 2, newly created binaries will list "libwhisper.2" and both sets of binaries will keep working.

@petterreinholdtsen
Copy link
Contributor

https://cmake.org/cmake/help/latest/prop_tgt/SOVERSION.html and https://www.netfort.gr.jp/~dancer/column/libpkg-guide/libpkg-guide.html have more information than you need about handling shared libraries.

@kenneth-ge
Copy link
Contributor Author

Thanks, just to make sure I understand: I have to bump the SOVERSION every time there is a backward incompatible change in whisper.h, is this correct?

Yep! That is correct

@ggerganov ggerganov merged commit ccd7c1d into ggerganov:master Mar 4, 2024
45 of 46 checks passed
jiahansu pushed a commit to WiseSync/whisper.cpp that referenced this pull request Apr 17, 2024
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
viktor-silakov pushed a commit to viktor-silakov/whisper_node_mic.cpp that referenced this pull request May 11, 2024
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
iThalay pushed a commit to iThalay/whisper.cpp that referenced this pull request Sep 23, 2024
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
iThalay pushed a commit to iThalay/whisper.cpp that referenced this pull request Sep 23, 2024
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants