-----------------------
HOW TO INSTALL GETFEM++/Matlab toolbox
-----------------------

The installation of the Getfem++ Matlab toolbox requires :

- perl installed in /usr/bin/perl

- MATLAB at least version 6 and mex for compiling MATLAB interface. 

- getfem++ somewhere on your disk, allready compiled (and optionnaly installed)
Note that the shared library libgetfem.so is not required, only the static library.
Hence you just have to compile getfem++ with 
./configure CXX=mycompiler --disable-shared

- a decent c++ compiler (gnu/g++ >= 3.0 , compaq/cxx >= 6.2 ). There is no
obligation to use the same compiler as the one with which matlab was compiled.

Remark: the OpenGL renderer of matlab displays some artifacts with getfem 3D graphics.
You should change it for the zbuffer one with set(gcf, 'renderer', 'zbuffer').

Quick Install:

( tar xzvf getfem++-1.x.tar.gz && cd getfem++-1.x && ./configure --disable-shared && make check )
( tar xzvf getfem-matlab-1.x.tar.gz && getfem-matlab-1.x && 
  ./configure --with-getfem-config=$HOME/getfem++-1.x/getfem-config-notinstalled && make check )


----------------------------------------------------------------------
Detailed Installation process (if quick install does not work..) 
----------------------------------------------------------------------

- unpack archive

- the ./configure will look for a getfem-config file in default paths. If you just compiled getfem++ but
did not install it, append --with-getfem-config=/path/to/getfem++/getfem-config-notinstalled to the 
./configure command line. If getfem was installed in a non-standard directory, you can provide the full
path to the install getfem-config script with this option.

- if you need to turn on the debugging of getfem_matlab for any reason, you can specify --enable-maintainer-mode

- the mex files and .m files will go in the directory specified by the
  --with-toolbox-dir option. Nothing else will be installed.

- if you already had an old version of the toolbox in this directory, run
  make clean 
  in order to start on a good basis.

- if configure did not complain, just run
     make  (or gmake on non-gnu systems)

- if the make succeeded, run 
     make install

- run "make check" to perform some basic checks. Try the various demo in the tests directory
(for example demo_tripod.m)

- alternative build procedure: use the --enable-matlab-rpc
option. This will build a small mex file and a 'getfem_server'
executable. The advantage is that getfem and matlab a not intermixed
and communicate via sockets (UNIX or INET). It can be useful to find if a crash is
coming from getfem, or from matlab. It is also necessary with some compilers
(for example it is not possible to build a mex file with the intel c++ compiler).
The getfem_server will be launched automatically by matlab, or you can launch it
"by hand" with ./getfem_server -tcp (but this requires the portmap service running).

The add the toolbox-dir to your MATLABPATH.

You can check that everything is correctly installed by running matlab, and
typing the name of any getfem++/matlab command (for example gf_delete).  

* If matlab does not find it, check your matlabpath.

* If the function complains about missing arguments, then everything is
 fine. You can start reading the user manual!
