Hi!, I'm trying to use a C routine on the interface of Scilab 4.1.2<br><div class="gmail_quote">The C file is cthomas.c and contains:<br><br>#include "global.h"<br>#include "machine.h"<br><br>int C2F(cthomas)(double *b, double *a,double *c, double *q,int *n, double *x){<br>

        int i,j;<br>        double *u=malloc(sizeof(double)*(*n));<br>        double *y=malloc(sizeof(double)*(*n));<br><br>        u[0]=a[0];<br>        for(i=0;i<*n-1;i++){<br>                x[i]=b[i]/u[i];<br>                u[i+1]=a[i+1]-x[i]*c[i];<br>

        }<br>        y[0]=q[0];<br><br>        for(i=0;i<*n-1;i++)<br>                y[i+1]=q[i+1]-x[i]*y[i];<br><br>        x[*n-1]=y[*n-1]/u[*n-1];<br>        for(i=*n-2;i>=0;i--)<br>                x[i]=(y[i]-c[i]*x[i+1])/u[i];<br>

<br>        free(u);free(y);<br>        return(0);<br>}<br><br>I Compilate this file with:<br>gcc -I ~/bin/scilab-4.1.2/routines -c cthomas.c -o cthomas.o<br><br>No warning message appears. In the same directory I create the file thomas.desc, that contains:<br>

<br><span></span>thomas  b       a       c       q<br>b       column  n-1<br>a       column  n<br>c       column  n-1<br>q       column  n<br>x       column  n<br><br>cthomas  b       a       c       q       n       x<br>

b       double<br>a       double<br>c       double<br>q       double<br>n       integer<br>x       double<br><br>out     sequence        x<br>****************************<br><br>Before compilation I execute:<br><br>ajaramillo@ajaramillo:~/work/miguel/scilab> ~/bin/scilab-4.1.2/bin/intersci-n thomas<br>

<br>INTERSCI Version 3.0 (SEP 2000)<br>    Copyright (C) INRIA/ENPC All rights reserved<br><br>**************************<br>processing SCILAB function "thomas"<br>  generating C interface for function (cthomas) Scilab function"thomas"<br>

C file "thomas.c" has been created<br>Scilab file "thomas.sce" has been created<br><br>file "thomas_builder.sce" has been created<br><br>Now, on scilab I wrote the order:<br>-->exec "thomas_builder.sce"<br>

 <br>-->// generated with intersci<br> <br>-->ilib_name = 'libthomas'              // interface library name<br> ilib_name  =<br> <br> libthomas   <br> <br> <br>-->table =["thomas","intsthomas"];<br>

 <br>-->ilib_build(ilib_name,table,files,libs);<br>ilib_build(ilib_name,table,files,libs);<br>                             !--error 4 <br>undefined variable : files                   <br>at line       5 of exec file called by :    <br>

exec "thomas_builder.sce"<br> <br> <br>--><br><br>I don't understand this...moreover, the file thomas.sce wasn't exists<br><br>Trying to fix this.. on base of the examples from <SCIDIR>/examples/intersci-examples-so/<br>

<br>I modificate the thomas_builder.sce file on the next way: <br><br><br>// generated with intersci <br>ilib_name = 'libthomas'         // interface library name<br>libs=[];<br>files=['cthomas.o'];<br>table =["thomas","intsthomas"];<br>

ilib_build(ilib_name,table,files,libs);<br><br>Now, when I execute the builder:<br><br>-->exec "thomas_builder.sce"<br> <br>-->// generated with intersci<br> <br>-->ilib_name = 'libthomas'              // interface library name<br>

 ilib_name  =<br> <br> libthomas   <br> <br>-->libs=[];<br> <br>-->files=['cthomas.o'];<br> <br>-->table =["thomas","intsthomas"];<br> <br>-->ilib_build(ilib_name,table,files,libs);<br>

   generate a gateway file<br>   generate a loader file<br>   generate a Makefile: Makelib<br>   running the makefile<br>   compilation of cthomas<br>   building shared library (be patient)<br><br>And before that, I execute:<br>

-->exec "loader.sce"<br> <br>-->// generated by builder.sce: Please do not edit this file<br> <br>-->// ------------------------------------------------------<br> <br>-->libthomas_path=get_file_path('loader.sce');<br>

 <br>-->functions=[ 'thomas';<br>-->];<br> <br>-->addinter(libthomas_path+'/libthomas.so','libthomas',functions);<br>/home/ajaramillo/work/miguel/scilab/libthomas.so: undefined symbol: intsthomas<br>

addinter(libthomas_path+'/libthomas.so','libthomas',functions);<br>                                                       !--error 236 <br>link: the shared archive was not loaded<br>at line       6 of exec file called by :    <br>

exec "loader.sce"<br> <br> <br>--><br><br>But again an error appears, this time I don't found a way to "fix" it<br><br>Can you help me with this please? Thanks in advance<br><font color="#888888"><br>
<br>Alfredo Jaramillo Palma<br>
Mathematics Engineering Student<br>La Frontera University<br>Chile<br>
</font></div><br>