How to identify system shared libraries?












2















My software tool has some external dependencies. I am distributing it as a conda package for linux64 with precompiled dependencies including shared libraries. Unfortunately I don't know how to recognize the system libraries from the software-specific ones. I think distributing libs like libc is not necessary and even should be avoided, because different Linux distros can have specific versions of some system libs.



I am using this simple oneliner to export shared libs (source):



$ ldd file | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' /destination


For example, these are the shared libs for Tesseract software:



$ ldd tesseract.bin 
linux-vdso.so.1 => (0x00007ffff4bc7000)
libtesseract.so.4 => not found
liblept.so.5 => not found
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0ad8bf3000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0ad89dc000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0ad8615000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0ad830a000)
/lib64/ld-linux-x86-64.so.2 (0x0000563cf6115000)


As you can see, only libtesseract.so.4 and liblept.so.5 are software-specific libs (not found because they aren't in LD_LIBRARY_PATH).



So is there any way to recognize the system shared libraries? I can check if they are in /lib, but is this always true? Are there only system libs so they can't be somewhere else?










share|improve this question

























  • Why don't you link this statically?

    – rudimeier
    May 8 '17 at 12:47






  • 1





    /lib depends on how exotic the Linux is; NixOS for example has no /lib (nor /lib64) directory. You could try asking the ports or package system, I guess, to see if something belongs to a known port or package...

    – thrig
    May 8 '17 at 14:44











  • @rudimeier That's the best solution, but unfortunately it's very complicated (even impossible) in case of some libs. I have tried that.

    – jirinovo
    May 8 '17 at 15:15













  • @thrig My distro is Ubuntu which si following the File System Hierarchy Standard. But according to this /lib contains libs needed for boot and for binaries in /bin. So I think not all the system libs are there. On the other hand if I filter libs located there, I should filter most of the system libs and the rest can be checked manually.

    – jirinovo
    May 8 '17 at 15:22
















2















My software tool has some external dependencies. I am distributing it as a conda package for linux64 with precompiled dependencies including shared libraries. Unfortunately I don't know how to recognize the system libraries from the software-specific ones. I think distributing libs like libc is not necessary and even should be avoided, because different Linux distros can have specific versions of some system libs.



I am using this simple oneliner to export shared libs (source):



$ ldd file | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' /destination


For example, these are the shared libs for Tesseract software:



$ ldd tesseract.bin 
linux-vdso.so.1 => (0x00007ffff4bc7000)
libtesseract.so.4 => not found
liblept.so.5 => not found
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0ad8bf3000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0ad89dc000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0ad8615000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0ad830a000)
/lib64/ld-linux-x86-64.so.2 (0x0000563cf6115000)


As you can see, only libtesseract.so.4 and liblept.so.5 are software-specific libs (not found because they aren't in LD_LIBRARY_PATH).



So is there any way to recognize the system shared libraries? I can check if they are in /lib, but is this always true? Are there only system libs so they can't be somewhere else?










share|improve this question

























  • Why don't you link this statically?

    – rudimeier
    May 8 '17 at 12:47






  • 1





    /lib depends on how exotic the Linux is; NixOS for example has no /lib (nor /lib64) directory. You could try asking the ports or package system, I guess, to see if something belongs to a known port or package...

    – thrig
    May 8 '17 at 14:44











  • @rudimeier That's the best solution, but unfortunately it's very complicated (even impossible) in case of some libs. I have tried that.

    – jirinovo
    May 8 '17 at 15:15













  • @thrig My distro is Ubuntu which si following the File System Hierarchy Standard. But according to this /lib contains libs needed for boot and for binaries in /bin. So I think not all the system libs are there. On the other hand if I filter libs located there, I should filter most of the system libs and the rest can be checked manually.

    – jirinovo
    May 8 '17 at 15:22














2












2








2


1






My software tool has some external dependencies. I am distributing it as a conda package for linux64 with precompiled dependencies including shared libraries. Unfortunately I don't know how to recognize the system libraries from the software-specific ones. I think distributing libs like libc is not necessary and even should be avoided, because different Linux distros can have specific versions of some system libs.



I am using this simple oneliner to export shared libs (source):



$ ldd file | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' /destination


For example, these are the shared libs for Tesseract software:



$ ldd tesseract.bin 
linux-vdso.so.1 => (0x00007ffff4bc7000)
libtesseract.so.4 => not found
liblept.so.5 => not found
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0ad8bf3000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0ad89dc000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0ad8615000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0ad830a000)
/lib64/ld-linux-x86-64.so.2 (0x0000563cf6115000)


As you can see, only libtesseract.so.4 and liblept.so.5 are software-specific libs (not found because they aren't in LD_LIBRARY_PATH).



So is there any way to recognize the system shared libraries? I can check if they are in /lib, but is this always true? Are there only system libs so they can't be somewhere else?










share|improve this question
















My software tool has some external dependencies. I am distributing it as a conda package for linux64 with precompiled dependencies including shared libraries. Unfortunately I don't know how to recognize the system libraries from the software-specific ones. I think distributing libs like libc is not necessary and even should be avoided, because different Linux distros can have specific versions of some system libs.



I am using this simple oneliner to export shared libs (source):



$ ldd file | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' /destination


For example, these are the shared libs for Tesseract software:



$ ldd tesseract.bin 
linux-vdso.so.1 => (0x00007ffff4bc7000)
libtesseract.so.4 => not found
liblept.so.5 => not found
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0ad8bf3000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0ad89dc000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0ad8615000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0ad830a000)
/lib64/ld-linux-x86-64.so.2 (0x0000563cf6115000)


As you can see, only libtesseract.so.4 and liblept.so.5 are software-specific libs (not found because they aren't in LD_LIBRARY_PATH).



So is there any way to recognize the system shared libraries? I can check if they are in /lib, but is this always true? Are there only system libs so they can't be somewhere else?







dynamic-linking shared-library software-distribution






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 hours ago









Rui F Ribeiro

41.5k1483140




41.5k1483140










asked May 8 '17 at 12:27









jirinovojirinovo

1383




1383













  • Why don't you link this statically?

    – rudimeier
    May 8 '17 at 12:47






  • 1





    /lib depends on how exotic the Linux is; NixOS for example has no /lib (nor /lib64) directory. You could try asking the ports or package system, I guess, to see if something belongs to a known port or package...

    – thrig
    May 8 '17 at 14:44











  • @rudimeier That's the best solution, but unfortunately it's very complicated (even impossible) in case of some libs. I have tried that.

    – jirinovo
    May 8 '17 at 15:15













  • @thrig My distro is Ubuntu which si following the File System Hierarchy Standard. But according to this /lib contains libs needed for boot and for binaries in /bin. So I think not all the system libs are there. On the other hand if I filter libs located there, I should filter most of the system libs and the rest can be checked manually.

    – jirinovo
    May 8 '17 at 15:22



















  • Why don't you link this statically?

    – rudimeier
    May 8 '17 at 12:47






  • 1





    /lib depends on how exotic the Linux is; NixOS for example has no /lib (nor /lib64) directory. You could try asking the ports or package system, I guess, to see if something belongs to a known port or package...

    – thrig
    May 8 '17 at 14:44











  • @rudimeier That's the best solution, but unfortunately it's very complicated (even impossible) in case of some libs. I have tried that.

    – jirinovo
    May 8 '17 at 15:15













  • @thrig My distro is Ubuntu which si following the File System Hierarchy Standard. But according to this /lib contains libs needed for boot and for binaries in /bin. So I think not all the system libs are there. On the other hand if I filter libs located there, I should filter most of the system libs and the rest can be checked manually.

    – jirinovo
    May 8 '17 at 15:22

















Why don't you link this statically?

– rudimeier
May 8 '17 at 12:47





Why don't you link this statically?

– rudimeier
May 8 '17 at 12:47




1




1





/lib depends on how exotic the Linux is; NixOS for example has no /lib (nor /lib64) directory. You could try asking the ports or package system, I guess, to see if something belongs to a known port or package...

– thrig
May 8 '17 at 14:44





/lib depends on how exotic the Linux is; NixOS for example has no /lib (nor /lib64) directory. You could try asking the ports or package system, I guess, to see if something belongs to a known port or package...

– thrig
May 8 '17 at 14:44













@rudimeier That's the best solution, but unfortunately it's very complicated (even impossible) in case of some libs. I have tried that.

– jirinovo
May 8 '17 at 15:15







@rudimeier That's the best solution, but unfortunately it's very complicated (even impossible) in case of some libs. I have tried that.

– jirinovo
May 8 '17 at 15:15















@thrig My distro is Ubuntu which si following the File System Hierarchy Standard. But according to this /lib contains libs needed for boot and for binaries in /bin. So I think not all the system libs are there. On the other hand if I filter libs located there, I should filter most of the system libs and the rest can be checked manually.

– jirinovo
May 8 '17 at 15:22





@thrig My distro is Ubuntu which si following the File System Hierarchy Standard. But according to this /lib contains libs needed for boot and for binaries in /bin. So I think not all the system libs are there. On the other hand if I filter libs located there, I should filter most of the system libs and the rest can be checked manually.

– jirinovo
May 8 '17 at 15:22










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f363699%2fhow-to-identify-system-shared-libraries%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f363699%2fhow-to-identify-system-shared-libraries%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

濃尾地震

How to rewrite equation of hyperbola in standard form

No ethernet ip address in my vocore2