Scilab Function

link - dynamic link

Calling Sequence

link(files, sub-name)
link(files, sub-name, flag)
lst=link('show')
// Link extensions for machines using ``dlopen''
// (sun-solaris/linux-elf/alpha/hppa)
x=link(files [, sub-names,flag]);
link(x , sub-names [, flag]);
ulink(x)

Parameters

Description

link is a dynamic link facility: this command allows to add new compiled Fortran or C routines to Scilab executable code. Linked routines can be called interactively by the function fort. Linked routines can also be used as "external" for e.g. non linear problem solvers (ode, optim, intg, dassl...). Here are some examples:

The command link('foo.o','foo','f') links the Fortran object file foo.o with the entry point foo.

The command link('foo.o','foo','c') links the C object file foo.o with the entry point foo.

The command link('SCIDIR/libs/calelm.a','dcopy') links the Fortran routine dcopy in the library calelm.a.

A routine can be linked several times and can be unlinked with ulink. Note that, on some architectures (the ones on which ulink exists) when a routine is linked several times, all the version are kept inside Scilab.

Used with no arguments, link() returns the current linked routines.

If Scilab is compiled with static link (this is the default for SystemV machines) you may have to include the system libraries in the "link" command.

For example, if foo.o defines the object code of a routine named foo, you will use link in one the following way:

link('foo.o','foo').
link('foo.o -lm -lc','foo','c').
link('foo.o -lfor -lm -lc','foo').
link('foo.o -lftn -lm -lc','foo').
link('foo.o -L/opt/SUNWspro/SC3.0/lib/lib77 -lm -lc','foo')
   

If Scilab compiled with the "shared" option, the first example can be used even if a warning for unresolved references is issued.

(Experienced) users may also link a new Scilab interface routine to add a set of new functions. See Intersci documentation for interface generation and addinter function.

REMARKS

See Also