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
External Code
Description
The source code for many of the OpenMaple and define_external examples shown in these help pages is available in the samples directory of your Maple installation. In particular, samples/ExternalCall/HelpExamples/HelpExamples.c contains the source for all API function examples, and samples/OpenMaple/HelpExamples contains separate example C files for each StartMaple callback.
To build an OpenMaple application you need to specify the include path to maplec.h, which is found in the $MAPLE/extern/include directory. You also need to link to the maplec.lib (or libmaplec.so) library. The UNIX HelpExamples.c file also needs the standard C and standard math libraries, -lc and -lm, linked in. Before running your application make sure the appropriate path is set.
The following are sample command lines for building the sample program found in $MAPLE/samples/OpenMaple/simple for various platforms. Each command has two parts, the first line for setting the load-library search path, and the second for building the application. These all assume the environment variable $MAPLE is set to the Maple install directory (eg. MAPLE=/usr/local/maple).
O/S Environment Compile Command Linux (64-bit) LD_LIBRARY_PATH= gcc simple.c -o simple $MAPLE/bin.X86_64_LINUX -I$MAPLE/extern/include -L$MAPLE/bin.X86_64_LINUX -lmaplec Linux (32-bit) LD_LIBRARY_PATH= gcc simple.c -o simple $MAPLE/bin.IBM_INTEL_LINUX -I$MAPLE/extern/include -L$MAPLE/bin.IBM_INTEL_LINUX -lmaplec Mac OS X DYLD_LIBRARY_PATH= gcc simple.c -o simple (PPC, Intel, $MAPLE/ -I$MAPLE/extern/include 32-bit, bin.APPLE_UNIVERSAL_OSX -L$MAPLE/bin.APPLE_PPC_OSX and 64-bit) -lmaplec -lmaple -lgmp -lhf Solaris LD_LIBRARY_PATH= cc simple.c -o simple $MAPLE/bin.SUN_SPARC_SOLARIS -I$MAPLE/extern/include -L$MAPLE/bin.SUN_SPARC_SOLARIS -lmaplec Windows (32-bit) PATH= cl simple.c -Fe:simple.exe $MAPLE/bin.win -I$MAPLE/extern/include $MAPLE/bin.win/maplec.lib
Windows (64-bit) PATH= cl simple.c -Fe:simple.exe $MAPLE/bin.X86_64_WINDOWS -I$MAPLE/extern/include $MAPLE/bin.X86_64_WINDOWS/maplec.lib
For information about building examples for use with define_external, see ?SharedLibrary.
See Also
CustomWrapper, define_external, OpenMaple, OpenMaple/C/API, SharedLibrary
Return to Example Worksheet Index
Download Help Document