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.

Python and Perl using Sitara LINUXEZ SDK

This page http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html has straightforward instructions for building Python. My build commands look like this (after doing the first part of the build which you MUST do before you set the SDK environment:

SDK 05.07:

  • source ~/environment-ti
  • ./configure --host=arm-linux --build=i686-linux-gnu --prefix=/
  • make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="arm-arago-linux-gnueabi-gcc -shared" CROSS_COMPILE=arm-arago-linux-gnueabi CROSS_COMPILE_TARGET=yes HOSTARCH=arm-linux BUILDARCH=i686-lnux-gnu
  • make install HOSTPYTHON=./hostpython BLDSHARED="arm-arago-linux-gnueabi-gcc -shared" CROSS_COMPILE=arm-arago-linux-gnueabi CROSS_COMPILE_TARGET=yes prefix=~/Python_507/_install

SDK 06.00

  • source /opt/ti-sdk-06.00/linux-devkit/environment-setup
  • ./configure --host=arm-linux --build=i686-linux-gnu --prefix=/
  • make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="arm-linux-gnueabihf-gcc -shared" CROSS_COMPILE=arm-linux-gnueabihf CROSS_COMPILE_TARGET=yes HOSTARCH=arm-linux BUILDARCH=i686-lnux-gnu
  • make install HOSTPYTHON=./hostpython BLDSHARED="arm-linux-gnueabihf-gcc -shared" CROSS_COMPILE=arm-linux-gnueabihf CROSS_COMPILE_TARGET=yes prefix=~/Python_600/_install
Both of these were tested on a freshly loaded sd card and "python /lib/python2.7/test/test___all__.py" ran just fine. I didn't try the zip trick.
Has anybody seen a good set of instructions for Perl?
Jimmy
  • Hi Jimmy,

    When you download the perl sources from their site and extract them, there is an "INSTALL" file inside the folder. Read the "Cross-compilation" section, which describes how to do it.

    There is also a README file inside the "Cross" folder, which has a "Building for arm-linux" section.

    Best regards,
    Miroslav

  • Miroslav,

    Have you actually done it and succeeded? I have read the install and ran the config using this setup:

    cd perl-5.18.0
    sh ./Configure -Dusecrosscompile \
    -Dtargethost=192.168.1.61 \
    -Dcc=${TOOLCHAIN_PREFIX}gcc \
    -Dtargetarch=arm-linux \
    -Dincpth=$SDK_PATH_TARGET/include \
    -Dusrinc=$SDK_PATH_TARGET/usr/include \
    -Dlibpth=$SDK_PATH_TARGET/lib \

    I did not specify defaults so I put in the list of library paths, but the configure errors out with this message:

    ././try: error while loading shared libraries: libgdbm.so.3: cannot open shared object file: No such file or directory

    Sure enough, that lib was missing on the board. I put that library on the board and reran configure. I got to the end but when I run "make", it immediately fails with syntax errors.

    Have you done this successfully or have a link to a web page where someone shows how to do it successfully?

    Jimmy

  • Hi Jimmy,

    I haven't done this. I was just pointing out that there are instructions among the source codes. I guess searching the Perl community web pages will provide better answers: http://www.perl.org/community.html

    Best regards,
    Miroslav

  • Hi,

    I have sone with the steps which you mentioned above. After doing the steps mentioned above what to do next? Where to copy the files and which files to copy and how i can run python script?

    With Best Regards,

    Amit

  • This is an old thread, but I'd like to update it in order to help future forum searches. This is how to cross-compile Perl for the AM335x (verified for Perl version 5.18.2):

    1. Download and extract the perl sources from http://www.perl.org

    2. Download the perl-cross sources that correspond to the perl version you downloaded, from here: http://perlcross.berlios.de/download.html

    3. Extract the perl-cross sources inside the folder where you extracted perl.

    4. Configure for cross-compilation. Example:
    ./configure --prefix=/usr --target=arm-linux-gnueabihf --target-tools-prefix=arm-linux-gnueabihf-

    5. Make perl:
    make

    6. Install perl to target:
    make DESTDIR=<path_to_target_rootfs> install

    Best regards,
    Miroslav