{"id":1905,"date":"2010-10-25T22:12:52","date_gmt":"2010-10-26T05:12:52","guid":{"rendered":"http:\/\/arcanius.silverfir.net\/blog\/?p=1905"},"modified":"2014-03-02T16:30:01","modified_gmt":"2014-03-03T00:30:01","slug":"where-is-the-missing-library-supposed-to-live","status":"publish","type":"post","link":"https:\/\/arcanius.silverfir.net\/blog\/where-is-the-missing-library-supposed-to-live\/","title":{"rendered":"Where is the missing library supposed to live?"},"content":{"rendered":"<p>For about a month, I was living with a constant stream of warnings whenever I ran a common command at work. While it didn&#8217;t make me less productive, since it didn&#8217;t affect any functionality I needed, it annoyed me and it bothered me that I didn&#8217;t know how to fix it the right way. The error I was getting was a warning about a dynamic library not able to be loaded even though the library existed on the system. Furthermore, when I ran `ldd` on the binary, the dynamic library wasn&#8217;t listed.<\/p>\n<p>A quick hack was to find the library and set LD_LIBRARY_PATH to override the normal include paths. However, this didn&#8217;t work for automated scripts run from cron without some wrapper to set up the environment, and it felt very hacky anyway. What I wanted to do is find where the system was looking for the library that it couldn&#8217;t find so I could put the library in the right place (or at least set up a symlink).<\/p>\n<p>Today, I decided to figure it out, and through some searching I came across this <a href=\"http:\/\/www.eyrie.org\/~eagle\/notes\/rpath.html\">treasure trove<\/a> that exactly explained the problem and the solution.\u00c2\u00a0 Basically, the issue is that linux binaries (including libraries) have an rpath where they look for their shared objects. Setting LD_LIBRARY_PATH overrides this, but as I said, it&#8217;s a hack. To figure out the rpath, simply run:<\/p>\n<p><code>readelf -d &lt;path\/to\/binary&gt; | grep RPATH<\/code><\/p>\n<p>You can run this on any executable or library, so even if a library includes another library, you can just follow the path down until you find where the system is looking for the missing library and fix the problem.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For about a month, I was living with a constant stream of warnings whenever I ran a common command at work. While it didn&#8217;t make me less productive, since it didn&#8217;t affect any functionality I needed, it annoyed me and it bothered me that I didn&#8217;t know how to fix it the right way. The [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[8],"class_list":["post-1905","post","type-post","status-publish","format-standard","hentry","category-everything","tag-technology"],"_links":{"self":[{"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/posts\/1905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/comments?post=1905"}],"version-history":[{"count":4,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/posts\/1905\/revisions"}],"predecessor-version":[{"id":2063,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/posts\/1905\/revisions\/2063"}],"wp:attachment":[{"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/media?parent=1905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/categories?post=1905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/tags?post=1905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}