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
define_external(..., GENARGS=f, ...) - save an external procedure
Calling Sequence
define_external( functionName ..., GENARGS=f, ...)
Parameters
functionName
-
name of externally defined subroutine
f
procedure used to generate a partial argument list
Description
Procedures returned by the define_external command contain runtime information about the linkage to their corresponding external library. Instead of saving this information which is only valid for the current session, Maple saves the original parameter sequence passed to define_external. These parameters are used to regenerate the external procedure in the next Maple session.
The parameters used by define_external are not always machine independent. For example, on a Windows machine you may link to "mystuff.dll", while on a Linux box, the filename must be "libmystuff.so". Similarly, arguments may contain installation specific references to paths. Use the GENARGS=f option to specify a command to generate platform-specific arguments to define_external. This option is replaced by the return value of . This happens before processing of all arguments.
Examples
The following links to the Windows version of clapack.dll that comes with Maple. If you only ever use this function on Windows, it is fine to declare it in the usual way.
dgetrf := define_external('dgetrf_',
'm':REF(integer[4]),
'n':REF(integer[4]),
'a':ARRAY(float[8]),
'lda':REF(integer[4]),
'ipiv':ARRAY(integer[4]),
'info':REF(integer[4]),
'LIB'="clapack.dll"
):
If you want to use the same function on both Windows and Linux, you may want to declare it as follows.
'GENARGS'=proc()
'LIB'=ExternalCalling:-ExternalLibraryName("clapack");
end proc
Other arguments can be returned as well as 'LIB'. When defining a named procedure, ensure it is saved.
clapack_args := proc( fn:string )
if fn = "dgetrf_" then
end if;
end proc;
dgetrf := define_external("dgetrf_",'GENARGS'=clapack_args):
See Also
COMPILE_OPTIONS, CustomWrapper, define_external, define_external,types, SharedLibrary, trademarks, WRAPPER
Download Help Document