DAKOTA/Scilab compiled interface
Yann Chapalain
07/20/2011
================================

The makefile compiles and links dakscilab, an analysis_driver for
DAKOTA that uses SCILAB to evaluate a function expressed in f.sci,
possibly using gradients computed by fp.sci and Hessians computed by
fpp.sci.  When first invoked (e.g., explicitly by "./dakscilab -s", or
implicitly when used by DAKOTA as an analysis_driver), dakscilab
starts a copy of itself that talks with SCILAB and talks with the
copies of dakscilab that DAKOTA invokes over named pipes.  This way,
SCILAB is kept alive, and the large startup cost of invoking SCILAB is
only paid by the initial "dakscilab -s" invocation.  If shell variable
$DAKSCILAB_PIPE is set to a nonempty value, the named pipes are called
${DAKSCILAB_PIPE}1 and ${DAKSCILAB_PIPE}2, i.e., their names are obtained
by appending "1" and "2" to $DAKSCILAB_PIPE.  If $DAKSCILAB_PIPE is
not set, the named pipes are called dakscilab_pipe1 and
dakscilab_pipe2.

When done with the named pipes, invoke

        echo dbg scilab_script.sce > dakscilab_pipe1

or

	echo dbg scilab_script.sce > ${DAKSCILAB_PIPE}1

to make the copy of dakscilab that talks with SCILAB execute
instructions in scilab_script.sce


	echo quit > dakscilab_pipe1

or
	echo quit > ${DAKSCILAB_PIPE}1

to make the copy of dakscilab that talks with SCILAB quit
and remove the named pipes.

  
To compile and link dakscilab, you will probably need to adjust one or
more of the "E =", "B =", "L =", and "W =" lines in the makefile to
accord with your system.  It should be clear from looking at the
makefile that $E/extern/include (or, more specifically, $I) should be
the relevant "include" directory provided with your SCILAB
installation, and that $B should be a corresponding directory
containing shared libraries of your SCILAB installation.

DAKOTA input file rosenbrock.in illustrates use of dakscilab.
Try invoking "dakota -i rosenbrock.in", possibly after an initial
"./dakscilab -s". In this case, dakscilab is called in rosenbrock.in
like the analysis driver. dakscilab can support some options :

     -s to start the server

     -si to run an init script

     -sf to run a final script

     -f -fp -fpp to specify names of objective function, gradient
     	    	 and hessian, then load them.

For the PID example, the dakscilab call can be like that :

    analysis_driver = '../dakscilab -d -si "exec init_test_automatic.sce;"
 		    -sf "exec visualize_solution.sce;" -f "exec f_pid.sci"

Invoking

	./dakscilab --help

causes dakscilab to print a message about its use.
