473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Python on board with OS uclinux

Hello,

Info relate:
OS : uclinux
Platform : unix version 2.4.22 (or 2.4.26)
Chip on board : ARM7


I want to get a python package on network to "make" in linux (Fedora core 1 or anything if it maybe done) and run python on board with above info .After I made package 2.2.3 and 2.5.2 of Python, I tried run on board such: ./python <script> with <script> is a script file and get error :
BINFMT_FLAT: bad magic/rev (0x1010100, need 0x4)
BINFMT_FLAT: bad magic/rev (0x1010100, need 0x4)
python: applet not found

I tried with python 2.5.2 package on board chip mips and platform 2.6 ( core 6 ) is ok (although when "make" still have error but I can run it on this board).

Please help me this problem , show details about it such as : get package in where? number version of python for fitting. How to configure this package to run good on board? and any info about it . Thank you so much
Mar 13 '08 #1
8 7579
woooee
43
Python is installed on almost all distros. Key "python" (without the quotes) into a teminal. You should get >>> Then key in "import sys" (again without the leading and trailing quotes), and then "print sys.version_info". If that works you will have the version number of the installed python package printed on the screen. If you don't have Python, then use the package manager to install it. I think that is RPM on Fedora.
You can learn Python via Guido's tutorial here http://www.python.org/doc/current/tut/tut.html (be sure to look at "Executable Python Scripts") and for general reference this list links to other Python sites http://www.python-eggs.org
Mar 13 '08 #2
bgeddy
16
I think the compilation of python did not convert the binary to a FLAT format binary. I think your make has gone wrong somewhere. Apparently the compiler (gcc) needs a "-Wl,-elf2flt" option on the final gcc/ld
lines. Perhaps you have to rerun configure ?

I'm no expert on compiling packages for uclinux so you'll have to google for info for the os and microprocessor options.

In fact I got the above information from google - (I looked it up as I compile from source often under linux) - but I have no experience of your setup I'm afraid.

In any case - this looks like a uclinux python interpreter source compilation problem and not a python language one. Sorry I can't be of more help.
Mar 14 '08 #3
Yes, but i want make an application (python) to run on board such : ./python <script> .RPM can't use because can't run on board with
Info relate:
OS : uclinux
Platform : unix version 2.4.22 (or 2.4.26)
Chip on board : ARM7

I got a package with ".tgz" . After i tar it ( tar zxvf ), will have a <configure> file. I used a other file to call via <confige file> , in this file I assign some thing such :CC, CXX, AR, RANLIB, LD, CFLAGS, CXXFLAGS, LDFLAGS for my target to run board.

./python <script>
but not :
python

Hope you see my idea. Thank you
Mar 14 '08 #4
I used:

AS=arm-elf--as
AR=arm-elf--ar
RANLIB=arm-elf--ranlib
STRIP=arm-elf--strip
CC=arm-elf--gcc
CXX=arm-elf--g++
LD=arm-elf--ld
CFLAGS="-Wl -elf2flt="-s32768" -Wa,-elf2flt="-s32768" -fno-strict-aliasing -I$INSTALL_DIR/include $CFLAGS_EXTRA"

CXXFLAGS="-Wl -elf2flt="-s32768" -Wa,-elf2flt="-s32768" -fno-strict-aliasing -I$INSTALL_DIR/include $CFLAGS_EXTRA"
LDFLAGS="-L$INSTALL_DIR/lib"

to configure but don't success.I wonder that these macros is right or wrong. If wrong I need how to modify.
Mar 14 '08 #5
bgeddy
16
Yes - this is what I'm saying - you have a problem compiling python itself which I can't help you with but answers may be found on a forum dealing with uclinux. Sorry.
Mar 14 '08 #6
woooee
43
./python <script>
but not :
python

Hope you see my idea. Thank you
Once again, follow the instructions here to run a script.
You can learn Python via Guido's tutorial here http://www.python.org/doc/current/tut/tut.html (be sure to look at "Executable Python Scripts")
Mar 14 '08 #7
Once again, follow the instructions here to run a script.
Thank you,

I see that. But my board don't have python. "#! /usr/bin/env python" line is only useful when run a script(as shell script) on environment on which have set up python. So i need to build a python app for running on board : ./python <script>.
Mar 19 '08 #8
woooee
43
First "./python <script>" will only work if you are in /usr/bin and <script> is in a directory that is in $PATH. If you want to run a unique version of Python, it is simpler to remove the /usr/bin/python symlink, and symlink to the version of Python that you want, instead of using ./python which requires you to always be in the directory that contains the Python executable.
Mar 19 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: Max M | last post by:
There is a story today on Slashdot Open Source Project Management Lessons ======================================...
11
by: dmbkiwi | last post by:
I am new to this group, and relatively new to python programming, however, have encountered a problem I just cannot solve through reading the documentation, and searching this group on google. I...
11
by: Janusz U. | last post by:
Hello! I have an idea that implements the Python interpreter for z80 as an universal flexible language (like scripts) to support attached hardware. What would it be shortest way to do it? I...
13
by: Alexander May | last post by:
Hi, I love Python! I've been using it for a couple of years now and have found it to be a highly productive language. I evangelize it to my developer friends and am probably responsible for...
105
by: Christoph Zwerschke | last post by:
Sometimes I find myself stumbling over Python issues which have to do with what I perceive as a lack of orthogonality. For instance, I just wanted to use the index() method on a tuple which does...
1
by: frikk | last post by:
Hey Everyone! I've got a question regarding the capabilities of python in a real time environment. I'll start by saying I'm a little bit flaky when it comes to terminology, so please correct me or...
16
by: wokeup2sleep | last post by:
im a beginner at comp science, and my prof is using python, which is totally new tom me i had a few questions with the program im writing, im having a few problems. brief summary i have to do a...
1
by: SimonPalmer | last post by:
Apologies in advance if this is either a) the wrong board or b) been answered a million times elsewhere, but... I have been given an assignment to get a python module up and running behind an...
4
Plater
by: Plater | last post by:
For starters we're using UCLinux on a blackfin (analog devices)device. I am hoping that doesn't matter and there's a general way to do this. Basically we are trying to get the name resolution to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.