[Contents] [TitleIndex] [WordIndex

1. Architecture of a Scilab Module (Scilab 5.x and 6.X)

This information may not be up-to-date. Please check howto/Create a toolbox for more up-to-date information

A module can be Scilab macros, java,Tcl/Tk, C, C++ and/or Fortran code. A module can (and should) contains other things like demos, help, unitary tests... This applies to Scilab 5.X. Scilab 4.X is completely different.

1.1. Description

A Scilab module should be composed like this:

Scilab module description

demos

Demos of the module which show features of the module

etc

Configuration of the module (initialization and configuration)

examples

examples (readme.txt)

help

Help of the module (Scilab help description)

includes

Header files which can be used externaly (other Scilab modules or third party programs)

locales

localization

macros

Scilab macros of the module

sci_gateway

Sources to plug the module into Scilab.

Sources should be splited into subdirs (src/c/ src/fortran/...).

src

Core sources of the module.

Sources should be splited into subdirs (src/c/ src/fortran/...). Local header (.h) should be put here

tests/unit_tests

Unitary tests which will be launched in order to test this module

tests/nonreg_tests

Non regression tests which will be launched in order to test this module

tests/benchmarks

Benchmarks which will be launched in order to test this module

Mandatory files:

Optional files:

1.2. Conception

The name of the module itself is quite important. It is must be composed only by letters, numbers and a just two special characters (_ or -). In the examples below, the module will be called <my_module_name>.

1.3. Guidelines

1.3.1. Rules for function profile & header declarations

1.4. How to develop a new internal module Step by Step

static OptimTable Tab[]=
{
{C2F(sci_optim),"optim"},
{C2F(sci_semidef),"semidef"},
{C2F(sci_fsolve),"fsolve"}
};

TODO : create a skeleton for this

1.4.1. Macro module

  • Create directory SCI/modules/<my_module_name>/macros'

  • edit buildmacros.sce and change genlib arguments

genlib(<21 characters of module's name> + 'lib','SCI/modules/elementaries_functions/macros');

example : elementaries_functions module

genlib('elementaries_functionlib','SCI/modules/elementaries_functions/macros');

1.4.2. Add a help chapter

  • Create a directory SCI/modules/<my_module_name>/help/en_US'

  • Add .xml files
  • Add a file addchapter.sce
  • Modify the file SCI/modules/helptools/etc/MAIN_CHAPTERS to add the module

2022-09-08 09:27