## `loadlib` -- load a library package

#### Introduction

`loadlib(`libname`)` loads the library package `libname`.

#### Call(s)

`loadlib(libname)`

#### Parameters

`libname` | - | the package name: a string

#### Returns

`TRUE` if the package has been loaded successfully, and `FALSE` if the package was already loaded.

#### Related Functions

`export`, `LIBPATH`, `loadmod`, `loadproc`, `package`, `Pref::verboseRead`

#### Details

- `loadlib` is obsolete. Please use `package` instead.
- `loadlib` loads the library package with the name `libname`. The library packages from the MuPAD distribution, such as, e.g., `fp`, are loaded automatically at startup. Thus `loadlib` is only relevant for loading user defined packages.

- `loadlib` searches for the initialization file of the given library package. This may be either a MuPAD binary file `libname.mb` or a MuPAD text file `libname.mu`, where `libname` is the name of the library package. The file is searched for in the subdirectory `LIBFILES` relative to each of the directories given by `LIBPATH`. `loadlib` first searches all corresponding directories for the binary file `libname.mb` and reads the first matching file. If none is found, then the text file `libname.mu` is tried.

  The file `fp.mu` in the subdirectory `LIBFILES` of the directory where the MuPAD system library is installed can be used as a model for a library initialization file.

- You may make the system automatically load user defined library packages by adding the local directory where the packages reside to `LIBPATH`. The initialization files for the library packages must be located in the subdirectory `LIBFILES` of the local directory.

- `loadlib` returns `TRUE` if the package was found and successfully loaded. `FALSE` is returned if the package is already loaded. An error occurs if the package was not found.

- A library is loaded only once at the first call of `loadlib`. A subsequent call does not re-load the same library.

#### Changes

- `loadlib` will be removed in future releases.

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000