Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

Environment Variables Used by IDL


When IDL starts, it sets the values of a variety of system variables. System variables are a special class of predefined variables that are available to all IDL program units; they are described in detail in System Variables. The values of some system variables can be specified by the user when IDL starts, either via operating system environment variables or via preferences specified within the IDL Development Environment. In order to set these system variables, IDL does the following things when it starts up:

  1. It checks for the presence of environment variables that correspond to the system variables. If an environment variable exists, IDL uses the value specified by the environment variable to set the value of the corresponding system variable.
  2. Note
    Note that some environment variables used by IDL do not have corresponding system variables; see below for details.

  3. If the environment variable does not exist, and a preference for the system variable's value has been set via the IDL Development Environment's Preferences dialog, IDL uses the preference value to set the value of the corresponding system variable.
  4. If neither the environment variable nor a preference for the system variable's value exist, IDL uses a default value.
  5. Note
    In some cases, the aspects of IDL's behavior that can be controlled by environment variables can also be controlled by setting the values of the corresponding system variables in a startup script. See Startup Files for details.

Setting Environment Variables

The process used to set environment variables varies depending on the operating system you are using.

UNIX and MacOS X Systems

On UNIX systems, environment variables are generally specified in a file read by your shell program at startup. Syntax for setting environment variables varies depending on the shell you are using, as does the file you use to specify the variables. If you are unsure how to set environment variables on your system, consult the system documentation or a system administrator.

For example, to set the environment variable IDL_PATH to the value /usr/local/idl when using a C shell (csh), you would add the following line to your .cshrc file:

setenv IDL_PATH /usr/local/idl 

Similarly, to set the same variable when using a Bourne shell (sh), you would add the following line to your .profile file:

IDL_PATH="/usr/local/idl" ; export IDL_PATH 

Microsoft Windows Systems

On Microsoft Windows systems, environment variables are set in the Environment Variables dialog, which is accessible from the System Control panel. Some Windows versions allow you to set environment variables either only for the user you logged in as ("user variables") or for all users ("system variables") - setting IDL environment variables as user variables means that other users who log on to the computer will not have access to your environment variable values.

Environment Variables - All Platforms

The following environment variables are checked on all platforms.

HOME

IDL uses the value of the $HOME environment variable when storing user-specific information in the local file system.

Note
Under Microsoft Windows, the HOME environment variable may not be set in all cases. If it is not set, IDL first attempts to substitute the USERPROFILE environment variable (which usually looks something like C:\Documents and Settings\username where username is the login name of the current user). If USERPROFILE is not set, IDL uses the value of the first of the following it finds: the TEMP environment variable, the TMP environment variable, the Windows system directory.

IDL_CPU_TPOOL_NTHREADS

Set this environment variable to a value greater than 0 to specify the number of threads IDL should use in thread pool computations instead of defaulting to the number of CPUs present in the underlying hardware. This defines the number of threads used by IDL when thread pool usage is not otherwise specified. Setting the CPU procedure TPOOL_NTHREADS keyword, or routine-specific thread pool keywords at the time of execution overrides this environment variable setting. !CPU provides details on the state of the system processor and of IDL's use of it. Multithreading in IDL provides information on situations when limiting the number of threads used by IDL may be beneficial.

IDL_DEVICE

Set this environment variable equal to the name of the default IDL graphics device. Setting this value is the same as setting the value of the IDL system variable !D.NAME. Note that the concept of a graphics device applies only to IDL Direct Graphics; IDL Object Graphics do not use the current graphics device. See !D System Variable for details.

IDL_DIR

Set this environment variable equal to the path to the main IDL directory. Setting this value is the same as setting the value of the IDL system variable !DIR. See !DIR for details.

IDL_DLM_PATH

Set this environment variable equal to the path to the directory or directories containing IDL dynamically loadable modules. At startup, IDL uses the value of this environment variable, if it exists, to initialize the IDL system variable !DLM_PATH. Due to the nature of DLMs, the value of !DLM_PATH cannot be changed after IDL has started. See !DLM_PATH for details. For information on how IDL_DLM_PATH is interpreted by IDL at startup, along with syntax options for specifying the path string, see The Path Definition String under EXPAND_PATH.

Note
On Windows, using the IDL_DLM_PATH environment variable is the only way to specify the path to DLMs.

IDL_HELP_PATH

Set this environment variable equal to the path to the directory or directories containing IDL help files. At startup, IDL uses the value of this environment variable, if it exists, to initialize the IDL system variable !HELP_PATH. See !HELP_PATH for details. For information on how IDL_HELP_PATH is interpreted by IDL at startup, along with syntax options for specifying the path string, see The Path Definition String under EXPAND_PATH.

IDL_PATH

Set this environment variable equal to the path to the directory or directories containing IDL library (.pro and .sav) files. At startup, IDL uses the value of this environment variable, if it exists, to initialize the IDL system variable !PATH. See !PATH for details. For information on how IDL_PATH is interpreted by IDL at startup, along with syntax options for specifying the path string, see The Path Definition String under EXPAND_PATH.

Note
If you set the IDL_PATH environment variable, you must include the token <IDL_DEFAULT> in the path you specify if you want IDL's default libraries to be included in the !PATH system variable.

IDL_PATH_CACHE_DISABLE

Create this environment variable to disable IDL's path caching mechanism. The existence of this variable is sufficient to disable path caching; the specific value of the variable is unimportant.

Note
It is very rarely desirable to completely disable the path caching mechanism. See PATH_CACHE for complete details.

IDL_STARTUP

Set this environment variable equal to the path to an IDL batch file that contains a series of IDL statements which are executed each time IDL is run. See Startup Files for further details.

IDL_TMPDIR

IDL, and code written in the IDL language, sometimes need to create temporary files. The location where these files should be created is highly system-dependent, and local user conventions are often different from standard practice. By default, IDL selects a reasonable location based on operating system and vendor conventions. Set the IDL_TMPDIR environment variable to override this choice and explicitly specify the location for temporary files.

The GETENV system function handles IDL_TMPDIR as a special case, and can be used by code written in IDL to obtain the temporary file location. See GETENV for more information.

Environment Variables - UNIX and MacOS X

The following environment variables are used by IDL for UNIX or MacOS X.

DISPLAY

IDL uses the DISPLAY environment variable to choose which X display is used to display graphics.

TERM

As with any X Windows program, IDL uses the standard UNIX environment variable TERM to determine the type of terminal in use when IDL is in command-line mode.

LM_LICENSE_FILE

IDL's FlexLM-based license manager uses the value of this environment variable to determine where to search for valid license files. Consult the license manager documentation for details.


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]