Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
The Predefined Variable libname
Description
This special name specifies the file-system location of the main Maple library and other libraries such as package libraries and user libraries. Its value is normally a single string. By setting libname to a sequence of strings, you can specify locations that are sequentially searched for routines. Each location must be a directory that contains a hierarchy of Maple .m files or Maple archives, or the full path of the .mla or .lib file of a Maple archive (see march).
A repository can be created using the command march('create',"filename"), where "filename" is a string specifying the location of a .mla or .lib file. Name/value pairs can be saved in a library by setting the global variable savelibname, and calling savelib('name') (see savelib). Values can be retrieved from a repository by assigning libname := (libname, "filename"). After "filename", or the directory containing "filename" is in your library search path, the name/value pairs stored in that repository are automatically assigned. For example, the following sequence of commands shows how to create a repository, save a procedure named dostuff, and access it after restart.
> march('create',"/home/user.mla");
> dostuff := proc(x) x^2; end proc:
> savelibname := "/home/user.mla":
> savelib('dostuff'):
> restart;
> libname := libname, "/home/user.mla":
> dostuff(3);
9
When the value of libname is a sequence of strings (directory paths or .mla and .lib file paths), Maple searches the specified libraries (in the order specified by the sequence) for the named routine or package of routines. If a directory contains more than one library, Maple searches the libraries in the priority order specified in the archive. For more details on archive priority, see march. For example, the commands:
> libname := "/usr/me/mylib/joe.mla","/usr/maple/lib";
> myexpand;
result in the two specified locations being searched for a definition of myexpand in a file or a member named myexpand.m. First the single library "joe.mla" in the directory "/user/me/mylib" is searched, and then, if necessary, the libraries in the directory "/usr/maple/lib" are searched. The search is terminated on its first success. In particular, this mechanism allows for easy additions or replacements to the main library.
The locations of user-created Maple help databases (.hdb files) can also be added to libname. See About Help Databases in Maple and INTERFACE_HELP for more information.
To see its current value, enter libname; at the Maple prompt. Notice that any names assigned to libname are converted to strings.
The current directory, "." will appear in the default value of libname. Any .mla in the current directory will be found, and the things stored inside will be available for use. Using the currentdir command to change the working directory will cause an implicit update of libname, making the libraries in the new directory available instead of the ones from the prior path.
The libraries of any installed toolboxes are appended to libname in alphabetical order by toolbox directory name, based on the notion of ordering in a standard directory in the local operating system.
Users can assign an initial value for libname on the command line or in their initialization files. See maple for details. Automatic loading of Maple library functions is accomplished by using this global variable, so users are advised not to change it in the middle of a session.
See Also
file, index/function, initialconstants, INTERFACE_HELP, maple, maplehdb, read, save, savelib, with
Download Help Document