Re: IDL without X on Linux [message #42865] |
Thu, 03 March 2005 10:10  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Benjamin Hornberger writes:
> Great! Maybe you could add something like "... avoid any calls to
> DEVICE ... EVEN IN YOUR STARTUP FILE". That was my problem in the first
> place, why IDL wouldn't even start.
OK, I don't have anything else to do today. NOT! :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|
|
Re: IDL without X on Linux [message #42869 is a reply to message #42867] |
Thu, 03 March 2005 09:45   |
Benjamin Hornberger
Messages: 258 Registered: March 2004
|
Senior Member |
|
|
Liam Gumley wrote:
> Benjamin Hornberger wrote:
>
>> Hi all,
>>
>> can I start IDL on Linux without an X server available? I frequently
>> run IDL on a Linux machine remotely, logged on from a Windows machine.
>> If the Windows machine doesn't run an X server at that moment, IDL
>> won't start ("X connection to localhost:11.0 broken (explicit kill or
>> server shutdown)").
>>
>> I know I somehow can run (non-interactive) IDL programs from a
>> cronjob, as long as they don't involve windows.
>>
>> I found the section "Command Line Options for IDL Startup" in the help
>> file, but it doesn't mention anything :-(.
>>
>> Thanks,
>> Benjamin
>
>
> It is sometimes useful to run your IDL programs, graphics and all, even
> when you don't have an X connection. For this purpose, the Xvfb (X
> virtual frame buffer) utility is incredibly handy:
>
> http://www.rsinc.com/services/techtip.asp?ttid=2382
>
> If you want to run IDL graphics programs in the background, Xvfb is
> highly recommended.
That's cool. Thanks a lot! David, that might be another article for your
web site.
Benjamin
|
|
|
Re: IDL without X on Linux [message #42871 is a reply to message #42869] |
Thu, 03 March 2005 09:27   |
Michael Wallace
Messages: 409 Registered: December 2003
|
Senior Member |
|
|
Here's how to run IDL without X.
1.) If you can modify source code and do not need to make plots
Just simply avoid any calls to device or other command that'd have the
effect of trying to produce a window on the screen (plot, window, etc).
It's probably best to be explicit and set the plotting device to NULL.
2.) If you can modify source code and you need to make plots
Set the plotting device to the Z-buffer (set_plot, 'Z') and leave it
that way. Your plots will now be going to an "offscreen" device that
will not be displayed anywhere, but everything all the plotting commands
will still work.
If using Object Graphics, use IDLgrBuffer instead of IDLgrWindow.
3.) If you can't modify source code and the code needs an X server
Download Xvfb, run it and set the DISPLAY variable to the Xvfb session.
Xvfb (X virtual frame buffer) is basically an X server which runs
offscreen and doesn't need to have any physical display. Programs which
need X servers don't realize that it's running off screen. Let's say
that I start an Xvfb session on server 1, screen 0. Before running the
IDL program you'd need to set the DISPLAY environmental variable to
your_machine_name:1.0. Typically I will write a little shell script
that sets the DISPLAY and then runs my IDL program. That way I don't
have to remember to set DISPLAY each time.
Benjamin Hornberger wrote:
> Hi all,
>
> can I start IDL on Linux without an X server available? I frequently run
> IDL on a Linux machine remotely, logged on from a Windows machine. If
> the Windows machine doesn't run an X server at that moment, IDL won't
> start ("X connection to localhost:11.0 broken (explicit kill or server
> shutdown)").
>
> I know I somehow can run (non-interactive) IDL programs from a cronjob,
> as long as they don't involve windows.
>
> I found the section "Command Line Options for IDL Startup" in the help
> file, but it doesn't mention anything :-(.
>
> Thanks,
> Benjamin
|
|
|
Re: IDL without X on Linux [message #42875 is a reply to message #42871] |
Thu, 03 March 2005 08:20   |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
Benjamin Hornberger wrote:
> Hi all,
>
> can I start IDL on Linux without an X server available? I frequently run
> IDL on a Linux machine remotely, logged on from a Windows machine. If
> the Windows machine doesn't run an X server at that moment, IDL won't
> start ("X connection to localhost:11.0 broken (explicit kill or server
> shutdown)").
>
> I know I somehow can run (non-interactive) IDL programs from a cronjob,
> as long as they don't involve windows.
>
> I found the section "Command Line Options for IDL Startup" in the help
> file, but it doesn't mention anything :-(.
>
> Thanks,
> Benjamin
It is sometimes useful to run your IDL programs, graphics and all, even
when you don't have an X connection. For this purpose, the Xvfb (X
virtual frame buffer) utility is incredibly handy:
http://www.rsinc.com/services/techtip.asp?ttid=2382
If you want to run IDL graphics programs in the background, Xvfb is
highly recommended.
Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
|
|
|
|
|
Re: IDL without X on Linux [message #42986 is a reply to message #42876] |
Fri, 04 March 2005 06:30  |
Ken Mankoff
Messages: 158 Registered: February 2000
|
Senior Member |
|
|
On Thu, 3 Mar 2005, Benjamin Hornberger wrote:
> That helped! Actually, I realized it was enough to take the device
> commands out of the startup file. Now I only need a way to start
> with different startup files. I guess I'll have to use bash
> scripts for that...
You can leave the device commands in the file and skip the bash,
doing it all in IDL. Here is the system I use.
1) I have my IDL_STARTUP env. var. pointing to idl.pro
2) I made a file link: % ln -s idl.pro idl_noX.pro
3) I have a bash alias: alias idl_noX='export IDL_STARTUP="idl_noX.pro"'
4) When I need to run without X, I type "idl_noX" at the CLI
Finally idl.pro (which is *also* idl_noX.pro) contains this:
env = GETENV( "IDL_STARTUP" )
IF ( STREGEX( env, 'noX', /BOOLEAN ) ) THEN x = 0 ELSE x = 1
IF x THEN device, true = 24
IF x THEN device, decomposed = 0
IF x THEN device, retain = 2
delvar, env, x
-k.
--
http://spacebit.dyndns.org/
|
|
|