bergamot-translator icon indicating copy to clipboard operation
bergamot-translator copied to clipboard

Compile to .so file and install headers

Open kpu opened this issue 2 years ago • 4 comments

KDE is asking us to be a proper library not just a submodule.

kpu avatar Aug 09 '23 09:08 kpu

I did a quick hack that compiles a shared library, a few problems.

  1. problem is that, marian is hardcoded to link to static MKL, so we have a rather large shared library, same with CUDA. (Although we could argue here that we do not want CUDA).
% strip libbergamot-translator.so 
% du -hcs libbergamot-translator.so 
31M     libbergamot-translator.so
31M     total
% ldd libbergamot-translator.so 
        linux-vdso.so.1 (0x00007ffc77d3b000)
        libtcmalloc_minimal.so.4 => /usr/lib/libtcmalloc_minimal.so.4 (0x00007f2868226000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f2867e00000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007f286a338000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f286a313000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007f2867a00000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007f286a469000)
  1. We really need to clean our headers if we want to be a proper library with headers to install.

XapaJIaMnu avatar Aug 14 '23 15:08 XapaJIaMnu

Hello, There is a progress about this issue ? :)

Thanks a lot. Regards

Montel avatar Oct 02 '23 05:10 Montel

Hi @Montel , We've looked and identified the necessary steps and it requires quite a big rewrite of the underlying build logic for marian and of our headers ;/ It's on the menu, but noone is working on it actively in the moment. PRs are welcome.

XapaJIaMnu avatar Oct 02 '23 16:10 XapaJIaMnu

To be clear, we only need to install public headers. And part of the point of bergamot-translator is that it the public headers are relatively limited.

kpu avatar Oct 02 '23 22:10 kpu