Author Topic: Compiling Scilab  (Read 3551 times)

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Compiling Scilab
« on: July 13, 2004, 06:04:12 pm »
I'm currently trying to compile Scilab.

I'm using the pdaXrom toolchain.

Source from here: ftp://ftp.inria.fr/INRIA/Scilab/distribut...-3.0.src.tar.gz

See also: http://scilabsoft.inria.fr/

Configure script had to be edited to recognise arm-linux-unknown-gnu as the system type. Edited configure file is available from: http://students.bath.ac.uk/enpsgp/Zaurus/configure.zip

(the changes are my first rough try - I've no real idea what I've enabled, etc., but it seems to work after a fashion)

This is the configure command I issued (it worked BTW ;-)):

./configure --host=arm-linux --without-xaw3d --with-g77 --x-libraries=/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib --x-includes=/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/include --with-local-xaw --without-pvm --without-tk

Then:

make all

It falls over complaining about not being able to find some xaw related static libs. I was under the impression that it makes its own (the --with-local-xaw bit).

Anyway if anyone can shed any light that would be great. I also wonder whether the 3D (and normal) xaw libs are available and tc/tk too?

Cheers,


Si
« Last Edit: July 13, 2004, 06:07:37 pm by lardman »
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Compiling Scilab
« Reply #1 on: July 14, 2004, 02:14:13 pm »
Okay, made progress. libxaw is available (of course).

Changed configure options, fingers crossed ;-)

Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Compiling Scilab
« Reply #2 on: July 14, 2004, 06:07:06 pm »
More of an update than anytthing else. I'll look at fixing it tomorrow:

The current error (after make all):

make[1]: Leaving directory `/home/enpsgp/Desktop/temp/scilab-3.0/routines'
linking
/opt/arm/3.3.2/lib/gcc-lib/armv5tel-cacko-linux/3.3.2/../../../../armv5tel-cacko-linux/bin/ld: Warning: alignment 4 of symbol `cmds_' in /home/enpsgp/Desktop/temp/scilab-3.0/libs/system.a(comand.o) is smaller than 32 in /home/enpsgp/Desktop/temp/scilab-3.0/libs/system.a(comand.o)
/opt/arm/3.3.2/lib/gcc-lib/armv5tel-cacko-linux/3.3.2/../../../../armv5tel-cacko-linux/bin/ld: Warning: alignment 4 of symbol `scicos_imp' in /home/enpsgp/Desktop/temp/scilab-3.0/libs/scicos.a(import.o) is smaller than 32 in /home/enpsgp/Desktop/temp/scilab-3.0/libs/scicos.a(import.o)
/home/enpsgp/Desktop/temp/scilab-3.0/libs/system.a(scicurdir.o)(.text+0xac): In function `scigetcwd_':
/home/enpsgp/Desktop/temp/scilab-3.0/routines/system/scicurdir.c:72: the `getwd' function is dangerous and should not be used.
/home/enpsgp/Desktop/temp/scilab-3.0/libs/sun.a(link.o)(.text+0x878): In function `CreateShared':
/home/enpsgp/Desktop/temp/scilab-3.0/routines/sun/link_SYSV.c:330: the use of `mktemp' is dangerous, better use `mkstemp'
/opt/arm/3.3.2/lib/gcc-lib/armv5tel-cacko-linux/3.3.2/../../../../armv5tel-cacko-linux/bin/ld: warning: libXpm.so.4, needed by /opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib/libXaw.so, not found (try using -rpath or -rpath-link)
/home/enpsgp/Desktop/temp/scilab-3.0/libs/xsci.a(jpc_inter.o)(.text+0x13c): In function `sci_tk_activate':
/home/enpsgp/Desktop/temp/scilab-3.0/routines/xsci/jpc_inter.c:149: undefined reference to `inittk'
/home/enpsgp/Desktop/temp/scilab-3.0/libs/xsci.a(jpc_inter.o)(.text+0x158):/home/enpsgp/Desktop/temp/scilab-3.0/routines/xsci/jpc_inter.c:152: undefined reference to `flushTKEvents'
/home/enpsgp/Desktop/temp/scilab-3.0/libs/xsci.a(jpc_inter.o)(.text+0x570): In function `Xorgetchar':
/home/enpsgp/Desktop/temp/scilab-3.0/routines/xsci/jpc_inter.c:251: undefined reference to `flushTKEvents'
/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib/libXaw.so: undefined reference to `XpmReadFileToPixmap'
collect2: ld returned 1 exit status
make: *** [bin/scilex] Error 1


The thing is that /opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib/libXaw.so does actually exist and is a symlink pointing to /opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib/libXaw.so.7.0

libXpm.so.4 also exists...., hmm??.

Slightly confused (as ever ;-))


Si

P.S. For those who might want to try this at home... :-)

Change the configure file linked above so that the libXaw and libX<the other one> variables are true (as the configure script doesn't seem to find them). Then issue:

 ./configure --host=arm-linux --without-xaw3d --with-g77 --x-libraries=/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib --x-includes=/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/include --without-local-xaw --without-pvm --without-tk

and

make all


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Compiling Scilab
« Reply #3 on: July 21, 2004, 12:05:20 pm »
I've been busy and haven't had a chance to complete this (yet....).

Does anyone who has the tk libs & headers already installed in their toolchain want to have a go - it looks like at least part of the error is to do with a lack of tk headers (even though I specified --without-tk - ??!!??).

If you have the headers, etc. then get rid of the --without-tk bit.

Cheers,


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

datajerk

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • http://
Compiling Scilab
« Reply #4 on: July 21, 2004, 03:16:40 pm »
I built the latest version of tcl/tk for X/qt a while back.  The ipk has all the headers, etc... for development.  I can send it to you or post it.

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Compiling Scilab
« Reply #5 on: July 21, 2004, 07:07:02 pm »
Okay, that would be useful I'm at (assuming it's not more than 5MB or so):

S dot G dot Pickering at bath dot ac dot uk

Thank you,


Si
« Last Edit: July 21, 2004, 07:07:39 pm by lardman »
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Compiling Scilab
« Reply #6 on: July 22, 2004, 01:06:35 pm »
Right I tried it again with the following configure command:

./configure --host=arm-linux --with-g77 --x-libraries=/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib --x-includes=/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/include --without-pvm --without-xaw3d --without-local-xaw

I get the following error:

Code: [Select]
making all in routines/int...
make[2]: Entering directory `/home/enpsgp/Desktop/temp/scilab-3.0/routines/int'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/enpsgp/Desktop/temp/scilab-3.0/routines/int'
making all in routines/xsci...
make[2]: Entering directory `/home/enpsgp/Desktop/temp/scilab-3.0/routines/xsci'
armv5tel-cacko-linux-gcc -g -Wall -Dlinux -fwritable-strings -DNARROWPROTO  -I/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/include  -I/usr/include -I/usr/include   -c -o jpc_inter.o jpc_inter.c
jpc_inter.c: In function `sci_tk_activate':
jpc_inter.c:146: warning: implicit declaration of function `Cout'
jpc_inter.c: In function `basic_scilab_mask':
jpc_inter.c:201: error: impossible constraint in `asm'
jpc_inter.c:207: error: impossible constraint in `asm'
make[2]: *** [jpc_inter.o] Error 1
make[2]: Leaving directory `/home/enpsgp/Desktop/temp/scilab-3.0/routines/xsci'
making all in routines/tksci...
make[2]: Entering directory `/home/enpsgp/Desktop/temp/scilab-3.0/routines/tksci'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/enpsgp/Desktop/temp/scilab-3.0/routines/tksci'
make[1]: Leaving directory `/home/enpsgp/Desktop/temp/scilab-3.0/routines'
linking
armv5tel-cacko-linux-g77: /home/enpsgp/Desktop/temp/scilab-3.0/libs/xsci.a: No such file or directory
make: *** [bin/scilex] Error 1

The lines in question in the jpc_inter.c file are as follows:

Code: [Select]
void sci_tk_activate(void)
{
  Display *dpy = (Display *) NULL;
  Widget toplevel = (Widget) NULL;
  Cout("You have started Scilab in a mode in which TK is not initialized.\n"); // line ************** 146 **************
  Cout("Trying to initialize \n");
  DisplayInit("",&dpy,&toplevel);
  inittk();
  BasicScilab = 0;
  basic_scilab_mask(&dpy);
  flushTKEvents();
}



static int Xsocket=0,fd_in=0,fd_out=0,fd_err=0;

static void basic_scilab_mask( Display **dpy)
{
  Xsocket = ConnectionNumber(*dpy);
  fd_in = fileno(stdin);
  fd_out = fileno(stdout);
  fd_err = fileno(stderr);

  FD_ZERO(&Select_mask_ref); // ************** Line 201 **************
  FD_SET(fd_in , &Select_mask_ref);
  FD_SET(Xsocket, &Select_mask_ref);
#ifdef WITH_TK
  if ( XTKsocket != 0 ) FD_SET(XTKsocket, &Select_mask_ref);
#endif
  FD_ZERO(&Write_mask_ref); // ************** Line 207 **************
  /* the two next FD_SET causes select not to wait
   *
   */
  /* FD_SET(fd_out,&Write_mask_ref);
     FD_SET(fd_err,&Write_mask_ref);*/

  max_plus1 = Max(fd_in,Xsocket);      
  max_plus1 = Max(fd_out,max_plus1);
  max_plus1 = Max(fd_err,max_plus1);
#ifdef WITH_TK
  max_plus1 = Max(XTKsocket,max_plus1);
#endif
  max_plus1++;
}  

I'm not sure what this FD_ZERO function(?) does, nor where it would be defined (it only appears in .c files).

Any help would be appreciated.

Cheers,


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Compiling Scilab
« Reply #7 on: July 23, 2004, 01:43:06 am »
Quote
I'm not sure what this FD_ZERO function(?) does, nor where it would be defined (it only appears in .c files).

FD_ZERO(&fdset)  
    Initializes the file descriptor set fdset to have zero bits for all file descriptors.

ie it sets all bits of fdset to 0

It should be defined in sys/types.h or  or sys/select.h.

Apparently the version used for the compilation expands to some assembly (asm) code,
that cannot be compiled.

Maybe the preprocessor doesn't put the right version ie a wrong include path or the version of the macro in the SDK is wrong or the macro is the right one but the wrong assembler (ie i386 instead of arm) program is used.
SLC-860 cacko / senao wifi

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Compiling Scilab
« Reply #8 on: July 23, 2004, 01:47:05 am »
after a closer look in your trace:

Quote
armv5tel-cacko-linux-gcc -g -Wall -Dlinux -fwritable-strings -DNARROWPROTO  -I/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/include  -I/usr/include -I/usr/include   -c -o jpc_inter.o jpc_inter.c

I think the problem is  -I/usr/include -I/usr/include which most probably includes the header file of your linux box. It most likely should be something like -I/opt/arm/3.3.2/armv5tel-cacko-linux/include.

That may explain that the wrong version of FD_ZERO is included
SLC-860 cacko / senao wifi