Compiling CSIM from the sources
Subsections

Compiling CSIM from the sources

The instruction in this section are relevant in two cases

a)
You do not have Linux (x86 architecture) or Windows as an operating system.1

b)
You are planning to add your own models written in C++ to CSIM; see section 5 for more information on this topic.

Currently we support compilation using (GNU) make for Linux/Unix (which most likly also works for Mac OS X) and nmake (Microsoft Visual C++) for Windows (tested only with Windows XP). The corresponding Makefiles are lsm/csim/src/Makefile and lsm\csim\src\Makefile.win.

Step by step instructions

  1. To compile CSIM from the sources you must first setup Matlab's mex utility properly. This can be achieved by issuing the command mex -setup at the Matlab prompt. For more information on compiling MEX-files see the MEX-files Guide.

  2. Optional steps: If you are planning to add your own models written in C++ to CSIM and are not using Linux or Windows you have to build the reggen tool which comes with CSIM (lsm/develop/reggen) for your platform.2

    1. Go to lsm/develop/reggen
    2. Run
      • configure; make; for Linux/Unix(/Mac OS)
      • make.bat msvc for Windows XP with MS Visual C++
    3. If this fails read lsm/develop/reggen/INSTALL and try to fix the build. In this case you will notice that reggen is a modified version of the well known tool doxygen.

  3. Edit the corresponding Makefile to meet your system configuration.

  4. Goto csim/src and run
    • make for Linux/Unix(/Mac OS)
    • nmake -f Makefile.win for Windows (XP)

We do not know whether this instructions work on systems other than Windows XP with MS Visual C++ and Linux with gcc (3.4 or higher). The External Interfaces/API section of the Mathworks web site and the Tech-Note 1601 contain valuable information about compiler requirements for compiling C++ MEX files.

 
(C) 2003, Thomas Natschläger last modified 07/10/2006