LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-06-2012, 08:45 PM   #1
rohit.dhaval1
Member
 
Registered: Jul 2009
Posts: 39
Blog Entries: 2

Rep: Reputation: 0
How do I ensure static runpath is set for installed software


Hi,

I need to install software from a source tarball in a custom location. I need to ensure the binary is dynamically linked to set of libraries in custom location. I do not want to rely on setting LD_LIBRARY_PATH. How do I achieve it while copilation and installation

Example :

./configure --prefix=/home/user1 LDDFLAGS='-I/home/user1/lib'

Please suggest a foolproof method.

Thanks

Last edited by rohit.dhaval1; 08-07-2012 at 01:06 PM.
 
Old 08-06-2012, 09:33 PM   #2
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Debian, SL
Posts: 5,081

Rep: Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097
Hi,

you specify static linking, but I guess you actually mean dynamic linking to libraries in a nonstandard location. You should be able to do this with ldconfig. You can add the path to /etc/ld.so.conf (or have it included) and then run ldconfig.
Check the ldconfig man page for details.

Evo2.
 
1 members found this post helpful.
Old 08-07-2012, 12:59 PM   #3
rohit.dhaval1
Member
 
Registered: Jul 2009
Posts: 39
Blog Entries: 2

Original Poster
Rep: Reputation: 0
thank you. The situation here is,

" I have a NFS mount that will be mounted on hundreds of RHEL5 machines. I install software on an NFS volume that will be mounted on all these machines. The binaries in that NFS volume has to be self contained. It should get all required library from the NFS volume itself. How do I achieve this? Is there any parameter that I can make use of to let the binary know where it should look for required libraries? "

Adding the LD_LIBRARY_PATH to ld.so.conf definitely is a solution but, asking a user to add the custom path isn't adequate.
 
Old 08-07-2012, 07:57 PM   #4
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Debian, SL
Posts: 5,081

Rep: Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097
Hi,

Quote:
Originally Posted by rohit.dhaval1 View Post
Adding the LD_LIBRARY_PATH to ld.so.conf definitely is a solution but, asking a user to add the custom path isn't adequate.
Have you considered adding the relevant path to PATH in /etc/profile on the client machines?

Evo2.
 
1 members found this post helpful.
Old 08-07-2012, 07:59 PM   #5
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Debian, SL
Posts: 5,081

Rep: Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097Reputation: 1097
Hmm, regarding where the shared libraries are located, have you considered linking with the -rpath option?

Evo2.
 
1 members found this post helpful.
Old 08-16-2012, 04:25 PM   #6
rohit.dhaval1
Member
 
Registered: Jul 2009
Posts: 39
Blog Entries: 2

Original Poster
Rep: Reputation: 0
Thank you

Method I used to get around the problem is,

1. While installing any software in NFS location, I would set LD_RUN_PATH in my profile. This adds to the -rpath for library/binary.
2. For already installed libraries (*.so), I would patch them with help of 'patchelf --set-rpath ' command.
 
  


Reply

Tags
compiling, dynamic loading, installation, library


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ensure strength of passwords set by root satya123 Linux - Newbie 1 03-16-2011 07:04 AM
How to set Static IP? maverick_29 Linux - Networking 4 05-25-2007 01:07 AM
How to ensure paths are set during boot greengrocer Linux - Newbie 3 04-14-2007 12:47 AM
How to ensure that the complete development environment have been installed? Akhran Debian 3 08-16-2005 05:02 PM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM


All times are GMT -5. The time now is 10:59 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration