LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-14-2009, 09:14 AM   #1
DEF.
Member
 
Registered: Apr 2009
Posts: 96

Rep: Reputation: 23
how to find dependancies


How do I find dependancies of modules? Is it just look at the dependancy list in, for example, synaptic? Will this give all dependancies? Is there a method to trace the dependancies at runtime? etc...


Thanks in advance.
 
Old 04-14-2009, 09:41 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
The dependencies in a module are usually given in it's documentation.
The dependencies in a deb file are included in the file. Packet managers use the metadata in their packages to run down dependencies for that package. The list against a particular package will not be all files needed to run the program - the dependencies may also have dependencies which they rely on - and those their own.

You don't normally try to track dependencies at runtime - this is normally done at installation. Try to run a program with a missing whatsit, will get you an error of some kind (depending an how well written the program is).

There is no magic bullet to tracking dependencies - if someone fails to provide the information you are left with hunting down clues in the source code.

What do you have in mind?
 
Old 04-14-2009, 01:44 PM   #3
DEF.
Member
 
Registered: Apr 2009
Posts: 96

Original Poster
Rep: Reputation: 23
Thanks for your reply.

Well, I am developing an embedded Linux application and have found some kernel modules and applications missing on the embedded target, but they same are all available on the host. I was hoping for some 'lovely' utility to track load/link-time and run-time dependencies so I could identify the dependencies on the host and thus build the necessary parts for the embedded target.

I was assuming they was such a 'mythical' application for Linux as I am familiar with an application called 'Dependency Walker' for Win32 programs.

So... any ideas?
 
Old 04-14-2009, 01:52 PM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Windows "Dependency walker" wouldn't completely help you with everything you were asking about, either. It only tells you the runtime shared library dependencies.

The equivalent *nix command (to see shared runtime dependencies) is:
Quote:
ldd
'Hope that helps .. PSM
 
Old 04-15-2009, 09:38 AM   #5
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
DEF: I'm guessing there is a semantics problem here ... in the linux world, a "dependency" is usually a program which another program depends on. Though this can apply to shared libraries as well, programmers here will often make a distinction between package dependencies (a la "dependency hell") and shared libraries.

So your question probably came out much more general than you intended.

If you'll tell which modules and apps are missing and how you discovered this, we'll probably be able to figure out what you need. As mentioned, ldd, is probably going to do what you need.

Microsoft limit the ways that a developer can interact with their system, so it is probably easier to track dependencies there. With FOSS, there are no restrictions to access. This also means that discipline in writing code is more important.
 
Old 04-20-2009, 01:42 PM   #6
DEF.
Member
 
Registered: Apr 2009
Posts: 96

Original Poster
Rep: Reputation: 23
Thanks 'paulSM4': however your comment is not true: Windows "Dependency walker" tracks all libs loaded at runtime including static and dynamic (although some ativeX components don't always show-up ). Anyhow, this is off subject.

Thanks 'Simon Bridge': I think dependencies means the same think in both Linux and Windows no? Anyhow, the help here is good. ldd does help.

I am surprised to see there is not a Linux tool that can track module use at runtime? Perhaps there is a need for one?
 
Old 04-20-2009, 02:02 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
modinfo will list kernel module dependencies.

Packages can be queried for dependencies. If you are building a package, the ./configure script checks for missing dependencies. Some package installers will download the dependencies that a package needs.

If you are missing a depend library or module, how would a runtime display of libraries help. ldd does list the loadable libraries that get linked.
 
Old 04-23-2009, 06:34 AM   #8
jisjis
LQ Newbie
 
Registered: Apr 2009
Posts: 18

Rep: Reputation: 0
This is a pretty interesting thread ... Thanks for shedding some light on the matter folks. I'm going to be tracking this one for sure!


Linux

Last edited by jisjis; 04-26-2009 at 04:44 AM.
 
Old 04-23-2009, 06:44 AM   #9
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by DEF. View Post
I think dependencies means the same think in both Linux and Windows no? Anyhow, the help here is good. ldd does help.
I don't think windows has the package dependency issues that gnu/linux has. Windows apps are usually all-in-one affairs IIRC. I certainly don't recall installsheild complaining that I need to have installed from a different zip first.
 
Old 04-28-2009, 08:53 AM   #10
DEF.
Member
 
Registered: Apr 2009
Posts: 96

Original Poster
Rep: Reputation: 23
You have to be joking - Windows definitely has dependency issues and anyone who has developed for Windows will no this! Especially when changing from NT > 2000 > XP or try developing mobile devices...

Also many windows installers check dependencies first, they typically ship the correct versions of required dll with the installer and install them locally (or in some bad cases overwrite your system ones ).

Again this is all off topic.

So, in Linux use ldd to track dependencies and modinfo for kernel module dependencies?
 
  


Reply



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
dependancies DanB_1983 Linux - Software 6 02-20-2007 08:47 PM
Dependancies DIGITAL39 General 5 10-02-2006 06:10 AM
I can't install Java. Says I need some dependancies ....Can't find them online...?? Babydollkiller Slackware 21 07-23-2006 04:25 AM
Can't find dependancies. (xdvdshrink) spicyed Linux - Software 2 03-05-2006 12:24 PM
Dependancies dibblethewrecke Linux - Newbie 3 11-24-2003 02:15 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:48 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration