MuPAD ... Dynamic Modules


Contents

  1. Introduction
  2. How to use dynamic modules
  3. How to create dynamic modules
  4. Papers and examples of dynamic modules
  5. Index of algebraic examples

Introduction

The concept of dynamic modules allows the MuPAD user to integrate C++ functions and also software packages into MuPAD. For this, no interprocess communication is used, but a concept of dynamic linking. This is an extrem fast method to call external functions and to pass very large arguments and allows MuPAD users truely to extend the MuPAD kernel. Programming of Dynamic Modules is easy.

A brief introduction is given in the article Spiel (fast) ohne Grenzen. A detailed technical description of the concept of Dynamic Modules is published in the MuPAD Report Vol. 1. We are working on an english documentation, but this will not be available before spring 1997.

Dynamic Modules are supported on UNIX systems. The Macinosh PowerPC of MuPAD will be supported soon. The Windows 95 version will follow a few weeks later.

How to use dynamic modules

Dynamic Modules are used in the same way as MuPAD library packages. The only difference: instead of loadlib, the function loadmod is used. unloadmod allows to unload (remove from MuPAD and the memory) the machine code of Dynamic Modules. If it is needed later in the MuPAD session it reloaded automatically (load on demand).

How to create dynamic modules

Programming of Dynamic Modules is easy. The complete user's source code of the Module test (see above) is displayed below:
MFUNC( date, MCnop )
{   time_t   clock;
    char    *dstrg;

    MFnargsCheck(0);

    time(&clock);
    dstrg = ctime(&clock);
    dstrg[24] = '\0';

    MFreturn( MFstring(dstrg) );
} MFEND
In order to generate a loadable (binary) MuPAD Module this source code is saved in the file test.C and the so-called MuPAD Module Generator (mmg) is called. The Module Generator adds some code for the module management and controls the run of the compiler and linker. After that, the Dynamic Module test.mdm is placed in the current directory:
andi> mmg test.C -V "Ein Testmodul"
andi> ls test.*
test.C     test.mdm*
This can be loaded in MuPAD as demonstrated above.
Author: MuPAD-Webmaster
Last update: 02. Dec. 1996