Author Topic: Cross Compile Howto ? (Python/Scipy)  (Read 4549 times)

claude

  • Newbie
  • *
  • Posts: 8
    • View Profile
Cross Compile Howto ? (Python/Scipy)
« on: May 29, 2004, 10:18:52 am »
I\'d like to cross-compile Python and some \"packages\"  like :

- Numeric/Numarray
- f2py (python/fortran  interface)
- Scipy : \"stats\" lib and \"special\"  lib.
 
I know that I need a toolchain/SDK  (gcc, g77 ...) :
- but I do not know where to pick up the one that would fit my needs
- and where to find a tutotial/howto on cross-compiling

Moreover cross-compiling Python is not an easy task because python itself takes part in building
extensions.

Well I need some helps and advices !!

Thanks

claude

  • Newbie
  • *
  • Posts: 8
    • View Profile
Cross Compile Howto ? (Python/Scipy)
« Reply #1 on: May 29, 2004, 10:57:25 am »
further informations Zaurus 5500 / 3.3.6-pre1 opie 1.1.4

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Cross Compile Howto ? (Python/Scipy)
« Reply #2 on: May 30, 2004, 06:21:53 am »
Grab OZ toolchain (GCC3.3.2) from here:
http://www.openzaurus.org/official/toolchain/

Make sure you read the README.

Then look at my posts in the \'Linux Applications\' section about cross-compiling. For the command line/lib stuff look specifically at how to make the ./configure program work. For any graphical stuff, I have no idea, sorry.

If you have troubles then post a reply.

Regards,


Simon
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

claude

  • Newbie
  • *
  • Posts: 8
    • View Profile
Cross Compile Howto ? (Python/Scipy)
« Reply #3 on: May 30, 2004, 10:35:22 am »
Thank you for the help, i\'ll give a try asap (i\'m sure it will work)

le chemin parcouru :

After some googling and http://openembedded.org/oe_wiki/ and
http://treke.net/oe/docs/oe-opie.html I tried openEmbeded  (last python-2.3.4 and Numeric packages can be built with it) to build the \'initial environment\'
(toolchains etc)  after \"oemake meta-opie\" I\'ve got errors :
...
NOTE: package glibc-2.3.2+cvs20040530-r2: task do_patch completed
NOTE: package glibc-2.3.2+cvs20040530-r2: task do_configure started
NOTE: package glibc-2.3.2+cvs20040530-r2: task do_configure completed
NOTE: package glibc-2.3.2+cvs20040530-r2: task do_compile started
ERROR: function do_compile failed
ERROR: function do_compile failed
ERROR: see log in /data1/oetmp/base/glibc-2.3.2+cvs20040530-r2/temp/log.do_compile.8648

wich reads :
...
...
../sysdeps/generic/libc-start.c:241: internal compiler error: Aborted
....

I did not use Bitkeeper but :
$  wget http://www.treke.net/oe/snapshots/oe-exported.tar.bz2
$  wget http://www.treke.net/oe/snapshots/oe-packa...xported.tar.bz2

as theses packages are snapshots they may be  buggy.

does someone know if there is a stable release of openEmbeded ?
 
thank you

claude

  • Newbie
  • *
  • Posts: 8
    • View Profile
Cross Compile Howto ? (Python/Scipy)
« Reply #4 on: May 30, 2004, 01:50:36 pm »
To build a cross-compiler from http://openzaurus.org/official/toolchain/c...s-3.3.2.tar.bz2 :
I did :

1) install  cross-3.3.2.tar.bz2  (/opt/..)

2) mkdir /usr/local/arm/3.3.2

3) tar jxf gcc-3.3.2.tar.bz2 -C /tmp

4) mkdir /tmp/buildgcc ; cd /tmp/buildgcc ; export PATH=$PATH:/opt/cross/bin

5)
../gcc-3.3.2/configure --disable-shared --enable-languages=\'c,c++,f77\' --target=arm-linux --prefix=\'/usr/local/arm/3.3.2\' --with-headers=\'/opt/cross/arm-linux/sys-include\' --with-libs=\'/opt/cross/arm-linux/lib\'

BUT  the following files are not found :

../../gcc-3.3.2/gcc/tsystem.h:72:19: stdio.h: No such file or directory
../../gcc-3.3.2/gcc/tsystem.h:75:23: sys/types.h: No such file or directory
../../gcc-3.3.2/gcc/tsystem.h:78:19: errno.h: No such file or directory
../../gcc-3.3.2/gcc/tsystem.h:85:20: string.h: No such file or directory
../../gcc-3.3.2/gcc/tsystem.h:89:20: stdlib.h: No such file or directory
../../gcc-3.3.2/gcc/tsystem.h:90:20: unistd.h: No such file or directory
../../gcc-3.3.2/gcc/tsystem.h:96:18: time.h: No such file or directory

AND
 
../../gcc-3.3.2/gcc/crtstuff.c: In function `__do_global_dtors_aux\':
../../gcc-3.3.2/gcc/crtstuff.c:280: warning: passing arg 1 of `__deregister_frame_info\' discards qualifiers from pointer target type
../../gcc-3.3.2/gcc/crtstuff.c: In function `frame_dummy\':
../../gcc-3.3.2/gcc/crtstuff.c:316: warning: passing arg 1 of `__register_frame_info\' discards qualifiers from pointer target type
make[1]: *** [crtbegin.o] Erreur 1


any idea ???

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Cross Compile Howto ? (Python/Scipy)
« Reply #5 on: May 31, 2004, 05:59:12 am »
Quote
I tried openEmbeded


Even better, I;d not realised they were in there. In any case you need a toolchain from the location I specified (unless you need it to do other stuff, like FORTRAN).


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

claude

  • Newbie
  • *
  • Posts: 8
    • View Profile
Cross Compile Howto ? (Python/Scipy)
« Reply #6 on: May 31, 2004, 09:34:33 am »
Quote
To build a cross-compiler from http://openzaurus.org/official/toolchain/c...s-3.3.2.tar.bz2 :
I did :  
1) install  cross-3.3.2.tar.bz2  (/opt/..)
2) mkdir /usr/local/arm/3.3.2
3) tar jxf gcc-3.3.2.tar.bz2 -C /tmp
4) mkdir /tmp/buildgcc ; cd /tmp/buildgcc ; export PATH=$PATH:/opt/cross/bin
5)
../gcc-3.3.2/configure --disable-shared --enable-languages=\'c,c++,f77\' --target=arm-linux --prefix=\'/usr/local/arm/3.3.2\' --with-headers=\'/opt/cross/arm-linux/sys-include\' --with-libs=\'/opt/cross/arm-linux/lib\'

BUT  the following files are not found :  
../../gcc-3.3.2/gcc/tsystem.h:72:19: stdio.h: No such file or directory
...
AND
make[1]: *** [crtbegin.o] Erreur 1
any idea ???


Try :

export ZAURUS_DIR=/opt/cross/
export PATH=$PATH:$ZAURUS_DIR/bin
export LO_DIR=/usr/local/arm/3.3.2

../gcc-3.3.2/configure
--prefix=$LO_DIR
--target=arm-linux
--disable-shared
--with-gnu-as
--with-gnu-ld
--with-as=$ZAURUS_DIR/bin/arm-linux-as
--with-ld=$ZAURUS_DIR/bin/arm-linux-ld
--with-headers=$ZAURUS_DIR/arm-linux/include
--with-libs=$ZAURUS_DIR/arm-linux/lib
--enable-languages=c,c++,f77

make
make install

But files (compiler/header/..) of interest are in /opt/cross and /usr/local/arm/3.3.2 , it is not very clean ...

@+

easymacaddict

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • http://
Cross Compile Howto ? (Python/Scipy)
« Reply #7 on: June 09, 2004, 07:12:34 pm »
I don\'t know if this has been posted on these boards before, but this:

http://www-106.ibm.com/developerworks/libr...rary/wi-zaurus/

is a good primer for anyone interested in cross-compilation.  it focuses on the zaurus platform and even includes some handy zaurus-specific links.

/D

Ashitaka

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://leiber.free.fr
Cross Compile Howto ? (Python/Scipy)
« Reply #8 on: June 10, 2004, 02:46:34 am »
Thanks for the link !
I\'ll tell you if I can manage have everything running with that
Zaurus SL-C760, SL-C860 and SL-6000
Sharp ROM 1.20 JP and pdaXrom RC8
512 MB SD Card, other memory, wireless and ethernet CF cards
www.nautilus6.org/operation/zaurus.html

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
Cross Compile Howto ? (Python/Scipy)
« Reply #9 on: June 10, 2004, 06:13:39 am »
Quote
Thank you for the help, i\'ll give a try asap (i\'m sure it will work)

le chemin parcouru :  

After some googling and http://openembedded.org/oe_wiki/ and  
http://treke.net/oe/docs/oe-opie.html I tried openEmbeded  (last python-2.3.4 and Numeric packages can be built with it) to build the \'initial environment\'
(toolchains etc)  after \"oemake meta-opie\" I\'ve got errors :  
...
NOTE: package glibc-2.3.2+cvs20040530-r2: task do_patch completed
NOTE: package glibc-2.3.2+cvs20040530-r2: task do_configure started
NOTE: package glibc-2.3.2+cvs20040530-r2: task do_configure completed
NOTE: package glibc-2.3.2+cvs20040530-r2: task do_compile started
ERROR: function do_compile failed
ERROR: function do_compile failed
ERROR: see log in /data1/oetmp/base/glibc-2.3.2+cvs20040530-r2/temp/log.do_compile.8648

wich reads :
...
...
../sysdeps/generic/libc-start.c:241: internal compiler error: Aborted
....

This was a gcc bug which we recently fixed. Rebuild.
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

Ashitaka

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://leiber.free.fr
Cross Compile Howto ? (Python/Scipy)
« Reply #10 on: June 14, 2004, 05:25:25 am »
Sorry, I\'m still mixed up, and I have a few questions.

- I don\'t understand why you build GCC 3.3.2 after installing the cross-3.3.2.tar.bz2 toolchain. Isn\'t GCC 3.3.2 ready to work in /opt/cross/bin ?
- Do I need to install both Qt-embedded and Qtopia ? Qtopia is just the graphical system that works thanks to Qt, am I right ? Do I have to install the same version as the one used on the Zaurus ? For example, my Zaurus has Qtopia 1.5.4, but on the trolltech website you download the latest release (1.7.1).

Thanks for your help !
Zaurus SL-C760, SL-C860 and SL-6000
Sharp ROM 1.20 JP and pdaXrom RC8
512 MB SD Card, other memory, wireless and ethernet CF cards
www.nautilus6.org/operation/zaurus.html

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Cross Compile Howto ? (Python/Scipy)
« Reply #11 on: June 14, 2004, 06:11:42 am »
Quote
I don\'t understand why you build GCC 3.3.2 after installing the cross-3.3.2.tar.bz2 toolchain. Isn\'t GCC 3.3.2 ready to work in /opt/cross/bin ?


Possibly because the original toolchain doesn\'t support all of the language options you want. Therefore you rebuild it (using the same binutils, directory structure, etc.). It just makes life easier IMO.


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

Ashitaka

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://leiber.free.fr
Cross Compile Howto ? (Python/Scipy)
« Reply #12 on: June 14, 2004, 10:40:01 pm »
1. OK I understand.
2. \"Qtopia is the name for the qpe libraries and the desktop environment build on it for the Zaurus\", which means the Qtpia package should be enough. Still one question left : do I have to use the same version as the one installed on my Zaurus ?
Zaurus SL-C760, SL-C860 and SL-6000
Sharp ROM 1.20 JP and pdaXrom RC8
512 MB SD Card, other memory, wireless and ethernet CF cards
www.nautilus6.org/operation/zaurus.html