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.

  • TI Thinks Resolved

CCS/TMS320C6678: dgemm_test build using CCS v8

Intellectual 615 points

Replies: 20

Views: 1273

Part Number: TMS320C6678

Tool/software: Code Composer Studio

Hi

After successfully building the dgemm example found in linalg_1_2_0_0/examples/dsponly/dgemm_test via Makefile, The program built using the Makefile also successfully runs on the DSP and yields remarkable performance. However, I am experiencing different issues using CCS.

This is how I tried to build it from CCS:
1. I copy-pasted a project I previously created as described in "http://downloads.ti.com/mctools/esd/docs/openmp-dsp/building_openmp_app.html"

2. I copied dgemm_test.c, fc_config_c6678.c, ticblas_config.c and omp_config.cfg into my project folder

3. I added the necessary products via Project -> Properties.

4. If I build now, it throws the following error:
"/home/idris/ti/libarch_1_0_0_0/packages/ti/libarch/src/lib_cachecfg.h", line 38: fatal error #35: #error directive: "Unsupported OS! Please specify either LIB_OPENCL or LIB_RTOS"

I therefore add -DLIB_RTOS to the C6000 compiler flags under Project->Build->C6000 Compiler. This flag is also set when building via Makefile.

5. If I build now, I get:

"/home/idris/ti/libarch_1_0_0_0/packages/ti/libarch/src/lib_cachecfg.h", line 90: fatal error #35: #error directive: "Unsupported TARGET"

So I also add -DSOC_C6678, also passed in the Makefile.

6. It now finishes building but the Linker throws the following error:

 undefined             first referenced    
  symbol                   in file         
 ---------             ----------------    
 cblas_dgemm           ./dgemm_test.obj    
 lib_L1D_config_SRAM   ./ticblas_config.obj
 lib_get_L1D_SRAM_size ./ticblas_config.obj
 lib_get_L2_SRAM_size  ./ticblas_config.obj
 tiCblasDelete         ./ticblas_config.obj
 tiCblasGetSizes       ./ticblas_config.obj
 tiCblasInit           ./ticblas_config.obj
 tiCblasNew            ./ticblas_config.obj
 
error #10234-D: unresolved symbols remain

And I unfortunately don't have any answer to this. Could maybe someone give me some hints on what I am doing wrong? Any help is appreciated. Please tell me if you need some additional information. Thank you very much.

Edit 1:

I was building in Debug Mode. However, changing to release did not help. Here the complete console output:

---------------------------------------------------------------------------------------

**** Build of configuration Release for project omp_linalglib4 ****

/home/idris/ti/ccsv8/utils/bin/gmake -k -j 4 all -O 
 
Building file: "../dgemm_test.c"
Invoking: C6000 Compiler
"/home/idris/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.4/bin/cl6x" -mv6600 -O2 --include_path="/home/idris/ti/openmp_dsp_c667x_2_06_02_01/packages/ti/runtime/openmp" --include_path="/home/idris/ti/openmp_dsp_c667x_2_06_02_01/packages/ti/runtime/openmp/platforms" --include_path="/home/idris/workspace_v8/omp_linalglib4" --include_path="/home/idris/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.4/include" --define=LIB_RTOS --define=SOC_C6678 --diag_warning=225 --diag_wrap=off --display_error_number --openmp --preproc_with_compile --preproc_dependency="dgemm_test.d_raw" --cmd_file="configPkg/compiler.opt" "../dgemm_test.c"
Finished building: "../dgemm_test.c"
 
Building target: "omp_linalglib4.out"
Invoking: C6000 Linker
"/home/idris/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.4/bin/cl6x" -mv6600 -O2 --define=LIB_RTOS --define=SOC_C6678 --diag_warning=225 --diag_wrap=off --display_error_number --openmp -z -m"omp_linalglib4.map" -i"/home/idris/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.4/lib" -i"/home/idris/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.4/include" --priority --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="omp_linalglib4_linkInfo.xml" --rom_model -o "omp_linalglib4.out" "./dgemm_test.obj" "./fc_config_c6678.obj" "./ticblas_config.obj" -l"configPkg/linker.cmd" -llibc.a 
<Linking>
"configPkg/linker.cmd", line 131: warning #10068-D: no matching section
warning #10247-D: creating output section ".tdata" without a SECTIONS specification
warning #10247-D: creating output section ".tbss" without a SECTIONS specification
 
 undefined             first referenced    
  symbol                   in file         
 ---------             ----------------    
 cblas_dgemm           ./dgemm_test.obj    
 lib_L1D_config_SRAM   ./ticblas_config.obj
 lib_get_L1D_SRAM_size ./ticblas_config.obj
 lib_get_L2_SRAM_size  ./ticblas_config.obj
 tiCblasDelete         ./ticblas_config.obj
 tiCblasGetSizes       ./ticblas_config.obj
 tiCblasInit           ./ticblas_config.obj
 tiCblasNew            ./ticblas_config.obj
 
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "omp_linalglib4.out" not built
 
gmake[1]: *** [omp_linalglib4.out] Error 1
>> Compilation failure
makefile:140: recipe for target 'omp_linalglib4.out' failed
gmake: *** [all] Error 2
makefile:136: recipe for target 'all' failed

**** Build Finished ****

----------------------------------------------------------------

Edit 2:

Creating a makefile-project resolves the matter - still it would be amazing to find another solution.

  • Guru 76505 points
    Hi,

    The engineer supporting on LINALG is out of office.

    Your issue seems to be a project can be built by makefile, but you can't build it with a CCS project. We dealt with many such issues. The typical way is:
    - save the makefile build log
    - check what the compiler and linker options, pre-defined symbols
    - check the include path
    - check the linked library
    - check the liner command file

    Those can be found out from the build log or inside makefile. Then in your CCS project, you need to add all of them into it, like you find "-DSOC_C6678" " -DLIB_RTOS".

    You already in the final steps, the linking error indicates you missed some libraries. You need find them and just add into CCS project (for example, in the makefile approach, you have a *.map file, you can search what library has those functions).

    Regards, Eric
  • In reply to lding:

    Hi Eric,

    Please excuse my late answer and thank you for your hints. I will try your suggestions and hopefully be able to post how I resolved the issue shortly.

    Best wishes,

    Idris

  • Guru 76505 points

    In reply to Idris Kempf:

    No problem, let me know the status!

    Regards, Eric
  • In reply to lding:

    Hi ,you need to add the lib below. then the error is gone. 

    -l"C:/ti/linalg_1_2_0_0/packages/ti/linalg/lib/libcblas.ae66" \
    -l"C:/ti/libarch_1_0_0_0/packages/ti/libarch/lib/libarch.ae66" \

    so, I loud the .out file to my evm6678. but it the console show that:

    "
    [C66xx_0] Hello world from thread = 0
    Number of threads = 1
    L2 SRAM size is 393216, total L2 size is 524288."
    it seems that when the program go to the "tiCblasNew();",it runs crazy. 
    If you have any good tricks ,connect me by yufujianwork@163.com
  • In reply to fujian yu:

    Hi Fujian,

    Thanks a lot for your hint. Adding these two libraries to Project Properties -> Build -> C6000 Linker -> File Search Path -> Include Library file made it compile. I currently don't have the EVM with me but I will post my results as soon as I get it back.

    Best wishes,

    Idris

     EDIT: Without having my EVM at hand, it seems to me that you only loaded the program onto one core. I thought the program would be supposed to say hello from all cores C66XX_0-7.

  • In reply to Idris Kempf:

    Hi,Idris Kempf:

    how can I load the out file to all the cores?

    I go to "project-->debug as-->debug configurations->program" and set all the cores will load the program. 

    but it still dont work.

    I need your help. 

  • In reply to fujian yu:

    Hi,

    turns out that I have the same problem, the device seems to be hanging at tiCblasNew(). I can't recall what I did when I ran the program the first time a few months ago. But the program hangs for both the executable built via makefile and the one built via ccs.

    I now rebuilt the libarch and linalg libraries as described in http://processors.wiki.ti.com/index.php/Processor_SDK_Linear_Algebra_Library but the problem persists.

    I also connect/launch the program with the options described in http://downloads.ti.com/mctools/esd/docs/openmp-dsp/building_openmp_app.html

    I connect via my target config file which executes the setup script for core 0, I load the program onto all cores. When they all point to _c_int00 I am starting them and getting the output:

    [C66xx_0] Hello World from thread = 0
    Number of threads = 8
    [C66xx_1] Hello World from thread = 1
    [C66xx_2] Hello World from thread = 2
    [C66xx_3] Hello World from thread = 3
    [C66xx_4] Hello World from thread = 4
    [C66xx_5] Hello World from thread = 5
    [C66xx_6] Hello World from thread = 6
    [C66xx_7] Hello World from thread = 7
    L2 SRAM size is 393216, total L2 size is 524288.

    It then hangs at the the function tiCblasNew() and when I pause core 0 I see:

    GOMP_critical_start() at tomp_util.h:150
    bli_init() at bli_init.c55

    Any hints on that @TI please?

    Thank you very much for your help.

    Best wishes,

    Idris

  • In reply to lding:

    Hi, Eric,Idris and I both got into the same problem , it seems the tiCblasNew() function didn't work at all. rebuild the lib didn't work, too.
    I think maybe the cmd file is the key to that problem , but i don't know how to config the file right , Can you help us?
  • In reply to fujian yu:

    Hi Yu,

    Try pressing Warm Reset (the middle button next to the ethernet plug). That helped in my case. However, it then blows up configuring the memory. Could you maybe give us your output to:
    printf("BLAS memory requirements - vfast size: %d, fast size: %d, medium size: %d, slow size: %d.\n", smem_size_vfast, smem_size_fast, smem_size_med, smem_size_slow);

    Thanks
  • In reply to Idris Kempf:

    Hi,

    I cannot get to line 162,it blows up at line 159.

    the printf code is in the config_mem_for_ticblas() function. I can't get there, so didn't print anything.

    second , I wanna ask you the cmd is generated automatically ,right?,Do I have to adjust a cmd file. 

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.