This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/TMDSLCDK138: Cross compiling python for OMAPL138

Part Number: TMDSLCDK138
Other Parts Discussed in Thread: OMAPL138

Tool/software: Linux

Hello,

I have a TMDSLCDK138 board and I want to install python 2.7 on it but when I try to run it I have this error :

root@omapl138-lcdk:~# python
-sh: /usr/bin/python: cannot execute binary file

I proceeded like this :

I successfully cross-compiled python 2.7.13 on my Fedora 25 with the linaro toolchain after installing it (releases.linaro.org/components/toolchain/binaries/6.2-2016.11/) like this :

CONFIG_SITE=config.site ./configure --build=x86_64-linux-gnu --host=arm-linux-gnueabihf --disable-ipv6 --enable-unicode=ucs4

I had to do a config.site because during the compilation it asked me to precise :

ac_cv_file__dev_ptmx=no/yes
ac_cv_file__dev_ptc=no/yes

And I put "no" to both of them like this guy did : datko.net/2013/05/10/cross-compiling-python-3-3-1-for-beaglebone-arm-angstrom/

Then I test to add :

--host=arm-elf-linux

Because it worked for another lib (pjsip), but unfortunately it didn't worked so I found this solution :

--host=arm-unknown-linux-gnueabihf

Here : github.com/jedisct1/libsodium/issues/274

And this was for an error during the configuration asking me to do so :

--desable-ipv6

Then the configuration went well, so the make. To do the make install, because I had to install it on my board, I did :

$ make install DESTDIR=OMAPL138_Python

I did a tar.bz2, sended it to my board, extract it en past the files in /usr/ to install it.

And here when I want to launch it I have the error.

So I tried whit the arago toolchain like so :

$ wget downloads.ti.com/.../arago-2011.09-armv5te-linux-gnueabi-sdk.tar.bz2
$ tar -jxvf arago-2011.09-armv5te-linux-gnueabi-sdk.tar.bz2 -C $HOME
$ export PATH=$HOME/arago-2011.09/armv5te/bin:$PATH

And configuring the installation like so (found here :  e2e.ti.com/support/dsp/omap_applications_processors/f/42/t/197225) :

./configure --prefix=/home/usr/Téléchargements/Python-2.7.13/OMAPL138_Python/ --exec-prefix=/home/usr/Téléchargements/Python-2.7.13/OMAPL138_Python/ --without-gcc --with-cxx-main=arm-arago-linux-gnueabi_gcc

But then when I launch "make" it says :

make: arm-arago-linux-gnueabi_gcc : command not found

What is the proper way to get python cross compiled and working on the TMDSLCDK138 ?

Thank you very much !



  • Hi,

    Try working with the toolchain provided in the official mcsdk:
    processors.wiki.ti.com/.../MCSDK_User_Guide_for_OMAPL138
    ---> www.ti.com/.../bioslinuxmcsdk

    You need to export the following variables:
    export PATH=~/ti/mcsdk_1_01_00_02/linux-devkit/sysroots/i686-arago-linux/usr/bin:$PATH
    export CROSS_COMPILE=arm-arago-linux-gnueabi-

    Hope this helps.

    Best Regards,
    Yordan
  • Hi,

    Thank you, but what is the correct ./configure ?

    I tried :

    CONFIG_SITE=config.site ./configure --build=x86_64-linux-gnu --host=arm-arago-linux-gnueabi --disable-ipv6 --enable-unicode=ucs4 --without-gcc

    In the config.site there is :

    ac_cv_file__dev_ptmx=no
    ac_cv_file__dev_ptc=no

    I could do a make, and a make install DESTDIR=folder/

    I did a tar.bz2, scp it on my board then a cp -R in /usr/ but I have this error :

    ~# python
    -sh: /usr/bin/python: cannot execute binary file

    I will retry with a fresh install of my SD card because I have done few things with python on it and I let you know.

    But is it the good ./configure ?

    EDIT 1:

    I have the same issue :

    ~# python
    -sh: /usr/bin/python: cannot execute binary file

     EDIT 2 :


    I tried doing this :

    ./configure ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-

    ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- make

    Same issue...

    Any idea ?

  • I am still searching for the right ./configure.

    I can't run any of my crosscompiled packages on my board...

    Thank you in advance
  • Hello,

    For those trying to cross-compile Pyhton 2.7 for the OMAPL138 running the Arago SDK here is the way ! I am working on Ubuntu 16.04.

    First install the Arago toolchain :

    NOT THIS ONE : http://software-dl.ti.com/sdoemb/sdoemb_public_sw/arago_toolchain/2011_09/index_FDS.html  (Because it is DEPRECATED !!)

    But the one in mcsdk_1_01_00_02_setuplinux.bin !

    wget http://software-dl.ti.com/sdoemb/sdoemb_public_sw/mcsdk/latest1/exports/mcsdk_1_01_00_02_setuplinux.bin
    chmod +x mcsdk_1_01_00_02_setuplinux.bin
    sudo ./mcsdk_1_01_00_02_setuplinux.bin

    I install it in /opt/ti/

    Then :

    cd /opt/ti/mcsdk_1_01_00_02
    chmod +x linux-devkit.sh
    sudo ./linux-devkit.sh

    It is going to ask you where you want to install it, I kept /usr/local/arago.2013-05/

    Now :

    cd /usr/local/arago-2013.05//
    . ./environment-setup

    Normally your shell is going to "transform" and your command lines are performing with :

    [linux-devkit]:/usr/local/arago-2013.05/>

    Ok, here you have finished installing the GOOD Arago toolchain.

    Now cross-compiling and installing Python :
    I did all the command for the rest in this linux-devkit shel.

    wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz
    tar -Jxvf Python-2.7.13.tar.xz
    cd Python-2.7.13/

    Now create a file named config.site (because if you don't you get an error asking you to do so) :

    touch config.site
    gedit config.site

    Add those two lines in this file :

    ac_cv_file__dev_ptmx=no
    ac_cv_file__dev_ptc=no

    Now you can do the ./configure like so :

    CONFIG_SITE=config.site ./configure --host=arm-arago-linux --prefix=/home/YOUR_USER/MY_BOARD_python --build=x86_64-linux-gnu --disable-ipv6
    make
    make install

    Now you just have to compress your MY_BOARD_python folder, scp it to your board with :

    tar -jcvf  MY_BOARD_python.tar.bz2 MY_BOARD_python/
    scp MY_BOARD_python.tar.bz2 root@IP_ADRESS:~/

    Now on your board :

    tar -jxvf MY_BOARD_python.tar.bz2
    cp -R MY_BOARD_python/* /usr/

    And now if you type Python :

    root@omapl138-lcdk:~# python
    Python 2.7.13 (default, Feb 23 2017, 16:37:33) 
    [GCC 4.5.3 20110311 (prerelease)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> HURAYY!!

    Hop this helped !