Builds and updates library files.
lib library file; lib library -flag; lib library file -flag1 -flag2;
(literal) name of library.
(literal) optional. name of source file to be updated or added.
(literal) optional. preceded by
-, controls operation of library update. To control handling of path information on source filenames:
add paths to entries without paths and expand relative paths.
reset all paths using a normal file search.
(default) leave all path information untouched.
drop all path information.
To specify a library update or a complete library build:
(default) update the symbol information for the specified file only.
update the symbol information for every library entry by compiling the actual source file.
delete a file from the library.
list files in a library.
To control the symbol type information placed in the library file:
(default) use strongly typed symbol entries.
save no type information. This should only be used to build a library compatible with a previous version of GAUSS.
To control location of temporary files for a complete library build:
(default) use the directory pointed to by the tmp_path configuration variable. If tmp_path is not defined, lib will look for a tmp environment variable.
use the same directory listed in the lib_path configuration variable.
Let us suppose that you have a file named
myprocs.gss located in your GAUSS
src directory. Let us further suppose that you would like to create a new library named mylibrary. You could accomplish that task like this:
lib mylibrary myprocs.gss;
Now that this library has been created, you could add other files in the same manner. To add a file named
mystats.gss would look like this:
lib mylibrary mystats.gss;
This second command will add the file
mystats.gss to the mylibrary which was created in the first step above. It will not overwrite or replace the library.
You may print the list of files contained in the library by using the
-list flag. Entering the command:
lib mylibrary -list;
at the GAUSS command line will produce the output similar to:
Listing library: mylibrary.lcg myprocs.gss mystats.gs
If you add procedures to one of the files in your library, you will need to update the library to reflect these new changes. Continuing with the example from above, if you added some new procedures to the file
mystats.gss, you could update the mylibrary library with the following command:
lib mylibrary mystats.gss -update;
Note that, as in the command above, the
-update flag must be used with a file. To update, or rebuild the references for all files in the library, use the
lib mylibrary -build;
The library management functionality offered by the lib command can also be accomplished interactively with windows and buttons, using the Library Tool in the user interface. See The Library Tool Chapter, for more information on using the Library Tool.
The flags can be shortened to one or two letters, as long as they remain
-build a library,
-li to list files in a
If the filenames include a full path, the compilation process is faster because no unnecessary directory searching is needed during the autoloading process. The default path handling adds a path to each file listed in the library and also expands any relative paths so the system will work from any drive or subdirectory.
When a path is added to a filename containing no path information, the file is searched for on the current directory and then on each subdirectory listed in src_path. The first path encountered that contains the file is added to the filename in the library entry.