Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
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