Tree [ada153] master /

File Date Author Commit
 config 2013-09-19 Ricardo Fabbri Ricardo Fabbri [ada153] simpletoolbox works on scilab master branch as ...
 src 2013-09-19 Ricardo Fabbri Ricardo Fabbri [ada153] simpletoolbox works on scilab master branch as ...
 COPYING.txt 2005-07-18 Angus Errington Angus Errington [a4bedb] Initial Import
 ChangeLog.txt 2005-07-23 Zhang Cheng Zhang Cheng [7d766e] no message 2013-09-19 Ricardo Fabbri Ricardo Fabbri [4fc1c5] minor changes to makefile
 README.txt 2005-07-18 Ricardo Fabbri Ricardo Fabbri [d71742] changed email address 2013-09-19 Ricardo Fabbri Ricardo Fabbri [1eb64f] updated autogen to match SIP 2013-09-19 Ricardo Fabbri Ricardo Fabbri [7f7d22] compiles.

Read Me

This is a simple package to show how the GNU Autotools may be used
to build a Scilab toolbox. Although this is a simple example, this
framework is very robust and flexible, allowing you to:

   o  Add tests for external libraries and system routines

   o  Make very portable toolboxes: they will work with almost all
      Unix flavours, including MinGW and Cygwin under Windows

   o  Make your toolbox work with different versions of Scilab,
      both installed from source and from binaries

   o  Have total control over the build process

This and other advantages enables the programmer to build complex
toolboxes in a robust easy-to-install way.



$ configure 

This will configure the toolbox to be installed at SCI/contrib/simple.
To install in another directory, say $HOME/temp: 

$ mkdir $HOME/temp
$ configure --prefix=$HOME/temp

To compile and install the toolbox:

$ make
$ make install

Now enter inside scilab and execute the "loader.sce" script placed in 
the directory where the toolbox was installed. There will be silly a 
routine called "soma" that returns the sum of its two arguments. Of 
course, the autoconf/automake setup is suited for complex projects, 
not simple ones, but this is just an example.


MinGW (Minimallist GNU for Windows) is a set of development tools for 
generating native Windows code. It enables you to compile this toolbox 
using configure and make, similar to Unix. 

There are some specific things that you must set up by hand in 
order to compile this toolbox with MinGW. The whole process consists 
in the following steps

1) Vist, download and install the following packages:
   MinGW, MSYS, and MSYS-DTK

2) Your scilab installation must be in c:\scilab (/c/scilab in MSYS), 
   because this path is hardcoded in the build process.  Please move 
   your scilab installation to that place or else put an entry in the 
   /etc/fstab file inside MSYS.  You can also alter the SCIDIR 
   variable in the file but this was not tested. 

3) Inside /c/scilab/bin (MSYS path), we must rename the libraries 
   "LibScilab.*" to lowercase. Even though Windows is case 
   insensitive, this causes problem to programs inside MSYS. 
   This step can be quickly done inside the MSYS shell typing this:

      mkdir /tmp/scilibs
      mv /c/scilab/bin/LibSci* /tmp/scilibs
      cd /tmp/scilibs
      for i in `ls Lib*`; do
         mv $i /c/scilab/bin/`echo $i | tr A-Z a-z`;

4) Enter the toolbox's toplevel directory, and type:

      make install

5) For some versions of libtool/automake you may have to install the 
   DLL of the toolbox by hand:

      cp src/.libs/libsimple*.dll /c/scilab/contrib/simple/libsimple.dll

Now enter Scilab and execute the "loader.sce" script placed in the 
directory where the toolbox was installed.

To Adapt the Package for Yourself

First make sure you have the latest autoconf, automake and libtool
installed in your system. They can be downloaded respectively at:

Just in case you want to learn more about the GNU Autotools, the
following book is excellent:

But you don't need to read it to get started. Just you follow these steps:

1- Write your C routine. The sourcecode and inteface code are in
   ".c" files under the "src" directory. The soma_int.c contains a
   very simple example of a routine called "soma" that returns the
   sum of its two arguments.

2- define a name for your package, say "mypack".

3- edit config/lib_build.sce
   a) The only variables that you need to customize for your package are
   "lib_name", "sources", and  "table". They are pretty intuitive,
   just do something analogous to what's done for the "simple" toolbox.

4- edit 
   a) Change the lines:
         AC_INIT([simple], [1.2], [])
         AC_INIT([mypack], [1.0], [])

      Of course I wrote example names. Put your real data instead of
      "mypack", "".  The file "your_c_file.c" is
      any one of your source files, but just one.

   b) In the lines:
         if test "x$prefix"  = xNONE; then 
      replace "simple" by "mypack" (your package name).

7- Remove the "src/libsimple.c" file

8- Edit the file "config/"
   a) place any custom code to be executed when your toolbox loads
   b) edit the lines specific to the SIMPLE toolbox. Put your specific
   information instead.

9- type ./bootstrap --all

If everything goes well, your package is ready and you will be able to type:

make install


First, the script "bootstrap" gets your definitions in
config/lib_build.sce and generates a from
your (in the src dir), using the script
config/  This is just for convenience, since
when your package grows you won't neet to enter the sources in both and lib_build.sce, but only once.

After that, the script runs autoconf, automake and libtool, together
with any parameters that these packages need. This will create many
files, mainly the configure script and the final Makefiles.

You must run bootstrap when :
   - a new ".c" source is added to "lib_build.sce".  In this case, you
     must use the "--all" parameter, as in step 9 above
   - you edit of the src directory 

When you edit "" or the toplevel "", you must
run the "autoreconf" script.

That's It!

For a more complex example, checkout the Scilab Image Processing
toolbox (SIP) at 

Please send comments and bugreports to the proper mailing list at:

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks