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.

Compiler: how to use cppflags



Tool/software: TI C/C++ Compiler

Hi,

i compile TDA4 software

1, in pc mode

i config build_flags.mak as below:

"BUILD_TARGET_MODE?=no

BUILD_EMULATION_MODE?=yes

BUILD_LINUX_A72?=no

PROFILE?=release"

there is a macro "OPENCV_DEBUG" in my programm

so i add "CPPFLAGS    += -DOPENCV_DEBUG" in my concerto.mak

and i works well

2, in tda4 mode

i config build_flags.mak as below:

"BUILD_TARGET_MODE?=yes

BUILD_EMULATION_MODE?=no

BUILD_LINUX_A72?=yes

PROFILE?=release"

there is a macro "OPENCV_DEBUG" in my programm

so i add "CPPFLAGS    += -DOPENCV_DEBUG" in my concerto.mak

but it does not work, it can not find the MACRO "OPENCV_DEBUG"

can you help about this

many thanks

  • Which compiler do you expect the change to take place in when compiling on target?  It has only been implemented so far on the PC Linux, and A72 linux compiler concerto make files.  If you are trying on other core like R5F or DSP, it is not implemented.

    In this case, you can modify the appropriate compiler makefile in the concerto/compilers/ accordingly.  Just look how CPPFLAGS is used in gcc_linux.mak or gcc_linux_arm.mak.

    Regards,

    Jesse

  • my compiler is as below:

    ifeq ($(TARGET_CPU),A72)
    ifeq ($(TARGET_OS),LINUX)

    endif

    endif

    it does not work, i think this is A72 LINUX compiler

    thanks

  • Which release do you have?  In your version, do you see CPPFLAGS in the gcc_linux_arm.mak file?

  • ./apps/ptk_demos/concerto_inc.mak:CPPFLAGS        := --std=c++11
    ./apps/ptk_demos/concerto_inc.mak:CPPFLAGS        += -DPLATFORM_SDL
    ./apps/ptk_demos/concerto_inc.mak:CPPFLAGS        += -DPLATFORM_WAYLAND
    ./kernels/srv/gpu/3dsrv/concerto.mak:CPPFLAGS    += --std=c++11
    ./kernels/srv/gpu/3dsrv/Tools/concerto.mak:CPPFLAGS    += --std=c++11
    ./concerto/compilers/gcc_linux_arm.mak:$(_MODULE)_CPPFLAGS := $(CPPFLAGS)
    ./concerto/compilers/gcc_linux_arm.mak:    $(Q)$(CP) $($(_MODULE)_CFLAGS) $($(_MODULE)_CPPFLAGS) $(call $(_MODULE)_GCC_DEPS,$$*) $$< -o $$@ $(LOGGING)
    ./concerto/compilers/gcc_linux_arm.mak:    $(Q)$(CP) $($(_MODULE)_CFLAGS) $($(_MODULE)_CPPFLAGS) -MMD -MF $(ODIR)/$$*.dep -MT '$(ODIR)/$$*.o' $$< -o $$@ $(LOGGING)
    ./concerto/compilers/gcc_linux.mak:$(_MODULE)_CPPFLAGS := $(CPPFLAGS)
    ./concerto/compilers/gcc_linux.mak:    $(Q)$(CP) $($(_MODULE)_CFLAGS) $($(_MODULE)_CPPFLAGS) $(call $(_MODULE)_GCC_DEPS,$$*) $$< -o $$@ $(LOGGING)
    ./concerto/compilers/gcc_linux.mak:    $(Q)$(CP) $($(_MODULE)_CFLAGS) $($(_MODULE)_CPPFLAGS) -MMD -MF $(ODIR)/$$*.dep -MT '$(ODIR)/$$*.o' $$< -o $$@ $(LOGGING)
    ./concerto/prelude.mak:_MODULE_VARS := ENTRY DEFS CFLAGS CPPFLAGS LDFLAGS STATIC_LIBS SHARED_LIBS SYS_STATIC_LIBS

  • I can't see anything wrong.  It looks to me like it should work.  Can you please share your concerto.mak?

    I assume that you are trying to print something inside of this macro in the program.  Have you confirmed that the print works in TARGET mode even when you don't surround it with #ifdef OPENCV_DEBUG?

    Jesse