Re: compile and execute from the command line [message #77892] |
Wed, 28 September 2011 19:08 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Sep 28, 12:43 pm, nata <bernat.puigdomen...@gmail.com> wrote:
> Thank you for your reply Michael.
>
> The problem was that the routine is not placed in the current
> directory so if I do idl -e "MY_ROUTINE" IDL won't find the routine
> and won't compile it automatically.
> The solution I found is :
>
> routine_path=ROUTINE_FILEPATH('MY_ROUTINE')
> idl -e "CD, '''+FILE_DIRNAME(routine_path)+''' & MY_ROUTINE"
>
> Cheers,
> nata
Maybe COMPILE_FILE will do the trick?
http://www.physics.wisc.edu/~craigm/idl/misc.html
Craig
|
|
|
Re: compile and execute from the command line [message #77893 is a reply to message #77892] |
Wed, 28 September 2011 19:05  |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
On Sep 28, 1:18 pm, Michael Galloy <mgal...@gmail.com> wrote:
> On 9/28/11 10:43 AM, nata wrote:
>
>> Thank you for your reply Michael.
>
>> The problem was that the routine is not placed in the current
>> directory so if I do idl -e "MY_ROUTINE" IDL won't find the routine
>> and won't compile it automatically.
>
> And it's not in your !path?
>
> Mike
> --
> Michael Galloywww.michaelgalloy.com
> Modern IDL, A Guide to Learning IDL:http://modernidl.idldev.com
> Research Mathematician
> Tech-X Corporation
Not in this case !
|
|
|
Re: compile and execute from the command line [message #77894 is a reply to message #77893] |
Wed, 28 September 2011 10:18  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 9/28/11 10:43 AM, nata wrote:
> Thank you for your reply Michael.
>
> The problem was that the routine is not placed in the current
> directory so if I do idl -e "MY_ROUTINE" IDL won't find the routine
> and won't compile it automatically.
And it's not in your !path?
Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL, A Guide to Learning IDL: http://modernidl.idldev.com
Research Mathematician
Tech-X Corporation
|
|
|
Re: compile and execute from the command line [message #77895 is a reply to message #77894] |
Wed, 28 September 2011 09:43  |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
Thank you for your reply Michael.
The problem was that the routine is not placed in the current
directory so if I do idl -e "MY_ROUTINE" IDL won't find the routine
and won't compile it automatically.
The solution I found is :
routine_path=ROUTINE_FILEPATH('MY_ROUTINE')
idl -e "CD, '''+FILE_DIRNAME(routine_path)+''' & MY_ROUTINE"
Cheers,
nata
On Sep 28, 12:29 pm, Michael Galloy <mgal...@gmail.com> wrote:
> On 9/28/11 8:01 AM, nata wrote:
>
>
>
>
>
>
>
>
>
>> Hello guys,
>
>> Is it possible to compile and execute a routine from the command line
>> without using a SAV file ?
>> I am trying to find a combination of options to do what I want but I
>> don't actually know if this is possible. Something like:
>
>> idl -e "@compile_all.g& CALL_ROUTINE"
>
>> or
>
>> idl -batch @compile_all.g -e "CALL_ROUTINE"
>
>> Nothing works !
>> I would like to avoid the creation of the sav file. Thank you for your
>> help,
>> nata
>
> I assume you need to do the compilation step because the routines and
> files are not named properly, so that the following doesn't
> automatically compile everything?
>
> idl -e "MY_ROUTINE"
>
> If so, I would fix the filenames if that is possible. But if that is not
> an option, then I would create a batch file, call it my_batch.pro, that
> contained:
>
> @compile_all.g
> MY_ROUTINE
> exit
>
> Then call that with:
>
> idl my_batch
>
> Mike
> --
> Michael Galloywww.michaelgalloy.com
> Modern IDL, A Guide to Learning IDL:http://modernidl.idldev.com
> Research Mathematician
> Tech-X Corporation
|
|
|
Re: compile and execute from the command line [message #77896 is a reply to message #77895] |
Wed, 28 September 2011 09:29  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 9/28/11 8:01 AM, nata wrote:
> Hello guys,
>
> Is it possible to compile and execute a routine from the command line
> without using a SAV file ?
> I am trying to find a combination of options to do what I want but I
> don't actually know if this is possible. Something like:
>
> idl -e "@compile_all.g& CALL_ROUTINE"
>
> or
>
> idl -batch @compile_all.g -e "CALL_ROUTINE"
>
> Nothing works !
> I would like to avoid the creation of the sav file. Thank you for your
> help,
> nata
I assume you need to do the compilation step because the routines and
files are not named properly, so that the following doesn't
automatically compile everything?
idl -e "MY_ROUTINE"
If so, I would fix the filenames if that is possible. But if that is not
an option, then I would create a batch file, call it my_batch.pro, that
contained:
@compile_all.g
MY_ROUTINE
exit
Then call that with:
idl my_batch
Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL, A Guide to Learning IDL: http://modernidl.idldev.com
Research Mathematician
Tech-X Corporation
|
|
|