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.

AM5749: makefile:54: recipe for target 'build-api' failed

Part Number: AM5749

Hi, 

I want to use the TIDL API to import my model and test it.

THis is my setup till now.

- Downloaded TIDL API 01.05.01 from git.ti

- Downloaded AM57x SDK  (ti-processor-sdk-linux-am57xx-evm-06.02.00.81)

The SDK got installed and then, I ran the `linux-devkit.sh` and it showed that the SDK was ready for use. I did no installation in the TIDL API and simply extracted it from 'tar'.

Now, when I try to make all the components of the API using the `makefile` in `tidl/tidl-api01.05.01` directory, I get the error 

pradan@pradan-HP-15-Notebook-PC:~/tidl/tidl-api-01.05.01$ make
make -C tidl_api
make[1]: Entering directory '/home/pradan/tidl/tidl-api-01.05.01/tidl_api'
make.inc:99: *** C++ cross-compiler arm-linux-gnueabihf-g++ not found. Set PSDK_LINUX to point to the target Linux PSDK for automatic configuration, set HOST_ROOTDIR to the x86_64 Linux devkit, or add the compiler bin directory to PATH..  Stop.
make[1]: Leaving directory '/home/pradan/tidl/tidl-api-01.05.01/tidl_api'
makefile:54: recipe for target 'build-api' failed
make: *** [build-api] Error 2

PS: I have tried following the shell interrupts (as shown in above verbose). i.e., I did setup my environment variables using `export` command. I can verify that using the `printenv` commad. THis is what I see:

PSDK_LINUX=/home/pradan/ti-processor-sdk-linux-am57xx-evm-06.02.00.81
USERNAME=...
...
PWD=/home/pradan/tidl/tidl-api-01.05.01
...
TARGET_ROOTDIR=/home/pradan/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/bin
...
HOST_ROOTDIR=/home/pradan/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit
...
PATH=/home/pradan/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/bin:/home/pradan/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/pradan/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/bin
SESSION_MANAGER=local/pradan-HP-15-Notebook-PC:@/tmp/.ICE-unix/2300,unix/pradan-HP-15-Notebook-PC:/tmp/.ICE-unix/2300
LESSOPEN=| /usr/bin/lesspipe %s
GTK_IM_MODULE=ibus
_=/usr/bin/printenv



I don't why the makefile isn't able to build the API ? Also, can I get a better doc for it ? Please Help :(
  • Ok so here's the update. I permanently changed my PATH as:

    $ gedit ~/.profile

    And then, I sourced this file using 

    $ source ~/.profile
    

    So, the actual problem got resolved but this is what I face now: 

     

    I tried searching for the "features.h" file in the SDK folder and found many of them... I added the one in "...usr/include" to the environment but still to no good. 

    please help

  • Hi Prashant, is an option for you build TIDL-API on target (AM57x)?. In case, this is an option for you let me share some steps that worked for me in the pass

    1. Clone tidl-api inside AM57x /home/root/git_tidl_api

    git clone https://bitbucket.itg.ti.com/scm/mctools/tidl-api.git

    1. Export some paths

    export TIDL_API_DIR=/home/root/git_tidl_api/tidl-api/tidl_api

    export LD_LIBRARY_PATH=${TIDL_API_DIR}

    1. Build / run (below is for a particular example in one of the git branches.. but should work for the  building the lib)

    root@am57xx-evm:~/git_tidl_api/tidl-api/examples/mobilenet_subgraph# make clean

    root@am57xx-evm:~/git_tidl_api/tidl-api/examples/mobilenet_subgraph# make

    root@am57xx-evm:~/git_tidl_api/tidl-api/examples/mobilenet_subgraph# ./mobilenet_subgraph

    1. For enabling dbg

    Export TIDL_SUBGRAPH_TRACE=1

    Hope this helps,

    Paula

  • Hi . Thanks for the reply but I am building it on my x86 ubuntu system... and I fear this is not what I need

  • Prashant, in your Ubuntu are you cross-compiling or building for native Linux?. I believe you are cross-compiling as you setup TARGET_ROOT, however, I am not sure you are using the correct prefix

    TARGET_ROOTDIR=/home/pradan/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/bin

    from Makefile I see it is suggested "armv7ahf-neon-linux-gnueabi"

    thank you,

    Paula

  • I am trying to build it... to test model porting using TIDL. (I also aim to use the viewer to view the equivalent model).

    this is what I see in the makefile

    # makefile for building from the tidl-api git repo
    # Cross-compilation requires TARGET_ROOTDIR to be set.
    # E.g.
    # PSDK_LINUX=<path to Processor Linux SDK install>
    # TARGET_ROOTDIR=ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi

    I used the prefix from here. Am I wrong ?

  • Prashant, I just gave it a try and it worked for me.. What I did:

    ~/ti/GIT_TIDL_API/tidl-api$ export PSDK_LINUX="/home/paula/ti/ti-processor-sdk-linux-am57xx-evm-06.02.00.81"
    ~/ti/GIT_TIDL_API/tidl-api$ export TARGET_ROOTDIR="/home/paula/ti/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi"
    ~/ti/GIT_TIDL_API/tidl-api$ export HOSR_ROOTDIR="/home/paula/ti/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/x86_64-arago-linux"
    ~/ti/GIT_TIDL_API/tidl-api$ make build-api
    ~/ti/GIT_TIDL_API/tidl-api$ make build-examples

    Hope this works for you,

    Paula

  • Hey Paula. thanks for the follow up. I am on it and will let you know the progress soon. 

    P.S. Prior to the TIDL make, I am setting up the SDK installation as given here: http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Overview/Download_and_Install_the_SDK.html

    Am I doing it right ?

  • Hi Prashant, yes, it also what I did.

    thank you,

    Paula

  • Hey Paula,

    I completed the SDK setup mentioned in the link below. AND shown below 

    software-dl.ti.com/.../Overview_Building_the_SDK.html  Is it necessary ? Also, I tried making the TIDL API midway this and the problem still persisted. 

    $ git clone git://arago-project.org/git/projects/oe-layersetup.git tisdk
    $ cd tisdk
    $ ./oe-layertool-setup.sh -f configs/processor-sdk/processor-sdk-<version>-config.txt
    $ cd build
    $ . conf/setenv
    $ export TOOLCHAIN_PATH_ARMV7=$HOME/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf
    $ export TOOLCHAIN_PATH_ARMV8=$HOME/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu  
    # EXCEPT FOR THIS STEP             
    $ MACHINE=am57xx-evm bitbake arago-base-tisdk-image   

  • Prashanth,

    Please ignore the step that you are facing a problem and just try to follow Paula's suggestion without this step.

    Regards

    Karthik

  • Hey  I wasn't sure if I correctly installed the SDK, so I opened another thread here https://e2e.ti.com/support/processors/f/791/p/896178/3313366#3313366. This is the update:

    I executed the `make` command while building the SDK, as mentioned here: http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Overview/Top_Level_Makefile.html. Now, I see the following directory built: example_applications... along with some others. 

    Inside which, I even see "tidl-examples-1.4.0" folder. I thought that this saves the need to setup TIDL API manually, but when I try to run the executables already built inside any example, it shows the following error:

            

    pradan@pradan-HP-15-Notebook-PC:~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/example-applications/tidl-examples-1.4.0/ssd_multibox$ ./ssd_multibox
    bash: ./ssd_multibox: cannot execute binary file: Exec format error
    

    After this, I again tried installing the TIDL using your suggestio. Here's the persistent error I am facing: 

    pradan@pradan-HP-15-Notebook-PC:~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/tidl$ export PSDK_LINUX="~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81"
    pradan@pradan-HP-15-Notebook-PC:~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/tidl$ export TARGET_ROOTDIR="~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi"
    pradan@pradan-HP-15-Notebook-PC:~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/tidl$ export HOSR_ROOTDIR="~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/x86_64-arago-linux"
    pradan@pradan-HP-15-Notebook-PC:~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/tidl$ make build-api
    make -C tidl_api
    make[1]: Entering directory '/home/pradan/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/tidl/tidl_api'
    Compiling src/ocl_device.cpp ...
    ~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-g++ -c "--sysroot=~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi" -I~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/usr/include -I~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/usr/include -O3 -std=c++11 -Wall -Werror -Wno-error=ignored-attributes -fPIC -I~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/usr/share/ti/opencl -I~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/usr/share/ti/opencl -Isrc -Iinc -D_BUILD_VER=01.05.01 -D_BUILD_SHA=4b801ad src/ocl_device.cpp -o obj/ocl_device.o
    In file included from /home/pradan/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/usr/include/c++/8.3.0/arm-linux-gnueabihf/bits/c++config.h:508,
                     from /home/pradan/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/usr/include/c++/8.3.0/cstdlib:41,
                     from src/ocl_device.cpp:30:
    /home/pradan/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/usr/include/c++/8.3.0/arm-linux-gnueabihf/bits/os_defines.h:39:10: fatal error: features.h: No such file or directory
     #include <features.h>
              ^~~~~~~~~~~~
    compilation terminated.
    Makefile:92: recipe for target 'obj/ocl_device.o' failed
    make[1]: *** [obj/ocl_device.o] Error 1
    make[1]: Leaving directory '/home/pradan/ti-processor-sdk-linux-am57xx-eppradan@pradan-HP-15-Notebook-PC:~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81/tidl$ 
    
    
    

    What am I doing wrong ?

  • Hi Prashant, to your questions:

    1)  if building rebuilding SDK is necessary, Answer, as pointed out by Karthik is not. In my test, I just downloaded/installed latest Linux PSDK from ti.com... Rebuilding the SDK could be challenging the first time, specially if you are behind proxy settings in your network.. So, I would suggest only do it if you really need it.

    2) ./ssd_multibox: cannot execute binary file: Exec format error --> Most likely this binary was crosscompiled for ARM. My guess is that you get it from Linux PSDK pre-build package. but let me know if I am wrong. And if so, from where this binary comes.

    Note: Even if you succeed on building tidl-api and the examples, I just checked Makefile from GIT TIDL_API /tidl-api/examples/ssd_multibox and it uses for TIDL_API_DIR = ${TARGET_ROOTDIR}/usr/share/ti/tidl/tidl_api.. so I don't think you can compiled ssd_multibox demo for x86.. well maybe if you modify makefiles and uses tidl_api.a library build for x86 you could.. In summary it could be a way but probably not that straight forward.

    For your background, we typically start developing on x86, but for our releases not always those test environments and makefiles get carry. After releasing to Linux PSDK in ti.com most of the testing (if not all) is done on the boards..  

    I will check with the experts to see if there is a way to do it and come back to you.

    Also, do you think you can get access to an AM57x9?

    Thank you,

    Paula

  • Prashant, after discussing with our expert, we don't think OOB ssd_multibox example/demo from tidl-api can run on Linux PC. However, if you goal is to confirm your network is supported by TIDL, then you can use/run TIDL import tools on your PC to get some insights (e.g. whether there is unsupported layer, whether the calibration results make sense, etc). Few more details: Verifying TIDL inference result)

    thank you,

    Paula

     

  • Hey Paula, your answer worked but only after the environment script was sourced `

    pradan@pradan-HP-15-Notebook-PC:~/ti-processor-sdk-linux-am57xx-evm-06.02.00.81$ source linux-devkit/environment-setup

    `. 

    Thank you for the efforts. 

    But, although I see all the examples built as executables, how can I use the tools like : model import tool, viewer tool, etc on my Linux system ?

  • Hi Prashant, interesting.. maybe I have a path hard coded somewhere, that help me build without running "environment-setup". In any case, I am glad you figure it out. I would take a note.

    On the other hand, you can find a prebuild tidl_model_import.out binary and example configuration files in your Linux PSDK. Below example paths:

    • ti-processor-sdk-linux-am57xx-evm-06.02.00.81-release/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/tidl_model_import.out
    • ti-processor-sdk-linux-am57xx-evm-06.02.00.81-release/linux-devkit/sysroots/x86_64-arago-linux/usr/share/ti/tidl/utils/test/testvecs/config/import/


    Sample Usage: tidl_model_import.out ./test/testvecs/config/import/tidl_import_jseg21.txt

    More details on how to run import tool, viewer tool etc:

    Finally, just FYI, below GIT location for TIDL Utils:


    thank you,

    Paula