Installing multiple versions of a shared library











up vote
1
down vote

favorite
2












I am running ubuntu 10.04 and I want to use tmux 1.6. tmux has a dependency on libevent 2.



My solution was to compile libevent2 and drop into /usr/local/lib then compile tmux against this lib and drop into /usr/local/bin. This works great until...I restart. This is just an assumption on my part but it seems that other binaries are now linking to the libevent2 library presumably because its on the library path. Because there are 60+ packages with libevent1 dependencies this causes my install to basically lose its mind.



Is there an idiomatic way to approach running an application that has a core library dependency on a different version? Should I just statically link the lib?










share|improve this question
























  • Check what's going on with ldd. Somewhere, you have a bad symbolic link or a misnamed file. Programs that require libevent2 should refer to libevent-2.
    – David Schwartz
    Jun 27 '12 at 14:37















up vote
1
down vote

favorite
2












I am running ubuntu 10.04 and I want to use tmux 1.6. tmux has a dependency on libevent 2.



My solution was to compile libevent2 and drop into /usr/local/lib then compile tmux against this lib and drop into /usr/local/bin. This works great until...I restart. This is just an assumption on my part but it seems that other binaries are now linking to the libevent2 library presumably because its on the library path. Because there are 60+ packages with libevent1 dependencies this causes my install to basically lose its mind.



Is there an idiomatic way to approach running an application that has a core library dependency on a different version? Should I just statically link the lib?










share|improve this question
























  • Check what's going on with ldd. Somewhere, you have a bad symbolic link or a misnamed file. Programs that require libevent2 should refer to libevent-2.
    – David Schwartz
    Jun 27 '12 at 14:37













up vote
1
down vote

favorite
2









up vote
1
down vote

favorite
2






2





I am running ubuntu 10.04 and I want to use tmux 1.6. tmux has a dependency on libevent 2.



My solution was to compile libevent2 and drop into /usr/local/lib then compile tmux against this lib and drop into /usr/local/bin. This works great until...I restart. This is just an assumption on my part but it seems that other binaries are now linking to the libevent2 library presumably because its on the library path. Because there are 60+ packages with libevent1 dependencies this causes my install to basically lose its mind.



Is there an idiomatic way to approach running an application that has a core library dependency on a different version? Should I just statically link the lib?










share|improve this question















I am running ubuntu 10.04 and I want to use tmux 1.6. tmux has a dependency on libevent 2.



My solution was to compile libevent2 and drop into /usr/local/lib then compile tmux against this lib and drop into /usr/local/bin. This works great until...I restart. This is just an assumption on my part but it seems that other binaries are now linking to the libevent2 library presumably because its on the library path. Because there are 60+ packages with libevent1 dependencies this causes my install to basically lose its mind.



Is there an idiomatic way to approach running an application that has a core library dependency on a different version? Should I just statically link the lib?







linux compile administration






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 16 '16 at 21:05









fixer1234

17.7k144581




17.7k144581










asked Jun 27 '12 at 14:32









nsfyn55

158110




158110












  • Check what's going on with ldd. Somewhere, you have a bad symbolic link or a misnamed file. Programs that require libevent2 should refer to libevent-2.
    – David Schwartz
    Jun 27 '12 at 14:37


















  • Check what's going on with ldd. Somewhere, you have a bad symbolic link or a misnamed file. Programs that require libevent2 should refer to libevent-2.
    – David Schwartz
    Jun 27 '12 at 14:37
















Check what's going on with ldd. Somewhere, you have a bad symbolic link or a misnamed file. Programs that require libevent2 should refer to libevent-2.
– David Schwartz
Jun 27 '12 at 14:37




Check what's going on with ldd. Somewhere, you have a bad symbolic link or a misnamed file. Programs that require libevent2 should refer to libevent-2.
– David Schwartz
Jun 27 '12 at 14:37










2 Answers
2






active

oldest

votes

















up vote
0
down vote













http://www.ibm.com/developerworks/linux/library/l-lpic1-v3-102-3/ suggests




Loading specific libraries



If you're running an older application that
needs a specific older version of a shared library, or if you're
developing a new shared library or version of a shared library, you
might want to override the default search paths used by the loader.
This may also be needed by scripts that use product-specific shared
libraries that may be installed in the /opt tree. Just as you can set
the PATH variable to specify a search path for executables, you can
set the LD_LIBRARY_PATH variable to a colon-separated list of
directories that should be searched for shared libraries before the
system ones specified in ld.so.cache. For example, you might use a
command like:



export LD_LIBRARY_PATH=/usr/lib/oldstuff:/opt/IBM/AgentController/lib




The article linked to illustrates how to use ldd to find out what libraries a program depends on.






share|improve this answer




























    up vote
    0
    down vote













    Compiled binary programs usually link against
    /usr/lib/libXXX.so.1.2.3



    If you use a specific new version you could drop it in /usr/lib/libXXX.so.3.4.5
    and your newly created program should link against this.



    You can actually check, whether old programs now link against the new lib by
    ldd /path/to/program.



    If this really happens, you can:




    • put the new lib into a separate directory /special/path/lib and

    • launch your special program with a wrapper shell script, that sets
      LD_LIBRARY_PATH=/special/path/lib:$LD_LIBRARY_PATH
      and then launches the binary or

    • if you compile your program yourself you might pass the LDFLAGS=-Wl,-rpath,/special/path/lib,
      this hardcodes the search path for the special lib into your program
      (nice because works without wrapper script)






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      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',
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      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%2fsuperuser.com%2fquestions%2f442178%2finstalling-multiple-versions-of-a-shared-library%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      0
      down vote













      http://www.ibm.com/developerworks/linux/library/l-lpic1-v3-102-3/ suggests




      Loading specific libraries



      If you're running an older application that
      needs a specific older version of a shared library, or if you're
      developing a new shared library or version of a shared library, you
      might want to override the default search paths used by the loader.
      This may also be needed by scripts that use product-specific shared
      libraries that may be installed in the /opt tree. Just as you can set
      the PATH variable to specify a search path for executables, you can
      set the LD_LIBRARY_PATH variable to a colon-separated list of
      directories that should be searched for shared libraries before the
      system ones specified in ld.so.cache. For example, you might use a
      command like:



      export LD_LIBRARY_PATH=/usr/lib/oldstuff:/opt/IBM/AgentController/lib




      The article linked to illustrates how to use ldd to find out what libraries a program depends on.






      share|improve this answer

























        up vote
        0
        down vote













        http://www.ibm.com/developerworks/linux/library/l-lpic1-v3-102-3/ suggests




        Loading specific libraries



        If you're running an older application that
        needs a specific older version of a shared library, or if you're
        developing a new shared library or version of a shared library, you
        might want to override the default search paths used by the loader.
        This may also be needed by scripts that use product-specific shared
        libraries that may be installed in the /opt tree. Just as you can set
        the PATH variable to specify a search path for executables, you can
        set the LD_LIBRARY_PATH variable to a colon-separated list of
        directories that should be searched for shared libraries before the
        system ones specified in ld.so.cache. For example, you might use a
        command like:



        export LD_LIBRARY_PATH=/usr/lib/oldstuff:/opt/IBM/AgentController/lib




        The article linked to illustrates how to use ldd to find out what libraries a program depends on.






        share|improve this answer























          up vote
          0
          down vote










          up vote
          0
          down vote









          http://www.ibm.com/developerworks/linux/library/l-lpic1-v3-102-3/ suggests




          Loading specific libraries



          If you're running an older application that
          needs a specific older version of a shared library, or if you're
          developing a new shared library or version of a shared library, you
          might want to override the default search paths used by the loader.
          This may also be needed by scripts that use product-specific shared
          libraries that may be installed in the /opt tree. Just as you can set
          the PATH variable to specify a search path for executables, you can
          set the LD_LIBRARY_PATH variable to a colon-separated list of
          directories that should be searched for shared libraries before the
          system ones specified in ld.so.cache. For example, you might use a
          command like:



          export LD_LIBRARY_PATH=/usr/lib/oldstuff:/opt/IBM/AgentController/lib




          The article linked to illustrates how to use ldd to find out what libraries a program depends on.






          share|improve this answer












          http://www.ibm.com/developerworks/linux/library/l-lpic1-v3-102-3/ suggests




          Loading specific libraries



          If you're running an older application that
          needs a specific older version of a shared library, or if you're
          developing a new shared library or version of a shared library, you
          might want to override the default search paths used by the loader.
          This may also be needed by scripts that use product-specific shared
          libraries that may be installed in the /opt tree. Just as you can set
          the PATH variable to specify a search path for executables, you can
          set the LD_LIBRARY_PATH variable to a colon-separated list of
          directories that should be searched for shared libraries before the
          system ones specified in ld.so.cache. For example, you might use a
          command like:



          export LD_LIBRARY_PATH=/usr/lib/oldstuff:/opt/IBM/AgentController/lib




          The article linked to illustrates how to use ldd to find out what libraries a program depends on.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jun 27 '12 at 15:00









          RedGrittyBrick

          66.4k12104160




          66.4k12104160
























              up vote
              0
              down vote













              Compiled binary programs usually link against
              /usr/lib/libXXX.so.1.2.3



              If you use a specific new version you could drop it in /usr/lib/libXXX.so.3.4.5
              and your newly created program should link against this.



              You can actually check, whether old programs now link against the new lib by
              ldd /path/to/program.



              If this really happens, you can:




              • put the new lib into a separate directory /special/path/lib and

              • launch your special program with a wrapper shell script, that sets
                LD_LIBRARY_PATH=/special/path/lib:$LD_LIBRARY_PATH
                and then launches the binary or

              • if you compile your program yourself you might pass the LDFLAGS=-Wl,-rpath,/special/path/lib,
                this hardcodes the search path for the special lib into your program
                (nice because works without wrapper script)






              share|improve this answer



























                up vote
                0
                down vote













                Compiled binary programs usually link against
                /usr/lib/libXXX.so.1.2.3



                If you use a specific new version you could drop it in /usr/lib/libXXX.so.3.4.5
                and your newly created program should link against this.



                You can actually check, whether old programs now link against the new lib by
                ldd /path/to/program.



                If this really happens, you can:




                • put the new lib into a separate directory /special/path/lib and

                • launch your special program with a wrapper shell script, that sets
                  LD_LIBRARY_PATH=/special/path/lib:$LD_LIBRARY_PATH
                  and then launches the binary or

                • if you compile your program yourself you might pass the LDFLAGS=-Wl,-rpath,/special/path/lib,
                  this hardcodes the search path for the special lib into your program
                  (nice because works without wrapper script)






                share|improve this answer

























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Compiled binary programs usually link against
                  /usr/lib/libXXX.so.1.2.3



                  If you use a specific new version you could drop it in /usr/lib/libXXX.so.3.4.5
                  and your newly created program should link against this.



                  You can actually check, whether old programs now link against the new lib by
                  ldd /path/to/program.



                  If this really happens, you can:




                  • put the new lib into a separate directory /special/path/lib and

                  • launch your special program with a wrapper shell script, that sets
                    LD_LIBRARY_PATH=/special/path/lib:$LD_LIBRARY_PATH
                    and then launches the binary or

                  • if you compile your program yourself you might pass the LDFLAGS=-Wl,-rpath,/special/path/lib,
                    this hardcodes the search path for the special lib into your program
                    (nice because works without wrapper script)






                  share|improve this answer














                  Compiled binary programs usually link against
                  /usr/lib/libXXX.so.1.2.3



                  If you use a specific new version you could drop it in /usr/lib/libXXX.so.3.4.5
                  and your newly created program should link against this.



                  You can actually check, whether old programs now link against the new lib by
                  ldd /path/to/program.



                  If this really happens, you can:




                  • put the new lib into a separate directory /special/path/lib and

                  • launch your special program with a wrapper shell script, that sets
                    LD_LIBRARY_PATH=/special/path/lib:$LD_LIBRARY_PATH
                    and then launches the binary or

                  • if you compile your program yourself you might pass the LDFLAGS=-Wl,-rpath,/special/path/lib,
                    this hardcodes the search path for the special lib into your program
                    (nice because works without wrapper script)







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jul 5 '16 at 2:48









                  JakeGould

                  30.9k1093137




                  30.9k1093137










                  answered Jun 27 '12 at 15:56









                  Fra Orolo

                  111




                  111






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • 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.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • 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%2fsuperuser.com%2fquestions%2f442178%2finstalling-multiple-versions-of-a-shared-library%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

                      Plaza Victoria

                      In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

                      How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...