Environment variables for ASCEND

From ASCEND
Jump to: navigation, search

The following environment variables affect how ASCEND runs. In most cases, if the default behaviour is not correct, the only ones you will need to set are ASCENDLIBRARY and possibly LD_LIBRARY_PATH (or PATH on Windows).

How to set environment variables: On Linux and Mac, you can temporarily set environment variables from your terminal using the export command, or permanently by editing your .bashrc or .profile file (depends on your distribution). On Windows, see these instructions.

ASCENDLIBRARY

This variable defines the search path that is used when attempting to load files named on the command line or named in REQUIRE statements.

This variable a PATH-style variable, which means that on Windows it is semicolon-delimited, whereas on Linux it is colon-delimited. If you are using MSYS/MinGW then be aware that there is no magical transformation; you still need to us semicolons.

When ASCEND loads, the following methods are used in order of decreasing priority:

  • the ASCENDLIBRARY environment variable, if present
  • the value of librarypath from ~/.ascend.ini, if defined.
  • (Windows only) the value of the registry variable HKLM\SOFTWARE\ASCEND\ASCENDLIBRARY, if defined
  • the default value defined at compile-time.

The following is possibly subject to revision:

The exception to this is that if the ASCENDLIBRARY variable is defined, but it does not contain the standard ASCEND Model Library folder (probably /usr/share/ascend/models or c:\Program Files\ASCEND\models), then it will be added to the end of the ASCENDLIBRARY path. This is to ensure that the model library will always be available for use with REQUIRE statements, and to make setting of non-standard paths a little more convenient.

See also REQUIRE, IMPORT.

ASCENDSOLVERS

This variable is used in the package_load function that ASCEND uses in IMPORT statements, when loading external libraries, including solvers.

ASCEND defines a value for ASCENDSOLVERS when ASCEND is first launched. The value used is, in order of decreasing priority:

  • The ASCENDSOLVERS environment variable if available (appending standard folder to end if it is missing),
  • (Windows only) the registry key HKLM\SOFTWARE\ASCEND\ASCENDSOLVERS, if present, or
  • a default value defined at compile time.

If ASCENDSOLVERS is not defined, ASCEND next looks for external libraries in the other locations indicated by the ASCENDLIBRARY environment variable, which means that you can store your external libraries as well as your model files in the same directory structure if you wish to.

The following is possibly subject to revision:

If the ASCENDSOLVERS environment variable is defined, and if it does not contain the standard solvers folder (probably /usr/share/ascend/solvers or c:\Program Files\ASCEND\solvers) then this folder will be added to the end of the ASCENDSOLVERS path. This is to ensure that the basic minimal set of ASCEND solvers is always available, to avoid confusion.

See also IMPORT.

ASCENDTK

This environment variable is used to define the location of the Tcl/Tk support files used by the ASCEND Tcl/Tk GUI. It defaults to $ASCENDDIST/TK. It has no effect on the PyGTK GUI.

ASCENDBITMAPS

Defines the location of bitmap files used in the Tcl/Tk GUI. Defaults to $ASCENDDIST/bitmaps. It has no affect on the PyGTK GUI.

ASCENDDIST

This environment variable is used by the ASCEND Tcl/Tk GUI to define the location of its common files. It can also be used to create 'off root' installations, by allowing ASCEND to locate its files using relative paths. Depending on compile-time settings (specifically the value of @ASC_ABSOLUTE_PATHS@), ASCENDDIST defaults to either $PROGDIR/@ASC_DATADIR_REL_BIN@ or @ASC_DATADIR@ (where the '@...@' variables are defined at compile time, and $PROGDIR is the directory containing the ascend4 binary).

ASC_GDB

If present and non-zero, causes the ASCEND PyGTK GUI to run via the gdb debugger (part of GNU GCC). This is made available because, since ASCEND PyGTK is essentially a Python program, it can be a little difficult/inconvenient to run it through a debugger.

LD_LIBRARY_PATH

When launching ASCEND PyGTK, this environment variable is examined to ensure that it contains the location of libascend if necessary. If libascend is installed anywhere except /usr/lib, then its location is added to the end of LD_LIBRARY_PATH before continuing.

When using the IPOPT solver, it may also be necessary to use this env var to point to external solvers such as /usr/local/lib/libhsl.so.

On operating systems other than Linux, this environment variable has different names. On Windows, use 'PATH'; on Mac OS X, use 'DYLD_LIBRARY_PATH'.