[Contents] [TitleIndex] [WordIndex

1. Porting Scicos 4.2 into Scilab 5.0

1.1. From SCICOS_WORK to TRUNK: the reorganization of the Scicos 4.2 source files inside Scilab 5.0

(31 Jan 2008)

The next Scilab 5.0 will contain a Scicos derived from the version present inside Scilab 4.1.2, but with a different organization and some adjustments in order to support Scilab 5.0 features. In the spirit of Scilab 5.0 modular architecture, the application program are organized as "modules". The "modules" reside in the folder "scilab/modules". We provide two basic Scicos modules:

as well as two additional modules:

1.1.1. Basic Scicos Modules

The first section is composed of the scicos and scicos_blocks modules.

 modules /
   scicos /
     demos /
     help /
       en_US /
       fr_FR /
       images /
       scicos_doc /
     includes /
     macros /
       scicos_auto /
       scicos_scicos /
       scicos_menus /
       scicos_utils /
     sci_gateway /
       c /
       fortran /
     src /
       c /
       fortran /
       modelica_compiler /
       ocaml /
       scicos_sundials /
     scicos.start
     scicos.quit
   scicos_blocks /
     demos /
     etc /
       scicos_blocks.start
       scicos_blocks.quit
     examples /
     help /
       en_US /
       fr_FR /
       images /
     includes /
     locales /
     macros /
       <palette_name> /
     sci_gateway /
       c /
       fortran /
     src /
       c /
       fortran /
       modelica /
     tests /
       benchmarks /
       unit_tests /
       nonreg_tests /

1.1.2. How we dit it

(Allan, Sylvestre, Simone, Laurent)

All Scicos-related files inside the SCICOS_WORK branch have been marked using standard GPL2 header.

Marked files:

In following folders:

 scilab/util                         (* please check this folder *)
 scilab/ocaml
 scilab/routine/scicos
 scilab/routine/scicos/sundials
 scilab/macros scilab/macros/util    (* please check this folder *)
 scilab/macros/auto
 scilab/macros/scicos
 scilab/macros/scicos_blocks
 scilab/demos/scicos                 (* please check this folder *)
 scilab/man/scicos                   (* used but not marked *)

1.1.3. Copying the files

From

SCICOS_WORK/scilab/routines/scicos/sundials

To

TRUNK/modules/scicos/src/scicos_sundials

ViewVC

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22036

Remark

This port is easy and transparent. The files are not marked because Sundials is release with a very permissive GPL2 compatible license. We use "scicos_sundials" because the files are patched.


From

SCICOS_WORK/scilab/routines/scicos/

To

TRUNK/modules/scicos/src/fortran

TRUNK/modules/scicos_blocks/src/fortran

ViewVC

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22038

Remark

This port of FORTRAN files it is a bit more tricky because we have separated the Scicos "core" files from the old Scicos bloks computational functions. These almost obsolete computational functions must be kept to ensure backward compatibility.


From

SCICOS_WORK/scilab/routines/scicos/

To

TRUNK/modules/scicos/includes

TRUNK/modules/scicos_blocks/includes

ViewVC

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22039

Remark

Same job than above, but this time for the include "*.h" files. In this stage of the Scicos evolution, the "includes" files must be kept global.



From

SCICOS_WORK/scilab/routines/scicos/

To

TRUNK/modules/scicos/src/c

TRUNK/modules/scicos_blocks/src/c

ViewVC

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22041

Remark

As above, but this time for the C files.


From

SCICOS_WORK/scilab/ocaml/

To

TRUNK/modules/scicos/src/modelica_compiler

ViewVC

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22044

Remark

Modelica compiler and utilities are copied in the corresponding module folder.


From

man

To

man

ViewVC

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22048

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22051

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22052

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22055

Remark

All help files moved to corresponding folder.


From

SCICOS_WORK/scilab/macros/auto

To

TRUNK/modules/scicos/macros/scicos_auto

ViewVC

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22046

Remark

Special attention is required for this macros: remember to load this library at the module activation (scicos.star).


From

SCICOS_WORK/scilab/macros/util

To

TRUNK/modules/scicos/macros/scicos_utils

ViewVC

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22047

Remark

Some useful macros used by Scicos.


From

SCICOS_WORK/scilab/macros/scicos

To

TRUNK/modules/scicos/macros/scicos_scicos

ViewVC

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22054

Remark

The main folder that contains editor (GUI), compiler, simulator (some parts) and the internal code generator.


From

SCICOS_WORK/scilab/macros/scicos_blocks

To

TRUNK/modules/scicos_blocks/macros

ViewVC

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22053

Remark

Full tree preserved.


1.1.4. Activation of Scicos modules

 <module name="scicos" activate="yes"/>
 <module name="scicos_blocks" activate="yes"/>


a) check these original SCICOS_WORK folders:

scilab/util
scilab/macros/util
scilab/demos/scicos

b) all the "buildmacros.sce" in all "macros" folders need revision (they contain some old references).

http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22064

c) add some comment for :http://viewvc.scilab.org/bin/cgi/viewvc.cgi?view=rev&amp;revision=22062

1.1.5. Summary of Sylvestre's work

Replace

#include "../machine.h"

With

#include "machine.h"

Remark

Already provided by the -I directive

Command

sed -i -e "s|../machine.h|machine.h|g" grep -r "../machine.h" *|grep -v .svn|cut -d: -f1|sort -u


Replace

#include "../stack-c.h"

With

#include "stack-c.h"

Remark

Already provided by the -I directive

Command

sed -i -e "s|../stack-c.h|stack-c.h|g" grep -r "../stack-c.h" *|grep -v .svn|cut -d: -f1|sort -u


Replace

#include "../stack.h"

With

#include "stack.h"

Remark

Already provided by the -I directive

Command

sed -i -e "s|../stack.h|stack.h|g" grep -r "../stack.h" *|grep -v .svn|cut -d: -f1|sort -u


Replace

#include "../callinter.h"

With

#include "callinter.h"

Remark

Already provided by the -I directive

Command

sed -i -e "s|../callinter.h|callinter.h|g" grep -r "../callinter.h" *|grep -v .svn|cut -d: -f1|sort -u


Replace

*->pixmap

With

sciSetPixmapMode and sciGetPixmapMode

Remark

-


Replace

../os_specific/*_mem_alloc.h

With

MALLOC.h

Remark

-


Remove

#define abs(x) ((x) >= 0 ? (x) : -(x))

#define max(a,b) ((a) >= (b) ? (a) : (b))

#define min(a,b) ((a) <= (b) ? (a) : (b))

Remark

Defined in #include "core_math.h"


Replace

#include "sundials/ida_impl.h"

With

#include "ida_impl.h"

Remark

Included by the makefile (-Isrc/scicos_sundials/)


Replace

#include "../os_specific/link.h"

With

#include "dynamic_link.h"

Remark

Module name changed and include


1.2. Modification of the Scicos code for Scilab 5 compatibility

Event handling

Menu

Graphics Dialog boxes


2022-09-08 09:27