igdx: Initialize the External GDX Libraries

View source: R/gdxrrw.R

igdxR Documentation

Initialize the External GDX Libraries

Description

Initialize (i.e. load) the external GDX libraries that are required to interface with GDX data, and report on the status of the initialization.

Usage

igdx(gamsSysDir=NULL, silent=FALSE, returnStr=FALSE)

Arguments

gamsSysDir

a directory containing the external GDX libraries, typically the GAMS system directory. If this argument is omitted, no loading is done but we still report on the initialization status.

silent

controls logging of results

returnStr

controls what to return. If FALSE, return TRUE if the external GDX libraries are loaded, FALSE o/w. If TRUE, return the path to the external GDX libraries if loaded, an empty string otherwise.

Details

To query but not modify the current GDX library binding, leave the gamsSysDir argument NULL. To clear, reload, and then query the GDX library binding, pass a string argument to gamsSysDir.

If gamsSysDir is a non-empty string containing a valid directory, it will be tried first. If the GDX libraries cannot be loaded from this location, the next load attempt will make use of the environment variable R_GAMS_SYSDIR, provided it is set to a non-empty string. If we are still not successful, as a last resort we try to load the GDX libraries using the system-specific library search mechanism (e.g. the PATH on Windows or LD_LIBRARY_PATH on Linux).

Value

By default (when returnStr is FALSE), the return value is TRUE if the external GDX libraries are loaded, FALSE o/w. If returnStr is TRUE, the return value is the path to the directory containing the external GDX libraries if these libraries were successfully loaded, an empty string otherwise.

Note

The directory containing the external GDX libraries is also where we look for the gams executable, so calling igdx prior to calling gams ensures that the gams executable can be located. Consider saving a .First function like the following to your R workspace: .First <- function() { library(gdxrrw) ; igdx("/your/GAMS/sysdir")} or set the environment variable R_GAMS_SYSDIR.

Author(s)

Steve Dirkse. Maintainer: R@gams.com

See Also

rgdx, wgdx, gams, gdxInfo

Examples

  ## Not run: 
    igdx("C:\Program Files\gams23.6");
    igdx("/usr/gams/23.6.3");
  
## End(Not run)
  igdx();

GAMS-dev/gdxrrw-miro documentation built on July 11, 2024, 4:39 p.m.