Operating System - HP-UX
1834926 Members
2748 Online
110071 Solutions
New Discussion

Command to know shared-libraries a program will need?

 
SOLVED
Go to solution
Jorge Fabregas
Regular Advisor

Command to know shared-libraries a program will need?

Hello all,

I just got back from "dependency-hell" trying to install GNU wget on HP-UX. I did the download from the HP-UX porting site (UK).

When I installed it (using the depot), I then went to run it...I got some dld error messages complaining about libcrypto.sl. ok, I then download openssl. Fine, then I got another error..I needed gettext...so on and on. Now it is working...

My question is. Is there a command to know what shared-libraries a program will need at run time? It will be great to have this since this "trial and error" thing is really no good. It will be great to have something, for example, like this:

Wget needs:
libcrytpo.sl
libcap.sl
libwhatever.sl
libfoofoo.sl

I'll appreciate your help.

Thanks,
Jorge
6 REPLIES 6
Naveej.K.A
Honored Contributor
Solution

Re: Command to know shared-libraries a program will need?

hi jorge,

ldd /usr/bin/passwd

will list all the dynamically linked libraries for the executable

regds
Naveej
practice makes a man perfect!!!
Jorge Fabregas
Regular Advisor

Re: Command to know shared-libraries a program will need?

Ahhhhh exactly what I was looking for ! THANKS!
Patrick Wallek
Honored Contributor

Re: Command to know shared-libraries a program will need?

The porting center is VERY GOOD about actually telling you what the dependencies are for each package. For wget they do list the "Build Time Dependencies" and the "Run Time Dependencies".

Run-time dependencies: gettext libiconv openssl perl
H.Merijn Brand (procura
Honored Contributor

Re: Command to know shared-libraries a program will need?

In that case, I would not call it very good.
I agree that they are complete, but that list is simply not true.

1. wget doesn't need perl
2. wget only needs openssl when using https or any other secure protocol, and wget can run very nice without openssl when you don't need thos protocols

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: Command to know shared-libraries a program will need?

An I much prefer 'chatr' over 'ldd' most of the time. I'll show the difference here by comparing my own wget build (--disable-nls to get rid of libiconv and gettext) and HP's wget

a5:/pro/bin 104 > ldd /pro/local/bin/wget
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/local/lib/libcrypto.sl.0.9.7 => /usr/local/lib/libcrypto.sl.0.9.7
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/local/lib/libssl.sl.0.9.7 => /usr/local/lib/libssl.sl.0.9.7
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
a5:/pro/bin 105 > chatr /pro/local/bin/wget
/pro/local/bin/wget:
shared executable
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path enabled first /usr/local/lib
shared library list:
dynamic /usr/local/lib/libssl.sl.0.9.7
dynamic /usr/local/lib/libcrypto.sl.0.9.7
dynamic /usr/lib/libc.2
shared library binding:
deferred
global hash table disabled
:
:

a5:/pro/bin 106 > ldd /usr/local/bin/wget
/usr/local/lib/libcrypto.sl => /usr/local/lib/libcrypto.sl
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/local/lib/libssl.sl => /usr/local/lib/libssl.sl
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/local/lib/libiconv.sl => /usr/local/lib/libiconv.sl
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/local/lib/libintl.sl => /usr/local/lib/libintl.sl
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/local/lib/libiconv.sl => /usr/local/lib/libiconv.sl
a5:/pro/bin 107 > chatr /usr/local/bin/wget
/usr/local/bin/wget:
shared executable
shared library dynamic path search:
SHLIB_PATH enabled first
embedded path enabled second /usr/local/lib
shared library list:
static /usr/local/lib/libintl.sl
static /usr/local/lib/libiconv.sl
dynamic /usr/lib/libc.2
dynamic /usr/local/lib/libssl.sl
dynamic /usr/local/lib/libcrypto.sl
shared library binding:
deferred
:
:

One of the big advantages of remembering 'ldd' is that it is also available on many other OS's including Linux. chatr is not

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
ranganath ramachandra
Esteemed Contributor

Re: Command to know shared-libraries a program will need?

'odump -slliblist' or 'odump -sllibloadlist' also works.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo