Re: Cant find functions in lib [message #24528] |
Thu, 05 April 2001 07:49  |
Paul van Delst
Messages: 364 Registered: March 1997
|
Senior Member |
|
|
Dominik wrote:
>
> Helle there,
>
> I am using IDL for imaging in Nuklear Medicine. We wrote a big library
> (NukMed.pro) with some functions and dont wont to compile it each time. So
> we thought to put it in the lib directory of IDL, where IDL itself puts all
> its *.pro.
> But when we try to use it, IDL doesnt find the functions we used the whole
> time. Do I have to precompile it or to sign up in a special list for all
> *.pro files?
My solution to this is not to create a library *file* (like NukMed.pro) with all the
goodies but a library *directory* (like ~/pvandelst/idl/NukMed) which contains all the
_separate_ files. The directory, which is beneath the idl directory, is then automagically
added to my IDL_PATH environment variable because I do a: export
IDL_PATH=$IDL_PATH:+\${HOME}/idl
Anything below ${HOME}/idl is tacked on the end of the path.
paulv
--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
paul.vandelst@noaa.gov Alexander Pope.
|
|
|
|
|
Re: Cant find functions in lib [message #24538 is a reply to message #24536] |
Thu, 05 April 2001 06:01   |
Dominik[1]
Messages: 46 Registered: April 2001
|
Member |
|
|
Has it really to be the LAST program module ? I think it is working also
with other "places" in the file. Or will the module only find functions in
freont of him in the file?
Dominik
"David Fanning" <davidf@dfanning.com> schrieb im Newsbeitrag
news:MPG.153619385014b126989dcc@news.frii.com...
> Dominik (dpaul@ukl.uni-freiburg.de) writes:
>
>> I am using IDL for imaging in Nuklear Medicine. We wrote a big library
>> (NukMed.pro) with some functions and dont wont to compile it each time.
So
>> we thought to put it in the lib directory of IDL, where IDL itself puts
all
>> its *.pro.
>> But when we try to use it, IDL doesnt find the functions we used the
whole
>> time. Do I have to precompile it or to sign up in a special list for all
>> *.pro files?
>
> If you find you have to "compile" the code before
> you can use it, then the code is not written correctly.
> Putting it in the lib directory won't help, alas. :-(
>
> If code is written so that the *last* program module in
> the file has the same name as the program file, which will
> also be the "name" of the command you are trying to build,
> then this program will be automatically compiled when
> the "command" is used, assuming the file is anywhere
> in the !PATH.
>
> You never have to pre-compile anything in IDL, assuming you
> have written it correctly.
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438 E-Mail: davidf@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|
|
Re: Cant find functions in lib [message #24546 is a reply to message #24538] |
Thu, 05 April 2001 05:55   |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Dominik (dpaul@ukl.uni-freiburg.de) writes:
> I am using IDL for imaging in Nuklear Medicine. We wrote a big library
> (NukMed.pro) with some functions and dont wont to compile it each time. So
> we thought to put it in the lib directory of IDL, where IDL itself puts all
> its *.pro.
> But when we try to use it, IDL doesnt find the functions we used the whole
> time. Do I have to precompile it or to sign up in a special list for all
> *.pro files?
If you find you have to "compile" the code before
you can use it, then the code is not written correctly.
Putting it in the lib directory won't help, alas. :-(
If code is written so that the *last* program module in
the file has the same name as the program file, which will
also be the "name" of the command you are trying to build,
then this program will be automatically compiled when
the "command" is used, assuming the file is anywhere
in the !PATH.
You never have to pre-compile anything in IDL, assuming you
have written it correctly.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|
Re: Cant find functions in lib [message #24599 is a reply to message #24533] |
Thu, 05 April 2001 16:43  |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article <MPG.1536350bbbff2315989dce@news.frii.com>, David Fanning
<davidf@dfanning.com> wrote:
> Yes, it has to be LAST, but really only if you want it
> to work all of the time. :-)
I have never understood the reason(s) for this, and find it somewhat
inconvenient. If I have (say) a procedure and a few related functions
that I would logically keep in the same file, it also seems logical to
me to put the "main" procedure (the one whose name matches the
filename) at the beginning of the file, rather than burying it at then
end. Why doesn't IDL simply compile everything in a file? What value
does the user get from stopping the compilation part of the way through
a file? (Aside from confusing newbies, of course, which has, at least,
mild entertainment value.)
Ken
|
|
|