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.

mcsdk-HPC openmpacc examples

Hello,

I am using mcsdk-hpc_03_00_00_19. I was trying to compile out of the box openmpacc example and got the following error:

arm-linux-gnueabihf-g++ -O3 -c printf_debug_main.cpp
clacc -v -k printf_debug_main.o printf_debug_target.c -o printf_debug
/usr/bin/clacc: 1: /usr/bin/clacc: Syntax error: word unexpected (expecting ")")
make: *** [printf_debug] Error 2

I am using ubuntu 12.04 box for cross compiling the example. Am I missing something?


Also, is clacc used to compile DSP code (does it call TI_CGT_7.6)?


Please let me know if more info is required. Thanks you in advance
.

regards,

Barath Ramesh

  • Hi Barath,

    You will need to source ompacc_env.sh script provided in TARGET_ROOTDIR/usr/share/ti/examples/openmpacc/. The script adds the path to the CLACC wrapper shell used by the implementation to your environment's PATH variable.

    Yes, CLACC invokes the DSP C6000 compiler. CGT v8.0.x is required to compile the openmpacc examples.

    Please see http://processors.wiki.ti.com/index.php/OpenMP_Examples and http://processors.wiki.ti.com/index.php/OpenMP_CLACC for more information on compiling the examples and the various CLACC options.


    Hope this helps.

    Dunni

  • Hi,

    The "clacc" issue got resolved after using clacc provided in usr/share/ti/openacc/x86/bin. But looks like I am missing "clocl". Please find the error log below:

    clacc -v -k printf_debug_main.o printf_debug_target.c -o printf_debug
    >> DEBUG: Executable fat binary name: printf_debug
    >> DEBUG: Input files: printf_debug_main.o printf_debug_target.c
    >> DEBUG: ARM object file or archive: printf_debug_main.o
    >> DEBUG: Source code file: printf_debug_target.c
    >> DEBUG: Using /home/barath/linaro/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/bin/arm-linux-gnueabihf-gcc for HOST compilation.
    >> DEBUG: Using /home/barath/linaro/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/bin/arm-linux-gnueabihf-g++ for HOST compilation.
    >> DEBUG: Using /opt/ti_5_5/c6000_7.6.0/bin/cl6x for TARGET compilation.
    >> DEBUG: Using /opt/ti_5_5/c6000_7.6.0/bin/cl6x for S2S compilation.
    >> ERROR: Compiler clocl not in PATH. Exiting..
    make: *** [printf_debug] Error 1

    Thanks a lot for the help.

    regards,

    Barath Ramesh

  • Hi Barath,

    When cross compiling the OpenMP examples, you need to set the following environments:

    TI_OCL_CGT_INSTALL=Location of the TI codegen tools DSP compiler tools

    TARGET_ROOTDIR=Location of the K2H file-system

    PATH=$TARGET_ROOTDIR/ti/openacc/x86/bin;$TARGET_ROOTDIR/usr/share/ti/opencl/bin/x86; $TI_OCL_CGT_INSTALL/bin

    The OpenMP implementation relies on TI's OpenCL implementation so it is a good idea to verify that you are set up to build and run OpenCL before you build OpenMP applications.

    Additional useful wiki links are:

    http://processors.wiki.ti.com/index.php/OpenCL_Getting_Started and http://processors.wiki.ti.com/index.php/OpenMP_Accelerator_Model_1.x#Building_OpenMP_4.0_Applications

    Dunni

  • Hi Dunni,

    Thanks for helping me out, I am new to cross-compilation. I tried compiling opencl example and got stuck again. Please find the error log below:

    /usr/include/CL/cl.hpp:160:19: fatal error: GL/gl.h: No such file or directory
    compilation terminated.
    make: *** [simple.o] Error 1

    I don't know why make is looking at /usr/include instead of $TARGET_ROOTDIR/usr/include. Also, the only place where I could find CL/cl.hpp is: /opt/ti_5_5/ti-opencl_0.9.0/opencl/include/CL/cl.hpp

    I do have the K2H file-system unpacked in $TARGET_ROOTDIR (/evmk2h_nfs): sudo tar xvf tisdk-rootfs.tar.gz -C /evmk2h_nfs

    My $PATH: /opt/ti_5_5/c6000_7.6.0/bin:/evmk2h_nfs/opt/ti-openmpi/bin:/opt/ti_5_5/c6000_7.6.0/bin:/home/barath/linaro/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/bin:/evmk2h_nfs/usr/share/ti/opencl/bin/x86:/evmk2h_nfs/usr/share/ti/openmpacc/bin/x86:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

    And no errors after sourcing setup_hpc_env.sh

    Although, I could not find a directory by the name: $TARGET_ROOTDIR/opt


    Thanks again for the help.

    regards,

    Barath Ramesh

  • Hi Barath,

    Please verify the value in $TARGET_ROOTDIR.

    Did you copy simple to a new location? Each example's makefile includes make.inc which is expected to be one level up from each example's directory. So be sure to that the makefile can locate make.inc.

    Please remove the @ before the command $(CPP) command so that we can view the command line string in the console. Kindly send this output if you are still having issues.


    Thanks,

    Dunni

  • Hi Dunni,

    I hope that the below info helps, I am still stuck.

    echo $TARGET_ROOTDIR: /evmk2h_nfs

    Location of simple: /evmk2h_nfs/usr/share/ti/examples/opencl/simple/ (I used dpkg to unpack on ubuntu desktop and moved examples from default dir:/usr/share/ti)

    Yes, there is make.inc one level up and I believe make can locate it since it is invoking arm compiler

    Error log after removing @ from $(CPP):

    arm-linux-gnueabihf-g++  -c -O3 -I/evmk2h_nfs/usr/include -idirafter /usr/include simple.cpp
    In file included from simple.cpp:29:0:
    /usr/include/CL/cl.hpp:160:19: fatal error: GL/gl.h: No such file or directory
    compilation terminated.
    make: *** [simple.o] Error 1

    Should there be a $TARGET_ROOTDIR/include/CL/cl.hpp?

    Thanks a lot for the prompt replies.

    regards,

    Barath Ramesh

  • Yes, cl.hpp should be on your EVM file system and should have been installed when you installed the HPC IPKs and codegen tools on to the EVM.

    Did you already do this?

    Dunni

  • Hi Dunni,

    I sort of see the issue. Installing the HPC IPks and codegen tools is where I am confused.

    I could not find install_hpc_packages_evm.sh in my mcsdk-hpc_03_00_00_19/images directory and I used dpkg --force--architecture on my x86 machine to unpack the ipk's could this be an issue?

    Also, seeing that I do find a CL/cl.hpp in my /opt/ti/ti-opencl_0.9.0 but not in my $TARGET_ROOTDIR makes me feel that I messed up IPKs and codegen tools setup by deviating from the getting started wiki.

    Thanks a lot for narrowing the issue.

    regards,

    Barath Ramesh

  • Hi Barath,

    The ipks should be installed on the EVM file system, not on your x86.

    To install the ipks,

    Option 1: Log in as root on the EVM and install each ipk with opkg install "ipkname"

    or Option 2: From x86 machine, sudo dpkg -x "ipkname" /evmk2h_nfs

    To install codegen tools v.7.6.x,

    > cd /evmk2h_nfs
    > mkdir -p ./opt/ti
    > cp <path_to_installer>/ti_cgt_C6000_<VER>_armlinuxa8hf_installer.sh ./opt/ti
    > cd ./opt/ti
    > chmod +x ti_cgt_C6000_<VER>_armlinuxa8hf_installer.sh
    > ./ti_cgt_C6000_<VER>_armlinuxa8hf_installer.sh

    These instructions are in http://processors.wiki.ti.com/index.php/MCSDK_HPC_3.0.0_Beta_Getting_Started_Guide
    . I suspect that the instructions you were trying to follow applies to more a more recent version of mcsdk-hpc. Our apologies. Please let me know how this works.

    Dunni

  • Hi Dunni,

    Thanks for pointing me to the right page, Cl/cl.h is now available but few other header files are missing.

    /evmk2h_nfs/usr/include/CL/cl.hpp:160:19: fatal error: GL/gl.h: No such file or directory
    compilation terminated.
    make: *** [simple.o] Error 1

    I re-checked my procedure based on the correct wikki page, I don't think I am missing anything for cross-compilation.

    Thanks a lot for helping me to sort this issue.


    regards,

    Barath Ramesh

  • Hi Barath,

    Please try sudo apt-get install mesa-common-dev to get the gl header.

    Dunni

  • Hi Dunni,

    Thanks for all the help! I was able to compile OpenCL, OpenCL+OpenmP, and OpenMP+OpenMP examples. 

    But when I tired running the cross-compiled OpenCL example on the EVM I got the following error:

    CMEM Error: init: Failed to open /dev/cmem: 'No such file or directory'

    The cmemk kernel module does not appear to installed.

    Commands such as the following run as root would install cmemk
    and allow OpenCL to proceed properly. The actual memory address values for
    your system may differ.

    For available CMEM DDR block size: ~1.5GB:
    modprobe cmemk phys_start=0x826000000 phys_end=0x880000000 pools=1x1509949440 phys_start_1=0x0C040000 phys_end_1=0x0C500000 allowOverlap=1

    I checked the EVM's bootlog (attached section of bootlog), it says CMEMK failed. Is this why there is no /dev/cmem?

    Once again thanks a bunch for the help.

    regards,

    Barath Ramesh

    8880.boot_log_evm.txt

  • Hi,

    Quick update on my previous post, I tried running the following command on the EVM:

    modprobe cmemk phys_start=0x826000000 phys_end=0x880000000 pools=1x1509949440 phys_start_1=0x0C040000 phys_end_1=0x0C500000 allowOverlap=1

    Error log for the above command:

    [603436.560848] CMEMK module: built on Aug  5 2014 at 11:19:54
    [603436.566440]   Reference Linux version 3.10.10
    [603436.571012] CMEM Range Overlaps Kernel Physical - allowing overlap
    [603436.577305] CMEM phys_start (0x826000000) overlaps kernel (0x800000000 -> 0x860000000)
    [603436.577310] CMEMK Error: Failed to request_mem_region(0x826000000, 0x5a000000)
    ERROR: could not insert 'cmemk': Bad address

    Thanks for all the help.

    regards,

    Barath Ramesh

  • Hi,

    The trouble shooting wiki had the solution for the CMEM issue:

    http://processors.wiki.ti.com/index.php/MCSDK_HPC_3.x_Trouble_shooting

    Thank you.


    regards,

    Barath Ramesh