Connecting Tech Pros Worldwide Forums | Help | Site Map

How to track down all required shared libraries?

sdhyok
Guest
 
Posts: n/a
#1: Jul 19 '05
Recently, I installed many shared libraries to run a program written in
Python.
Now, I am in the situation to run the same program but on several
different machines with the same Linux OS. To avoid the reinstallation,
I like to pack up all shared libraries into a directory. Is there a
good way to track down all shared libraries required to run a Python
program?

Daehyok Shin

Mike Rovner
Guest
 
Posts: n/a
#2: Jul 19 '05

re: How to track down all required shared libraries?


sdhyok wrote:[color=blue]
> Recently, I installed many shared libraries to run a program written in
> Python.
> Now, I am in the situation to run the same program but on several
> different machines with the same Linux OS. To avoid the reinstallation,
> I like to pack up all shared libraries into a directory. Is there a
> good way to track down all shared libraries required to run a Python
> program?
>
> Daehyok Shin
>[/color]

To get executable requirements use ldd.
When python can't load a lib at run-time usually ImportError is raised.
As with other errors you can never know which libs will be dynamically
required.

Mike

Jeff Epler
Guest
 
Posts: n/a
#3: Jul 19 '05

re: How to track down all required shared libraries?


One poster suggests 'ldd' for executables. You can also use this on shared
libraries:
$ ldd /usr/lib/python2.3/lib-dynload/_tkinter.so
libtix8.1.8.4.so => /usr/lib/libtix8.1.8.4.so (0x009b6000)
libtk8.4.so => /usr/lib/libtk8.4.so (0x00111000)
libtcl8.4.so => /usr/lib/libtcl8.4.so (0x00539000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x00a48000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x001de000)
libc.so.6 => /lib/tls/libc.so.6 (0x001f0000)
libdl.so.2 => /lib/libdl.so.2 (0x0052d000)
libm.so.6 => /lib/tls/libm.so.6 (0x00fcf000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00656000)
If you know what shared modules your program uses, you can "ldd" them all and
find out the set of libraries they are linked to.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFCdEWiJd01MZaTXX0RAvPwAJ0b51GVGM2ww5RL/Ax4qLYKyTAw9wCdHArx
yf7xuETvoVn+XPEfwB6D8Do=
=5RoY
-----END PGP SIGNATURE-----

Miki Tebeka
Guest
 
Posts: n/a
#4: Jul 19 '05

re: How to track down all required shared libraries?


Hello sdhyok,
[color=blue]
> Now, I am in the situation to run the same program but on several
> different machines with the same Linux OS. To avoid the reinstallation,
> I like to pack up all shared libraries into a directory. Is there a
> good way to track down all shared libraries required to run a Python
> program?[/color]
There is a module call "modulefinder" in Python standard library. It might
do what you want.

HTH.
--
------------------------------------------------------------------------
Miki Tebeka <miki.tebeka@zoran.com>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)

iD8DBQFCdOcP8jAdENsUuJsRArs7AJ488mqC6ZbR0WPiQScvYW fxfePjZACgw5K5
AAqQhmq75umIo4T6TpFbTWg=
=4Som
-----END PGP SIGNATURE-----

Closed Thread