Installing multiple versions of a shared library
up vote
1
down vote
favorite
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
add a comment |
up vote
1
down vote
favorite
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
Check what's going on withldd
. 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
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
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
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
linux compile administration
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 withldd
. 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
add a comment |
Check what's going on withldd
. 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
add a comment |
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.
add a comment |
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)
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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.
add a comment |
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.
add a comment |
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.
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.
answered Jun 27 '12 at 15:00
RedGrittyBrick
66.4k12104160
66.4k12104160
add a comment |
add a comment |
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)
add a comment |
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)
add a comment |
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)
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)
edited Jul 5 '16 at 2:48
JakeGould
30.9k1093137
30.9k1093137
answered Jun 27 '12 at 15:56
Fra Orolo
111
111
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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