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.

issue in finding python in the sdk of tda4-evm

Hi all,

I have build the tda4-evm sdk using yocto. I have untarred sdk and sourced the environment-setup script in the sdk linux-devkit directory for cross-compiling.I have referred the documentation in the below link.

https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-jacinto7/latest/exports/docs/linux/Overview/GCC_ToolChain.html?highlight=toolchain

I have added the find_package(Python3 Interpreter Numpy Development) for finding the python3 packages in the sdk.But,I am facing the issue in finding the python interpreter.

The cmake is pointing the host system python interpreter instead of sdk python interpreter like below and the remaining numpy_include_dirs, python_include_dirs and python_libs are not found.

_Python3_EXECUTABLE:INTERNAL=/usr/bin/python3.6

Could NOT find Python3 (missing: Python3_LIBRARIES Python3_INCLUDE_DIRS Python3_NumPy_INCLUDE_DIRS Development NumPy)

I have attched the cmakelist file for reference.

cmake_minimum_required(VERSION 3.16)
find_package(Python3 COMPONENTS Interpreter Development NumPy)

Can anyone please help me to solve this issue.

Regards,

Aneesh

  • Hi Aneesh,

    Can you please elaborate on the problem statement further?

    Does installing any of these dependencies on the host help you to move further? I do see that the numpy other python modules can be installed by adding it to the target filesystem using the methods that you are already familiar with.

    I believe that I'm missing some information to help understand your problem clearly. If the above suggestion is not useful, please consider expanding the details further so that I can help you out.

    Regards

    Karthik

  • Hi karthik,

    I have elaborated the problem statement below.

    According to the psdkla_07_00_00_04 manifest file the  python3.8 is already present in the sdk both host(x86_64-arago-linux) and target(aarch64-linux). As mentioned  in the manifest file the python3.8 binaries, include directories , libraries and numpy include directories are present in the sdk target(aarch64-linux). But I do not find python binaries in the sdk host(x86_64-arago-linux).The root cause of this problem may be the nativesdk-python3.8 is not populated in the sdk host(x86_64-arago-linux) properly.
    when i try to find the python packages in the sdk using cmake. I am not able to find the python from the sdk. The routine i am using to find the package in CMakeLists.txt is given below.
    find_package(Python3 3.8 EXACT REQUIRED Development Interpreter NumPy)
    If there is any confusion in the problem statement, we can have a meeting.
    if you don't understand the problem, Please inform us immediately because we are blocked because of this issue.
     
    Thanks and Regards,
    Aneesh

     

     
     
     
  • Aneesh,

    I think I understand the problem. Can you please help me with an example public repository using which I can experiment the solution to test and provide to you? 

    Or we can work offline and certainly have a meeting to go over this. Let me know separately if you think a meeting is easier.

    Regards

    Karthik

  • Hi karthik,

    As per the discussion in the yesterday meeting i have shared the steps and sample application to you through an email for reproducing the problem on your side.I am attaching the steps and sample application below also for tracking.

    1.crete a new sdk_exp folder and untar the sdk arago-core-psdkla-bundle-j7-evm.tar.xz file in sdk_exp folder using below commands:

    $mkdir sdk_exp

    $cd sdk_exp

    $tar -xvf arago-core-psdkla-bundle-j7-evm.tar.xz

     

    2.Now run the below script to install the sdk.

    $./sdk-install.sh

     

    3.Now untar the python-test in the sdk_exp folder using below command.

    $tar -xvf python_test.tar.xz

     

    4.Source the sdk environment for cross-compiling using below command.

    $source linux-devkit/environment-setup

     

    5. Execute below commands inside the python_test folder.

    $mkdir build

    $cd build

    $cmake ..

    $make

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/python_5F00_test.7z

    Thanks and Regards,

    Aneesh

  • Aneesh,

    Thanks. I have been able to recreate the issue. I'm looking into the options for resolving the same.

    In the meanwhile, if you have any other suggestions to get me upto speed with where you are.

    Regards

    Karthik

  • Hi Aneesh,

    We are now in discussions about this patch: http://arago-project.org/git/?p=meta-arago.git;a=commitdiff;h=a3f404323a3be6bc1902a6e167c2eae288f2eb2e, reverting this patch seems to get us a bit further.

    Your test doesn't use numpy so you can uncomment the numpy dependency and see if you can get the tests to be compiled and working.

    Can you try this at your end and let us know your results?

    Regards

    Karthik

  • Hi karthik,

    Last week, we also found the same thing which is mentioned in the patch and I have commented the python binaries removing step like below from the ~/meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb file and tested the sdk with sample test application.

    # Remove python binaries
    # gdb links with libpython and loads core modules, which bundled with binaries
    #rm -rf ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/python*

    The cmake is able to find the python Interpreter and Development packages but still have the issues in finding the NumPy packages. As the numpy is also one of the main required package, we need the support to fix for the numpy issue.

    Thanks and Regards,

    Aneesh

  • Hi Aneesh,

    I suggest that we start engaging in the python3 related forums and understand the dependency here.

    I'm trying to discuss internally with our experts also, will keep you posted if I find anything. I have already tried include numpy with the below patch and that didn't seem to help:

    diff --git a/meta-arago-extras/recipes-core/packagegroups/nativesdk-packagegroup-arago-tisdk-host.bb b/meta-arago-extras/recipes-core/packagegroups/nativesdk-packagegroup-arago-tisdk-host.bb
    index 5a453b6d..f549399a 100644
    --- a/meta-arago-extras/recipes-core/packagegroups/nativesdk-packagegroup-arago-tisdk-host.bb
    +++ b/meta-arago-extras/recipes-core/packagegroups/nativesdk-packagegroup-arago-tisdk-host.bb
    @@ -14,6 +14,7 @@ TIDL_TOOLS = ""
    #"

    EXTRA_TI_TOOLS = " \
    + nativesdk-python3-numpy \
    nativesdk-ti-cgt6x \
    nativesdk-ti-cgt-pru \
    nativesdk-clocl \

    Regards

    Karthik

  • Hi Aneesh,

    As mentioned in the previous post, we have included the patches to add the python and numpy into the nativesdk.

    With that we have seen the above test case passing after commenting out the numpy dependency.

    So, with regard to including the python-numpy package, it is still an unknown and we are not sure what else is missing.

     $ find . -name numpy*

    ./sysroots/x86_64-arago-linux/usr/lib/python3.8/site-packages/numpy

    ./sysroots/x86_64-arago-linux/usr/lib/python3.8/site-packages/numpy/core/include/numpy

    ./sysroots/x86_64-arago-linux/usr/lib/python3.8/site-packages/numpy/core/include/numpy/numpyconfig.h

    ./sysroots/x86_64-arago-linux/usr/lib/python3.8/site-packages/numpy/distutils/numpy_distribution.py

    ./sysroots/x86_64-arago-linux/usr/lib/python3.8/site-packages/numpy/distutils/__pycache__/numpy_distribution.cpython-38.pyc

    ./sysroots/x86_64-arago-linux/usr/lib/python3.8/site-packages/numpy-1.17.4-py3.8.egg-info

    .. etc 

    We have a suspicion that it may be related to the cmake usage itself and since we are having an offline conversation on cmake, I suggest we close this thread here and continue in a consolidated thread. 

    This also needs to be worked with the python community.

    Regards

    Karthik