In this file we describe the instalation of the Scilab Image Processing
toolbox from source and for binaries; for Unix/Linux and W1ND0WS.

Installation From Binaries
==========================

WINDOWS   
   Installation under windows very simple. But if you enconter any 
   difficulty, feel comfortable to send me an 
               e-mail: rfabbri@if.sc.usp.br 

   1) ImageMagick library
   First you will have to download install the ImageMagick
   library version 5.4.3 for windows 2000/NT. 
   This is necesary for dealing with various image file formats.  
      I- Get ImageMagick.
            go to:
               ftp://ftp.nluug.nl/pub/ImageMagick/binaries
            and get the newest package. Its name is something like this:
            "ImageMagick-win2k.zip". This "win2k" package works
            for w1ndows 95 up to XP. 

     II- Install ImageMagick.
            Just unzip the file into any directory, say "c:\Program Files"

         
   2) Install SIP
      We suppose here that <PATH> stands for the path of the directory
      containing this README file.
      Execute, once, the following instruction 
      within Scilab:

               exec <PATH>\builder.sce 

      for example, on my machine that command is:

               exec 'c:\program files\sip-0.1.0-win\builder.sce'

      You will be asked to double-click any file inside ImageMagick
      directory. This is necessary because the SIP toolbox has to
      know where you have put ImageMagick.
      Now please restart the computer. 

   3) Load SIP
         Execute within scilab:

               exec <PATH>\loader.sce

         for example, on my machine that command is:

               exec 'c:\program files\sip-0.1.0-win\loader.sce'

         this will load the toolbox into scilab. Now type 

               sipdemo()

         to see if everything is working fine.
         You must type "exec <PATH>/loader.sce" in every SCILAB
         session that you want to use the toolbox. You can put
         this instruction in you ".scilab" startup file for
         automatic loading.

         As an example, below is the sequence I do on my own machine 
         for automatic loading:
            I - edit c:\autoexec.bat with notepad.
                Add the following line at the end of autoexec.bat:

                  SET HOME=C:\USER\RFABBRI

           II - edit .scilab in c:\user\rfabbri
                Add the following line:

                  exec 'c:\program files\sip-0.1.0-win\loader.sce'

         now reboot your machine. That's it! Every time I enter 
         scilab it already loads the SIP toolbox!
                  


UNIX/LINUX systems
   Binaries for unix systems are not yet available. But see the
   source installation BELLOW. It is relatively simple, because
   SIP was written under Linux.


Installation From Source
========================
   The SIP toolbox sourcecode is portable. It is known to be compiled
   under Unix/Linux and Wind*ws, using any popular ANSI-C compiler.


UNIX/LINUX systems

   The installation from source on UNIX systems seems difficult,
   but it really is simple. Pay attention to each step, and if 
   you enconter any difficulty, feel comfortable to send me an 
               e-mail: rfabbri@if.sc.usp.br 
   And I'll get you through. Also take a look at the "COMMON
   PROBLEMS" section of this file.

   The requirements for SIP are:
      - Scilab 2.6 or CVS version
      - ImageMagick library 5.4.2 (read step 1 bellow)
      - GCC compiler

   1) ImageMagick library
   First you will have to download install the ImageMagick
   library version 5.4.2 or later. This is necesary for dealing
   with various image file formats.  

   Most linux systems already come with ImageMagick, but not
   version 5.4.2 or later. To check for this, type:

            convert | more

   and pay attention to the first line of output. It must have
   version 5.4.2 or later, and must have Q:16 written, not Q:8
   (i.e. SIP needs 16bit ImageMagick).
   If you got everyithing right, then you can skip this step.

   Now, you probably have an old ImageMagick. Ok. Don't worry,
   it's just a matter of uninstalling the one you have and
   installing the new version. Follow these steps:
      I- Uninstall your old ImageMagick.
            If your system is RedHat-like, then use a rpm manager.
            For Slackware, use pkgtool. The dependencies will
            have to be ignored.

     II- Get the new ImageMagick.
            go to:
               http://www.imagemagick.org/www/archives.html
            and get the newest source, or a binary package 
            for you system. (I prefer to install from source :-)

    III- Install ImageMagick.
            If you are going to compile the source, just type:
                  ./configure --enable-shared=yes --prefix=/usr/local
                  make 
                  make install

     IV- Test your installation. Type

                  convert | more

         and now the first line shoud say 5.4.2 (or later) and Q:16.

   That was it! You have just finished the most critical part of
   the instalation. Not that hard, uh?
   

   2) Scilab 2.6 bugfix
      If you are using CVS Scilab, you may skip this section.

      There is a small bug in Scilab 2.6 related to shared
      library construction. It is very simple to correct.
      If you don't want to bother downloading Scilab from CVS,
      you can correct the bug through the following steps:
         I- I will call the scilab directory "SCIDIR". Type:
               cd SCIDIR/config

        II- Edit the file Makeso.incl, and replace the line:
                  LDFLAGS = 
            by 
                  LDFLAGS = $(OTHERLIBS)

   3) Install SIP (finally!)
      We suppose here that <PATH> stands for the path of the directory
      containing this README file.

   * System Administrator
      After downloading the SIP package, move it to a directory
      of your preference (say, /usr/local), and unpack it: 
 
            mv sip-0.1.tar.gz /usr/local  
            cd /usr/local
            tar xzvf sip-0.1.tar.gz
            cd sip-0.1/
 
      Now, execute, once and for all, the following instruction 
      within Scilab:

            For Scilab 2.6 official version
               exec <PATH>/builder.sce 
            For Scilab CVS version
               sciversion='cvs'
               exec <PATH>/builder.sce 
      
      where <PATH> is the path to the sip directory (in the example,
      it is /usr/local/sip-0.1).

      This operation requires the GCC compiler.

  * User
      Should execute the following instruction within Scilab:

            exec <PATH>/loader.sce 

      before using the toolbox, the user can also put it  in his
      .scilab startup file for automatic loading.

WlND0WS compilation
   It is possible to compile SIP under wind*wz, using any ANSI-C
   compiler that generates win32 native code. These include Borland
   C++, Visual C++, the Cygwin tools, and much more.

   However, to install the wind*wz version from source, there is 
   not an automatic procedure yet. For the instructions to
   compile the sources, using your favourite compiler see bellow:

   Borland free C++ compiler
      This is a free compiler, which you can get from:
      http://www.borland.com/bcppbuilder/freecompiler/
      Please contact Edson Manoel <emanoel@grad.icmc.sc.usp.br>,
      or Ricardo Fabbri <rfabbri@if.sc.usp.br> for instrunctions
      on compiling SIP using BCPP 5.5.

   Visual C++ compiler
      This is an expensive compiler, but very popular.
      Please contact Jean-Philippe Chancelier
      <jpc@cermics.enpc.fr> or Scilab Group <scilab@inria.fr> for
      instrunction on compiling SIP using Visual C++.

                     --------//--------

COMMON PROBLEMS & SOLUTIONS
===========================

1) "sh: Magick-config: command not found"
   If this message appears while running the builder.sce script
   under UN1Xs, just insert the full path to the "Magick-config" program
   in your PATH and in root's PATH. Then run builder.sce again.


-----------------------------------------------------------------
SIP - Scilab Image Processing toolbox
Copyright (C) 2002  Ricardo Fabbri

See the file COPYING for license-related issues
