Compile or not compile? [message #42879] |
Mon, 28 February 2005 08:38  |
Nuno Oliveira
Messages: 75 Registered: October 2003
|
Member |
|
|
There's something that sometimes in while it bores me a little bit. How
do I know if I need to compile a function/procedure or it will be able
to compile "on fly".
At the beginning I thought this was related to the paths idl "knew", but
this happens for two functions/routines in the same directory.
Can someone tell when a function can be runned without be compile?
|
|
|
|
Re: Compile or not compile? [message #43151 is a reply to message #43149] |
Mon, 21 March 2005 12:29  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Kenneth Bowman writes:
> In my experience (OS X), creating a new program file after starting IDL
> gives the following behavior (file names appropriated from above):
>
> IDL> file_in_my_path
> % Compiled module: FILE_IN_MY_PATH.
>
> Then create a new program file
>
> IDL> another_file_in_my_path
> % Attempt to call undefined procedure/function:
> 'ANOTHER_FILE_IN_MY_PATH'.
> % Execution halted at: $MAIN$
> IDL> .r another_file_in_my_path
> % Compiled module:.ANOTHER_FILE_IN_MY_PATH
>
> So, automatic compilation does not work, but manual compilation does. I
> still don't understand that.
Well, if you don't understand it AND you don't like
it, I would turn path caching off. Something like this
in your startup file would do it:
PATH_CACHE, ENABLE=0
Or, if you don't understand it, but like the speed with
which IDL can find files now, you could do this after
you save the new file:
IDL> PATH_CACHE, /CLEAR
Now, when you type the new file name IDL will rebuild the cache
with the new file in it so it can be found automatically. (Building
the cache again could be slow, but no slower than finding the file
pre IDL 6.0, I should think).
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|