-
Notifications
You must be signed in to change notification settings - Fork 35
Cross Compiling Py
Drasko DRASKOVIC edited this page Apr 18, 2015
·
2 revisions
Based on this:
- https://forum.openwrt.org/viewtopic.php?id=47600
- http://whatschrisdoing.com/blog/2009/10/16/cross-compiling-python-extensions/
- https://bitbucket.org/lambacck/distutilscross/issue/1
We have added a script here: https://github.com/nodesign/openwrt/tree/weio/pyPkg to do automatic cross-compilations.
Usage:
- Go to the dir
cd /home/drasko/openwrt/pyPkg
- Get the Python package
drasko@Lenin:~/openwrt/pyPkg$ pip install pyephem --download="."
- Untar it for build
drasko@Lenin:~/openwrt/pyPkg$ tar -xzvf pyephem-3.7.5.3.tar.gz
- Prepare build environment
drasko@Lenin:~/openwrt/pyPkg$ source setEnvPy.sh
- Build
drasko@Lenin:~/openwrt/pyPkg$ ./buildPyPkg pyephem-3.7.5.3
- Take egg from /dist
drasko@Lenin:~/openwrt/pyPkg/pyephem-3.7.5.3/dist$ pwd
/home/drasko/openwrt/pyPkg/pyephem-3.7.5.3/dist
drasko@Lenin:~/openwrt/pyPkg/pyephem-3.7.5.3/dist$ ls
pyephem-3.7.5.3-py2.7-linux-mips.egg
- Put it on the board (for example via SD card or USB key), and install it:
root@WEIO:/# easy_install /weioUser/sd/pyephem-3.7.5.3-py2.7-linux-mips.egg
Processing pyephem-3.7.5.3-py2.7-linux-mips.egg
creating /usr/lib/python2.7/site-packages/pyephem-3.7.5.3-py2.7-linux-mips.egg
Extracting pyephem-3.7.5.3-py2.7-linux-mips.egg to /usr/lib/python2.7/site-packages
Adding pyephem 3.7.5.3 to easy-install.pth file
Installed /usr/lib/python2.7/site-packages/pyephem-3.7.5.3-py2.7-linux-mips.egg
Processing dependencies for pyephem==3.7.5.3
Finished processing dependencies for pyephem==3.7.5.3
root@WEIO:/#
In order to cross-compile a package on Ubuntu, several packages must be installed
sudo apt-get install build-essential
sudo apt-get install python-setuptools
sudo easy_install distribute
sudo easy_install distutilscross
sudo apt-get install python-dev
- Home
- WeIO Recovery - Manual Update
- Supported Hardware
- How-to extend WeIO flash space
- WeIO Super Starter Kit Components
- OTA Updates
- Troubleshooting
- Misc
- Developer Pages