APU C Compiler and APU C++ Compiler

The APU C Compiler and APU C++ Compiler pages display the build configuration settings that apply to the compiler tool.

Table 1. APU C Compiler/APU C++ Compiler
Option Description
Command Command that will be used by Vision Extension Package to run the compiler.

Default: ${apu_compiler}

All options Expanded command line options the compiler will be called with.

Shows actual values of variables and options according to Command line pattern.

Default (application project):

-DCGV_FORCE_INLINE -DACF_KERNEL_IMPLEMENTATION

-I"<project_dir>/APU_kernels"

-I"<VSDK_dir>/include"

-I"<VSDK_dir>/kernels/apu"

-I"<VSDK_dir>/libs/apex/common/include"

-I"<VSDK_dir>/libs/apex/icp/include"

-I"<VSDK_dir>/libs/apex/acf_offline/include"

-I"<VSDK_dir>/libs/apex/drivers/user/include"

-I"<VSDK_dir>/libs/apex/register_maps/include"

-I"<VSDK_dir>/libs/apex/acf/include"

-I"<VSDK_dir>/libs/apex/acf_target/include"

-I"<VSDK_dir>/libs/utils/common/include"

-include"<VSDK_dir>/libs/apex/acf_offline/include/apu2_kernel_port.h"

-include"<VSDK_dir>/libs/apex/acf_target/include/acf_autokernel_inc.h"

-O3 -g3 -Wall -c -fmessage-length=0 -target apex

Default (library project): -I"<project_dir>/include" -O0 -g3 -Wall -c -fmessage-length=0 -target apex

Command line pattern Command line to call the compiler.

Default: ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}

Dialect

The Dialect page allows you to configure the compiler to verify your code against the specific standard of C or C++ language when compiling your application or library project.

The following table describes the options available on the Dialect page.

Table 2. APU C Compiler/APU C++ Compiler: Dialect
Option Description
Language standard Standard of C (for APU C Compiler) and C++ (for APU C++ Compiler) language.

The compiler can accept several base standards, such as ‘c90’ or ‘c++98’. When a base standard is specified, the compiler accepts all programs following that standard plus those using GNU extensions that do not contradict it.

Following options are available for APU C Compiler:
  • ISO C90 / ANSI C89 (-std=c90)

    Supports all ISO C90 programs (certain GNU extensions that conflict with ISO C90 are disabled). Select to compile code written in ANSI standard C. The compiler does not enforce strict standards. For example, code can contain some minor extensions, such as C++ style comments (//), and $ characters in identifiers.

  • ISO C99 (-std=c99)

    Instructs the compiler to enforce stricter adherence to the ANSI/ISO standard. This standard is substantially completely supported, modulo bugs and floating-point issues (mainly but not entirely relating to optional C99 features from Annexes F and G).

  • ISO C11 (-std=c11)

    This is the 2011 revision of the ISO C standard. This standard is substantially completely supported, modulo bugs, floating-point issues (mainly but not entirely relating to optional C11 features from Annexes F and G) and the optional Annexes K (Bounds-checking interfaces) and L (Analyzability).

Following options are available for APU C++ Compiler:
  • ISO C++98 (-std=c++98)

    The 1998 ISO C++ standard plus the 2003 technical corrigendum and some additional defect reports. Same as -ansi for C++ code.

  • ISO C++11 (-std=c++11)

    The 2011 ISO C++ standard plus amendments

  • ISO C++1y (-std=c++1y)

    The 2014 ISO C++ standard plus amendments.

Other dialect flag Additional command line options.

Allows you to specify dialect flags not available on this page.

By default, this field is empty.

Preprocessor

The Preprocessor page allows you to configure the C or C++ preprocessor, which is run on each source file before actual compilation.

The following table describes the options available on the Preprocessor page.

Table 3. APU C Compiler/APU C++ Compiler:Preprocessor
Option Description
Do not search system directories (-nostdinc) Skip standard system locations of header files.

Select the check box if you do not want the compiler to search the system locations for header files. Only the locations specified on the Includes page will be used to search for the header files. If this check box is not selected, the compiler performs a full search that includes the system locations.

By default, this check box is cleared.
Preprocess only (-E) Select the check box if you only want to preprocess source files without running the compiler. Nothing is done except preprocessing.
Attention: Selecting this will cause a linker error when you build the project. This is because linker expects an object file to be available. However, because no compilation is done when this option is enabled, compiler does not create an object file.
By default, this check box is cleared.
Defined symbols (-D) Predefine name as a macro.

Allows you to specify the substitution strings that the compiler applies to all the assembly-language modules in the build target. Enter just the string portion of a substitution string. The Vision Extension Package prepends the -D token to each string that you enter. For example, entering opt1 x produces this result on the command line: -Dopt1 x.

This option is similar to the #define directive, but applies to all assembly-language modules in a build target.

Note: Added names are processed in the top-down order.

Default for application project: CGV_FORCE_INLINE

ACF_KERNEL_IMPLEMENTATION

Default for library project: this field is empty.

Undefined symbols (-U) Remove definition for a previously defined name.

Allows you to cancel any previous definition of name, either built-in or provided with a -D option.

By default this list is empty.

Includes

The Includes page allows you to specify locations where the compiler should look for the included files during the compilation process.

The following table describes the options available on the Includes page.

Table 4. APU C Compiler/APU C++ Compiler: Includes
Option Description
Include paths (-I) This option adds the directory to the list of directories to be searched for header files. Directories named by -I are searched before the standard system include directories. If the directory is a standard system include directory, the option is ignored to ensure that the default search order for system directories and the special treatment of system headers are not defeated.

This option changes the build target's search order of access paths to start with the system paths list. The compiler can search #include files in several different ways. You can also set the search order as follows:

  • For include statements of the form #include"xyz", the compiler first searches user paths, then the system paths.
  • For include statements of the form #include<xyz>, the compiler searches only system paths. This option is global.

Default for application project: "${ProjDirPath}/APU_kernels"

"${VSDK_APU_1.3.0_PATH}/include"

"${VSDK_APU_1.3.0_PATH}/kernels/apu"

"${VSDK_APU_1.3.0_PATH}/libs/apex/common/include"

"${VSDK_APU_1.3.0_PATH}/libs/apex/icp/include"

"${VSDK_APU_1.3.0_PATH}/libs/apex/acf_offline/include"

"${VSDK_APU_1.3.0_PATH}/libs/apex/drivers/user/include"

"${VSDK_APU_1.3.0_PATH}/libs/apex/register_maps/include"

"${VSDK_APU_1.3.0_PATH}/libs/apex/acf/include"

"${VSDK_APU_1.3.0_PATH}/libs/apex/acf_target/include"

"${VSDK_APU_1.3.0_PATH}/libs/utils/common/include"

Default for library project: "${ProjDirPath}/include"

Include files (-include) Use this option to specify the include file search path. Process file as if #include "file" appeared as the first line of the primary source file. However, the first directory searched for file is the preprocessor's working directory instead of the directory containing the main source file. If not found there, it is searched for in the remainder of the #include "..." search chain as normal.

If multiple -include options are given, the files are included in the order they appear on the command line.

By default there are the following files:

"${VSDK_APU_1.3.0_PATH}/libs/apex/acf_offline/include/apu2_kernel_port.h

"${VSDK_APU_1.3.0_PATH}/libs/apex/acf_target/include/acf_autokernel_inc.h

Optimization

The Optimization page allows you to configure optimizations run by the compiler during the compilation of your application or library project. Compiler optimization can be applied in either global or non-global optimization mode. You can apply global optimization at the end of the development cycle, after compiling and optimizing all source files individually or in groups.

The following table describes the options available on the Optimization page.

Table 5. APU C Compiler/APU C++ Compiler: Optimization
Option Description
Optimization level Specify the optimizations that you want the C/C++ compiler to apply to the generated object code:
  • None (-O0)

    Disable optimizations. This setting is equivalent to specifying the -O0 command-line option. The compiler generates unoptimized, linear assemblylanguage code, reduce compilation time.

  • Optimize (-O1)

    The compiler performs all target-independent (that is, non-parallelized) optimizations, such as function inlining. Optimizing compilation takes somewhat more time, and a lot more memory for a large function. This setting is equivalent to specifying the -O1 command-line option. The compiler omits all target-specific optimizations and generates linear assembly-language code.

  • Optimize more (-O2)

    The compiler performs nearly all supported optimizations (both target-independent and target-specific) that do not involve a space-speed tradeoff. As compared to -O, this option increases both compilation time and the performance of the generated code. This setting is equivalent to specifying the -O2 command line option. The compiler outputs optimized, non-linear, parallelized assembly-language code.

  • Optimize all, for speed (-O3)

    The compiler performs all the level 2 optimizations, then the low-level optimizer performs global-algorithm register allocation. This setting is equivalent to specifying the -O3 command-line option. At this optimization level, the compiler generates code that is usually faster than the code generated from level 2 optimizations.

  • Optimize for size (-Os)

    The compiler performs further optimizations designed to reduce code size. -Os enables all -O2 optimizations that do not typically increase code size. The resulting binary file has a smaller executable code size, as opposed to a faster execution speed. This setting is equivalent to specifying the -Os command-line option.

  • Optimize for size more (-Oz)

    The compiler reduces code size, this results in more reduced image size, when compared to -Os, and also reduces the information available for debugging. Using this option is likely to make your code slower than -Os. This setting is equivalent to specifying the -Oz command-line option.

Default for application project: Optimize all, for speed (-O3)

Default for library project: None (-O0)

Other optimization flags Additional command line options.

Allows you to specify optimization flags not available on this page.

By default, this field is empty.

Debugging

The Debugging page allows you to configure debugging parameters used by the compiler during the compilation of your project. The specified parameters affect the debugging information that will be available in the resulting build target.

The following table describes the options available on the Debugging page.

Table 6. APU C Compiler/APU C++ Compiler: Debugging
Option Description
Debug Level Specify the debug levels:
  • None

    Level 0. Disables output of debug information to the build artifact.

  • Minimal (-g1)

    Level 1. Output minimal information, enough for making backtraces in parts of the program that you don't plan to debug. This includes descriptions of functions and external variables, and line number tables, but no information about local variables.

  • Default (-g)

    Level 2. The compiler generates DWARF 1.x conforming debugging information.

  • Maximum (-g3)

    Level 3. Output extra information, such as all the macro definitions present in the program. So the compiler provides maximum debugging support.

Default: Maximum (-g3)

Other debugging flags Additional command line options.

Allows you to specify debugging flags not available on this page.

By default, this field is empty.

Warnings

The Warnings page allows you to configure warning parameters used by the compiler to display warning messages during the compilation of your project. These parameters allow you to specify what types of warning messages your would like to see in the console when compiling your project.

The following table describes the options available on the Warnings page.

Table 7. APU C Compiler/APU C++ Compiler: Warnings
Option Description
Check syntax only

(-fsyntax-only)

Check the code for syntax errors, but do not do anything beyond that.

By default, this check box is cleared.

Pedantic (-pedantic) Output warnings demanded by strict ISO C and ISO C++.

Reject all programs that use forbidden extensions, and some other programs that do not follow ISO C and ISO C++. For ISO C, follows the version of the ISO C standard specified by any -std option used.

By default, this check box is cleared.

Pedantic warnings as errors (- pedantic-errors) Like pedantic, except that errors are produced rather than warnings.

By default, this field is cleared.

Inhibit all warnings (-w) Enable all the warnings about constructions that some users consider questionable, and that are easy to avoid (or modify to prevent the warning), even in conjunction with macros.

By default, this field is cleared.

All warnings (-Wall) Enable all the warnings about constructions that some users consider questionable, and that are easy to avoid (or modify to prevent the warning), even in conjunction with macros. This also enables some language-specific warnings.

By default, this check box is selected.

Extra warnings (-Wextra) Enable some extra warning flags that are not enabled by -Wall.

By default, this check box is cleared.

Warnings as errors

(-Werror)

Make all warnings into hard errors. Source code which triggers warnings will be rejected. The specifier for a warning is appended.

By default, this check box is cleared.

Implicit conversions warnings (-Wconversion) Warn for implicit conversions that may alter a value.

This includes conversions between real and integer, like abs (x) when x is double; conversions between signed and unsigned, like unsigned ui = -1; and conversions to smaller types, like sqrtf (M_PI). Do not warn for explicit casts like abs ((int) x) and ui = (unsigned) -1, or if the value is not changed by the conversion like in abs (2.0). Warnings about conversions between signed and unsigned integers can be disabled by using -Wno-sign-conversion.

By default, this check box is cleared.

Miscellaneous

The Miscellaneous page allows you to configure various auxiliary compiler options not otherwise available on other pages in the project properties.

The following table describes the options available on the Miscellaneous page.

Table 8. APU C Compiler/APU C++ Compiler: Miscellaneous
Option Description
Other flags Additional command line options.

Allows you to specify command line options supported by C or C++ compiler and not otherwise available on this page.

Default: -c -fmessage-length=0.

Verbose (-v) Verbose compilation.

Select this check box to enable verbose output during the compilation and make the compiler display detailed information about the exact sequence of commands used to compile your project.

Selecting this check box enables the specified compilers to output progress details, error and warning messages, and informational messages.

By default, this check box is cleared. Vision Extension Package displays only the error messages. Warning messages and other informational messages will not be output to the console.

Support ANSI programs (-ansi) Select this check box if you want the compiler to operate in strict ANSI mode. In this mode, the compiler strictly applies the rules of the ANSI/ISO specification to all input files.
Note: This option is only available for APU C Compiler.

This setting is equivalent to specifying the -ansi command-line option. The compiler issues a warning for each ANSI/ISO extension it finds.

By default, this check box is cleared. The compiler does verify the code to obey the rules of ANSI standard.