<< Libraries Libraries get_function_path >>

Scilab Help >> Fonctions avancées > Libraries > genlib

genlib

builds a library from a set of *.sci files defining functions in a given directory

Syntax

genlib(lib_name)
genlib(lib_name, dir_name)
genlib(lib_name, dir_name, Force)
genlib(lib_name, dir_name, Force, verb)
genlib(lib_name [,path=dir_name] [,verbose=verb] [,force=Force])

Arguments

lib_name
Scilab string: The identifying name ascribed to the library to build.

dir_name
Scilab string: The pathname of the directory containing .sci functions files, and where the lib file generated and defining the library will be stored. By default, the current working directory is considered.
The dir_name directory and its lib and .bin files must be writable.

Force
boolean value (default value is %f). Set it to %t to force the sci-files recompilation.

verb
boolean value (default value is %f). Set it to %t to display more information during the build.

Description

genlib(..) selects all files belonging to the dir_name directory and with the .sci extension. If any, subdirectories are never considered. If it is required, they must be compiled apart into independent libraries.

Then, an XML editable file named lib is created in the dir_name directory. The name lib_name of the library is recorded into it.

Then, for each .sci file:

Finally, genlib(..) loads the created or updated library and sets its identifier to a variable named lib_name, in the current scope. If the variable lib_name already exists and is protected, an error occurs: The library has been created but can't be loaded (predef all can be used to unprotect the variable named lib_name before running genlib(..)).

If the option force=%t is used, all .sci files are compiled, even if their content has not changed.

When in the directory of a library some former .sci files have been removed while all remaining .sci files are unchanged, rebuilding the library without the force=%t will anyway update the list of library's members.

If the option verbose is true, more information is displayed during the build process.

See also

History

VersionDescription
6.0.0
  • The file names is no longer required. The Names option is removed.
  • When a .sci file contains functions not named accordingly with the file name, they are no longer public: They are visible and callable only from the main function.
  • When a library named lib_name is already loaded, the default dir_name directory is no longer its directory (update mode), but always the current working one.
  • The generated lib file is now a human-readable XML file, instead of a binary.
  • genlib() can no longer register any variable as full member of a library.
  • By default, any .sci file is now recompiled if its content has changed, no longer if its modification date is newer than the .bin's one.
  • The generated .bin files can no longer be loaded independently with load().

Report an issue
<< Libraries Libraries get_function_path >>