|  |  3.8.11 Loading a library 
Libraries can be loaded with the LIBor theloadcommand
(see  LIB and see  load). 
 
Syntax:LIBstring_expression;
 loadstring_expression;Type:none
Purpose:Reads a library from a file. If the given filename does not start with
. or /  and if the file cannot be located in the current
directory,  the SearchPathis checked for a  directory containing
a file with this name.Note on SearchPath:The SearchPathfor a library is constructed at SINGULAR
start-up time as follows:
the directories contained in the environment variable
SINGULARPATHare appended.
the directories $BinDir/LIB,$RootDir/LIB,$RootDir/../LIB,$DefaultDir/LIB,$DefaultDir/../LIBare appended, where
$BinDiris the value of the environment variableSINGULAR_BIN_DIR, if set, or, if not set, the directory in which the
SINGULAR program
resides$RootDiris the value of the environment variableSINGULAR_ROOT_DIR, if set, or, if not set,$BinDir/../.$DefaultDiris the value of the environment variableSINGULAR_DEFAULT_DIR, if set, or/usr/local. 
all directories which do not exist are removed from the SearchPath. 
For setting environment variables, see  system, or consult the manual of
your shell.
 
The library SearchPathcan be examined  by starting up
SINGULAR with the option-v, or by issuing the commandsystem("--version");. 
Note on standard.lib:Unless  SINGULAR is started with the --no-stdliboption, the
librarystandard.libis automatically loaded at start-up time.
 
Following a LIBorloadcommand, only the names
of the procedures in the library are loaded. The body of a particular
procedure is only read upon the first call of the procedure. This
minimizes memory consumption by unused procedures. Starting
a SINGULAR  session with the-qor--quietoptionunsets theoptionloadLiband
inhibits, thus, the monitoring of library loading (seeoption). 
All libraries loaded in a SINGULAR  session are displayed upon
entering listvar(package);: 
 |  |  option(loadLib);   // show loading of libraries;
                    // standard.lib is loaded
 listvar(package);
==> // Singmathic                     [0]  package Singmathic (C,singmathic.s\
   o)
==> // Standard                       [0]  package Standard (S,standard.lib)
==> // Top                            [0]  package Top (T)
                    // the names of the procedures of inout.lib
 LIB "inout.lib";   // are now known to Singular
==> // ** loaded inout.lib (4.1.2.0,Feb_2019)
 listvar(package);
==> // Inout                          [0]  package Inout (S,inout.lib)
==> // Singmathic                     [0]  package Singmathic (C,singmathic.s\
   o)
==> // Standard                       [0]  package Standard (S,standard.lib)
==> // Top                            [0]  package Top (T)
 | 
 
See
 Command line options;
 LIB;
 Procedures and libraries;
 SINGULAR libraries;
 proc;
 standard_lib;
 string;
 system.
 
 |