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

Home » Public Forums » archive » Re: compile and execute from the command line
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
Re: compile and execute from the command line [message #77892] Wed, 28 September 2011 19:08
Craig Markwardt is currently offline  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 Go to previous message
natha is currently offline  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 Go to previous message
Michael Galloy is currently offline  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 Go to previous message
natha is currently offline  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 Go to previous message
Michael Galloy is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: compile and execute from the command line
Next Topic: Is there a work around to save multiple variables with same head but different tails without listing all of them?

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

Current Time: Fri Oct 10 13:25:32 PDT 2025

Total time taken to generate the page: 0.87607 seconds