LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   No floating-point when cross-compiling Python for Mipsel (https://www.linuxquestions.org/questions/linux-newbie-8/no-floating-point-when-cross-compiling-python-for-mipsel-688568/)

Sytse 12-05-2008 11:56 AM

No floating-point when cross-compiling Python for Mipsel
 
Python & floating-point

I have one of those 7-inch mini laptops made by Skytone
Mine is called Trendtac.
It is said to use an Ingenic "XBurst" 400 MHz MIPSII-compatible
single core 32-bit System-on-a-chip.
It is running a cross-compiled Linux from sources.
Sources and tools are available.
This mini consumes only 4 Watt and on powersupply it will pull along one of those 150 GB ultraportable USB disks,
so with a consumption of about 8 Watt hourlong downloads
are not really a bother.
It was love at first sight, though sometimes love hurts.

On the ingenic site I found cross-compile tools for a cygwin
environment and after several hours of downloading ( do they use a telephone-modem ?) on 7 Kbyte/sec, I unziptarred it into my cygwin environment and put it under /cross-tools.
I removed cygwin1.dll from it's /bin directory because it conflicted
with the one already there ( I always do stuff from within cygwin bash )
Made a new .bashrc:

set +h
umask 022
LC_ALL=POSIX
PATH=/cross-tools/bin:/bin:/usr/bin
CLFS_HOST="i686-cross-cygwin"
CLFS_TARGET="mipsel-linux"
CC="${CLFS_TARGET}-gcc"
CXX="${CLFS_TARGET}-g++"
AR="${CLFS_TARGET}-ar"
AS="${CLFS_TARGET}-as"
RANLIB="${CLFS_TARGET}-ranlib"
LD="${CLFS_TARGET}-ld"
STRIP="${CLFS_TARGET}-strip"
export LC_ALL PATH CLFS_TARGET CLFS_HOST CC CXX AR AS RANLIB LD STRIP

If this looks familiar you've been reading similar documents.
Pleasantly surprised a " $CC hello.c " worked and the a.out it did produce worked on the mini as expected.
Other programs that make files from files did not give any problems.

Getting bold I decided to compile a package
Python would be nice and 2.6 was new so....
Well "configure" stopped on the fact that I was cross-compiling.

Thinking that a 'real Linux' might be better to work in, I downloaded
the Linux cross-compile tools from the ingenic site.
(another few hours waiting)
With my LFS-Live CD and a 2GB ext3 USB-stick I do some typing
to get my harddisk mounted, but then all there is to it is running
some scripts.
The scripts mount the USB, create symlinks, set up a user CLFS
copy .bash_profile .bashrc etcetera.

Here too " $CC hello.c " and others like it worked fine, but
Python-2.6 gave the same problem.

I decided version 2.6 was too new and beeing drastic went for
version 2.2.3
Well this did "./configure", it did "make" which tried to run the mipsel python on my i686 toshiba.
But it did "make install".
And it did run on the mini, even better after I found out that with setup.py copied in /usr/bin it would do what it could not do on the tosh.

I was ready for the python-tutorial and followed it to where the floating-point calculations came along. It was producing barf.

Thinking that "configure" may have chosen the wrong librararies for floating-point calculations
I decided on a completely new approach:
"qemu-system-mipsel.exe" with a "Debian mipsel starting set"
I downloaded a decent developement system, fiddled around with getting files in and out of the image-files, but finally got things going.
Hello.c and-so-on worked fine all along the line.
Python-2.2.3 was easy now, just by the book "./configure & make & make install"
No problem with running python during "make", and it would run on the mini.

Back to the python-tutorial and coming to where the floating-point calculations start something new happened. It told me that the literal "0.25" was "nan" not-a-number.

I now have 3 systems to compile simple <stdio.h> type programs for my mini but no Python.

In the Debian mipsel distro there is Python-2.4 and it works as it should.
So there must be someone out there who knows what to do.
PLEASE HELP !!!!!!


All times are GMT -5. The time now is 06:07 PM.