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

Home » Public Forums » archive » Re: IDL without X on Linux
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: IDL without X on Linux [message #42865] Thu, 03 March 2005 10:10 Go to next message
David Fanning is currently offline  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 #42866 is a reply to message #42865] Thu, 03 March 2005 10:06 Go to previous messageGo to next message
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
David Fanning wrote:
> Benjamin Hornberger writes:
>
>
>> That's cool. Thanks a lot! David, that might be another article for your
>> web site.
>
>
> Done.
>
> http://www.dfanning.com/misc_tips/noxserver.html

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.

Benjamin
Re: IDL without X on Linux [message #42867 is a reply to message #42866] Thu, 03 March 2005 10:01 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Benjamin Hornberger writes:

> That's cool. Thanks a lot! David, that might be another article for your
> web site.

Done.

http://www.dfanning.com/misc_tips/noxserver.html

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 Go to previous messageGo to next message
Benjamin Hornberger is currently offline  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 Go to previous messageGo to next message
Michael Wallace is currently offline  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 Go to previous messageGo to next message
Liam Gumley is currently offline  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 #42876 is a reply to message #42875] Thu, 03 March 2005 06:46 Go to previous messageGo to next message
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
David Fanning wrote:
> Benjamin Hornberger writes:
>
>
>> 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)").
>>

>
> Have you tried setting the graphics output device to NULL?
>
> Set_Plot, 'NULL'

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...

Thanks,
Benjamin
Re: IDL without X on Linux [message #42877 is a reply to message #42876] Thu, 03 March 2005 06:32 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Benjamin Hornberger writes:

> 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 :-(.

Have you tried setting the graphics output device to NULL?

Set_Plot, 'NULL'

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 #42986 is a reply to message #42876] Fri, 04 March 2005 06:30 Go to previous message
Ken Mankoff is currently offline  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/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: surface fittin
Next Topic: Re: String Processing Question

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

Current Time: Wed Oct 08 15:10:15 PDT 2025

Total time taken to generate the page: 0.00787 seconds