is it possible to compile with static option?

239 views
Skip to first unread message

Yu Beomgon

unread,
Aug 12, 2019, 3:44:08 AM8/12/19
to kaldi-help


in the kaldi/src, 
if I configure with --shared option, 
then binary use shared lib.

If I configure with --static option, then there is no shared lib regarding kaldi src.
But still other general library is shared.

Can I change this all to static? 

        linux-vdso.so.1 (0x00007fffc6ad3000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc2fd9ed000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc2fd7ce000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc2fd430000)
        libcublas.so.10.0 => /usr/local/cuda/lib64/libcublas.so.10.0 (0x00007fc2f8e9a000)
        libcusparse.so.10.0 => /usr/local/cuda/lib64/libcusparse.so.10.0 (0x00007fc2f5432000)
        libcudart.so.10.0 => /usr/local/cuda/lib64/libcudart.so.10.0 (0x00007fc2f51b8000)
        libcurand.so.10.0 => /usr/local/cuda/lib64/libcurand.so.10.0 (0x00007fc2f1051000)
        libcusolver.so.10.0 => /usr/local/cuda/lib64/libcusolver.so.10.0 (0x00007fc2e896a000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc2e85e1000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc2e83c9000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc2e7fd8000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc301ba3000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fc2e7dd0000)

Daniel Povey

unread,
Aug 13, 2019, 1:23:32 AM8/13/19
to kaldi-help
There isn't an option in the `configure` script to link in those libraries into the binary.  I suspect the binaries would grow quite large if you did.
Probably the easiest way to do this, if you wanted a statically linked version of one particular binary, is just to remove and then `make` it to find the link line (the one that has `-o <binary-name>`), and manually edit the link line, adding in the .a files and removing the -lcudart or whatever directives to dynamically link those libraries are in that line.

Dan


--
Go to http://kaldi-asr.org/forums.html find out how to join
---
You received this message because you are subscribed to the Google Groups "kaldi-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kaldi-help+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kaldi-help/6f703e1d-aff1-415f-9d0f-6e44125239c9%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages