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.

CCS/TMS320C6655: <typeindex> standard header

Part Number: TMS320C6655
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

I have a set of code which is a c++14 implementation of some vision algorithms. The codes can be built with a C++14 compiler (gcc 4.9+, clang 3.6+ or VS 2015+).

Now I am trying to using ccsv6 CGT(compiler) v8.0.4 to build the same code to run on TMS320C6655, and found that quite a few standard headers are not supported by CGT v8.0.4, for example <typeindex> standard header, <random> standard header.

My code need to use those standard headers, how can I get those equivalent headers which can be supported by ccsv6 CGT(compiler) v8.0.4?

Thanks.

  • To get C++14 support, you need to upgrade to compiler version 8.3.x.  For further details, please see the article C++14 Support for ARM, MSP and C6000 Compilers.

    Thanks and regards,

    -George

  • Dear George,

    Thanks for your response. 

    I would like to explain my situation, I have two set of codes, Set A and Set B.

    • Set A is developed about 3 years ago with TIC6000  v8.0.4. Set A can be successfully built and run with TIC6000 v8.0.4 on TMS320C6655 device.   Set A can also be built with MS visual Studio 2015 (VC14++ compiler).
    • Set B is an add-on to Set A, which is developed recently with MS visual Studio 2015 (VC14++ compiler). Both Set A and Set B can be built and run with MS visual Studio 2015 (VC14++ compiler). 

    When I tried to build Set A+B with TIC6000 v8.0.4,quite a few standard vc14++ headers are not supported by CGT v8.0.4, for example <typeindex> standard header, <random> standard header. By reading the suggested link you mentioned in your post, I now understand that v8.0.4 was never intended to support C++14, TIC6000 v8.3.x will have a better support to vc14++

    After I upgraded to TIC6000 v8.3.0, I found that some of the codes in Set A can not be built anymore. The compiler stopped in Set A without going to St B.

    My question is that, if set A can be built with TIC6000  v8.0.4, will there be an issue when being built with TIC6000 v8.3.0?

    Best regards

    Haifeng

  • Haifeng Xiao said:
    if set A can be built with TIC6000  v8.0.4, will there be an issue when being built with TIC6000 v8.3.0?

    I presume you propose to build set A with version 8.04, and set B with version 8.3.0, then link them all together with the version 8.3.0 linker.  While that might work, I advise against it.  You should be able to build everything with version 8.3.0.  

    Haifeng Xiao said:
    After I upgraded to TIC6000 v8.3.0, I found that some of the codes in Set A can not be built anymore.

    For one of the source files which demonstrate this problem, please submit a test case as described in the article How to Submit a Compiler Test Case.

    Thanks and regards,

    -George

  • Dear George,

    Thanks for your advice. I am submitting one of the source files which demonstrate the problem I mentioned in my previous post. 

    • Exponentiation.pp is in Set A, which has no problem when build with v8.0.4. After I upgrade to v8.3.0, the compiler stopped here. 

    Exponentiation.pp.txt

    • Compiler Version: TI v8.3.0
    • Compiler Options Used: 


    **** Build of configuration Debug for project Lib_NG_VisionCore ****

    "C:\\ti\\ccsv6\\utils\\bin\\gmake" -j 8 all
    'Building file: C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Exponentiation.cpp'
    'Building file: C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Line.cpp'
    'Building file: C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/EdgeFunctions.cpp'
    'Building file: C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/Focus.cpp'
    'Building file: C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/FullPyramidImageOperations.cpp'
    'Building file: C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/GrayImageWithHeap.cpp'
    'Building file: C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/GrayPyramidWithHeap.cpp'
    'Building file: C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/Image.cpp'
    'Invoking: C6000 Compiler'
    'Invoking: C6000 Compiler'
    'Invoking: C6000 Compiler'
    'Invoking: C6000 Compiler'
    'Invoking: C6000 Compiler'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/bin/cl6x" -mv6600 --abi=eabi --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/include" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Source" --define=BIOS --define=SYSBIOS --define=_DEBUG -g --preproc_with_comment --preproc_with_compile --diag_warning=225 --diag_wrap=off --display_error_number --obj_directory="Math" "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Exponentiation.cpp"
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/bin/cl6x" -mv6600 --abi=eabi --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/include" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Source" --define=BIOS --define=SYSBIOS --define=_DEBUG -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="Math/Line.pp" --obj_directory="Math" "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Line.cpp"
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/bin/cl6x" -mv6600 --abi=eabi --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/include" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Source" --define=BIOS --define=SYSBIOS --define=_DEBUG -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="ImageProcessing/EdgeFunctions.pp" --obj_directory="ImageProcessing" "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/EdgeFunctions.cpp"
    "C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/bin/cl6x" -mv6600 --abi=eabi --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/include" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Source" --define=BIOS --define=SYSBIOS --define=_DEBUG -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="ImageProcessing/Focus.pp" --obj_directory="ImageProcessing" "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/Focus.cpp"
    "C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/bin/cl6x" -mv6600 --abi=eabi --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/include" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Source" --define=BIOS --define=SYSBIOS --define=_DEBUG -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="ImageProcessing/FullPyramidImageOperations.pp" --obj_directory="ImageProcessing" "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/FullPyramidImageOperations.cpp"
    "C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/bin/cl6x" -mv6600 --abi=eabi --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/include" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Source" --define=BIOS --define=SYSBIOS --define=_DEBUG -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="ImageProcessing/GrayImageWithHeap.pp" --obj_directory="ImageProcessing" "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/GrayImageWithHeap.cpp"
    "C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/bin/cl6x" -mv6600 --abi=eabi --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/include" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Source" --define=BIOS --define=SYSBIOS --define=_DEBUG -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="ImageProcessing/GrayPyramidWithHeap.pp" --obj_directory="ImageProcessing" "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/GrayPyramidWithHeap.cpp"
    "C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/bin/cl6x" -mv6600 --abi=eabi --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.3.0/include" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components" --include_path="C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Source" --define=BIOS --define=SYSBIOS --define=_DEBUG -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="ImageProcessing/Image.pp" --obj_directory="ImageProcessing" "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/Image.cpp"
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Exponentiation.cpp", line 42: error #20: identifier "INT_MAX" is undefined
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Exponentiation.cpp", line 50: error #20: identifier "INT_MIN" is undefined
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Exponentiation.cpp", line 50: error #20: identifier "INT_MAX" is undefined
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Exponentiation.cpp", line 56: error #20: identifier "INT_MIN" is undefined
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Exponentiation.cpp", line 56: error #20: identifier "INT_MAX" is undefined
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Exponentiation.cpp", line 75: error #20: identifier "INT_MIN" is undefined
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Exponentiation.cpp", line 75: error #20: identifier "INT_MAX" is undefined
    7 errors detected in the compilation of "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Exponentiation.cpp".

    >> Compilation failure
    gmake: *** [Math/Exponentiation.obj] Error 1
    gmake: *** Waiting for unfinished jobs....
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Line.cpp", line 502: error #20: identifier "INT_MAX" is undefined
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Line.cpp", line 502: error #20: identifier "INT_MAX" is undefined
    2 errors detected in the compilation of "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/Math/Line.cpp".

    >> Compilation failure
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/Image.cpp", line 545: error #136: namespace "std" has no member "floor"
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/Image.cpp", line 546: error #136: namespace "std" has no member "ceil"
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/Image.cpp", line 547: error #136: namespace "std" has no member "floor"
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/Image.cpp", line 548: error #136: namespace "std" has no member "ceil"
    gmake: *** [Math/Line.obj] Error 1
    4 errors detected in the compilation of "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/Image.cpp".
    "C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/FullPyramidImageOperations.cpp", line 130: warning #179-D: variable "hm1" was declared but never referenced

    >> Compilation failure
    gmake: *** [ImageProcessing/Image.obj] Error 1
    'Finished building: C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/GrayImageWithHeap.cpp'
    'Finished building: C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/EdgeFunctions.cpp'
    ' '
    ' '
    'Finished building: C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/Focus.cpp'
    ' '
    'Finished building: C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/GrayPyramidWithHeap.cpp'
    ' '
    'Finished building: C:/XHF/Machine_Learning_Algorithm/novalis_TinyDNN/Software/Firmware/Components/VisionCore/ImageProcessing/FullPyramidImageOperations.cpp'
    ' '

    **** Build Finished ****

  • Thank you the test case.  I can reproduce the error where INT_MAX is not defined.  Unfortunately, I cannot answer the question about why INT_MAX is undefined.  I hesitate to say it is because you failed to include <climits> .  If that were the case, it would have failed with version 8.0.4.  But it worked.  Something else is going on.

    I'd appreciate if you would submit some more files.  Build the file Exponentiation.cpp with version 8.0.4, using an additional option: --gen_preprocessor_listing.  This creates a file named Exponentiation.rl.  Copy that file to another file named e804.rl.  Repeat these steps with version 8.3.0, but name the final file e830.rl.  Put those two .rl files in a zip file and attach it to your next post.  Inspecting these two .rl files should help me explain what happened.  To understand why, please read about the option --gen_preprocessor_listing in the C6000 compiler manual.

    Thanks and regards,

    -George

  • Hi George,

    Thanks for your response. I attached the Math.zip file with this post, which includes e804.rl and e830.rl. 

    I am looking forwards to hearing from you soon. Thanks.

    Best regards

    HaifengMath.zip

  • The problem is your code presumes the C++ standard header file <limits> provides the definition of INT_MAX and similar macros.  This is not a requirement of the C++ standard.  It is often the case that the implementation of <limits> uses the INT_MAX macro from <climits> or <limits.h>.  But your code should not depend on that implementation detail.  

    The following C++ example demonstrates the issue ...

    #include <limits>
    
    #ifdef INT_MAX
    // This warning is seen with versions prior to 8.3.0
    #warning INT_MAX is defined
    #else
    // This warning is seen with versions 8.3.0 and later
    #warning INT_MAX is not defined
    #endif

    Compile that with version 8.0.3 and 8.3.0, and you'll see the difference.

    The mistaken presumption that <limits> defines INT_MAX is probably unintentional.

    The solution is your code, prior to using INT_MAX and similar macros, should #include <climits> .

    Thanks and regards,

    -George

  • Hi, George,

    Thanks for pointing out this issue.

    I fixed this issue by including <climits> when using INT_MAX and similar macros, and also fix one other issue (no definition of ceiling, flooring..) by including <cmath>.

    Now the v8.3.0 compiler can go through Set A code, get to the Set B code. The compiler stop at Set B with the error:
    "Description Resource Path Location Type
    #1965 cannot open source file "future" .ccsproject /Lib_NG_VisionCore line 31, external location: C:\XHF\Machine_Learning_Algorithm\novalis_TinyDNN\Software\Firmware\Components\tiny_dnn\util\parallel_for.h C/C++ Problem
    "

    Can you help with this? Thanks.

    Best regards
    Haifeng
  • It appears the source file parallel_for.h includes a file named future.  Neither of those file names are part of the standard include files.  So, there is probably some problem with your source code.  Some ideas to consider ...

    Build with --verbose_diagnostics.  Then look at the diagnostics in the Console view, not the problems view.  The compiler emits the problem source line, with a marker on where the problem begins.  It might help.

    Build with --gen_preprocessor_listing (described earlier).  This helps you diagnose errors that occur during the preprocessing part of compilation.

    Thanks and regards,

    -George

  • Hi, George,

    Thanks for your suggestion. 

    parallel_for.h is the code within Set B, so it is not a standard include files.

    As to <future>, I can see that it is included as standard header in Microsoft Visual Studio 2015 VC++14, but it is not included in TI C6000 v8.3.0.

    Currently out implementation of parallel_for.h use <future>, do you know if TI will support <future> or not? Or can TI can provide an alternative way as what MS2015 VC++14 does?

    Thanks

    Best regards

    Haifeng

  • Haifeng Xiao said:
    do you know if TI will support <future> or not?

    <future> is not supported.  At this time, there are no plans to support it.

    Haifeng Xiao said:
    Or can TI can provide an alternative way as what MS2015 VC++14 does?

    I am not an expert in this area.  You can probably solve a similar problem using features in the Processor SDK for C665x processors.  But those features are not provided using the C++ <future> interface.

    Thanks and regards,

    -George