comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » List of called subprograms
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
List of called subprograms [message #85307] Wed, 24 July 2013 04:54 Go to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
We are putting together a data pipeline written in IDL and we are struggling to make it self-contained. As soon as we find that it calls a subprogram that is not within the same directory or within the IDL distribution, we make a local copy and rename it to a local namespace.

Everybody involved in the coding have lots of stuff in their idl path, so it is difficult to know that we caught everything. One could make a test user with nothing private in the idl path but that would be cumbersome and would require us to write a test suite that actually runs all of the code.

So. Is there a tool that can analyze the idl code in a directory (without actually running it) and list all the subprograms (with their paths) that would potentially be loaded and complied? (I guess it might help if we stuck to using [] for arrays everywhere but we could live with false positives for that.)

It would not have to be recursive once it finds something outside the current directory (although that would be nice too).
Re: List of called subprograms [message #85318 is a reply to message #85307] Wed, 24 July 2013 07:37 Go to previous messageGo to next message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
Hi Mats,

I'm not sure, if I get it right...

After compiling the main program(s) within a fresh IDL session you can
find the names of all subprograms with
names=routine_info(/unresolved,functions=i) ; with i=0,1
Then compile all subprograms with
resolve_routine,names,is_function=i
and continue with the first step to find all the subsubprograms and so
on.

This gives you the names of all programs. The pathes can be found with
path=routine_info(names[j],/source) ; with j=0,1,...
or, if all subprograms reside within a file with one of the names of
all the subprograms with the file_which() routine.

HTH, Heinz
Re: List of called subprograms [message #85324 is a reply to message #85318] Wed, 24 July 2013 11:40 Go to previous message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den onsdagen den 24:e juli 2013 kl. 16:37:42 UTC+2 skrev Heinz Stege:
> Hi Mats,
>
> I'm not sure, if I get it right...
>
> After compiling the main program(s) within a fresh IDL session you can
> find the names of all subprograms with
> names=routine_info(/unresolved,functions=i) ; with i=0,1
> Then compile all subprograms with
> resolve_routine,names,is_function=i
> and continue with the first step to find all the subsubprograms and so
> on.
>
> This gives you the names of all programs. The pathes can be found with
> path=routine_info(names[j],/source) ; with j=0,1,...
> or, if all subprograms reside within a file with one of the names of
> all the subprograms with the file_which() routine.
>
> HTH, Heinz

That's exactly what I need. Thank you!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL Datapoint blog
Next Topic: How to create a stable "package" in IDL?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:11:52 PDT 2025

Total time taken to generate the page: 0.00731 seconds