Francisco Alberto Carrillo Dominguez

i.MX python upgrade

Discussion created by Francisco Alberto Carrillo Dominguez Employee on May 23, 2013

As you know ltib comes with an old python version 2.4.

 

Updating the ltib spec file so it uses a newer version is the best option.  This could take some time to happen.

 

 

Meanwhile you can upgrade to a newer version 2.6 with these instructions.

 

Download    python2.6.6-arm-cross-build.tar.gz - Google Drive

 

1. The script may run successfully on host system:

 

 

  Ubuntu 10.04 LTS (I run it in a virtual machine) with following tools set installed (PATH need to be set):

  • GCC cross building tool
  • Perl (which needed by openssl building)
  • Python on HOST (to run some tool scripts on HOST)

 

 

2. Decompress the attachment and enter the decompressed directory

 

 

$ tar -zxf python2.6.6-arm-cross-build.tar.gz

$ cd python2.6.6-arm-cross-build

 

3. Run the building script

 

 

$ ./cross_build_python2.6.6.sh

  • arm_ext and build_prefix/_install directory will be generated. Directory arm_ext contains all third party libraries needed by python extended module. build_prefix/_install contains python built results. All the extended libraries are static linked.
  • If the script file is not excutable, a chmod command may be needed before run it:

$ chmod 755 cross_build_python2.6.6.sh

 

 

4. Package the building rusults

 

 

$  python make_dist.py

  • Three packages will be generated.
  • python-2.6.6-arm.tar.gz : All building rusults be packed directly.
  • python-2.6.6.min-arm.tar.gz: A 'install' package to be installed on target system. This package contains all built python libraries, some of them may be deleted if not useful by specific use case.
  • test-python-2.6.6-arm.tar.gz: The python test libraries to test python installation on target system.

 

 

5. Install and test on target system

 

  • copy python-2.6.6.min-arm.tar.gz on your target system.
  • decompress the package

$ tar -zxf python-2.6.6.min-arm.tar.gz

  • A 'usr' will be generated by decompressing, python excutable in usr/bin and python libraries in usr/lib.

 

 

  • c. set some environment variables

$ export PYTHONHOME=/mnt/disk/usr

$ export PATH=$PATH:/mnt/disk/usr/bin

  • then you can run comand 'python' in current shell to enter python command line. You can make the variables set on system boot in a producting system.

 

  • remove installed test package:

$ rm -rf /mnt/disk/usr/lib/python2.6/site-packages/test

  • (the test package cost so much disk space)

 

Outcomes