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/AM5726: CL6x compilation error

Part Number: AM5726


Tool/software: TI C/C++ Compiler

Hi all,

I was trying to compile the example source on our side with cl6x compiler included within SDK6 for Linux. While building a source file it gives only compilation error without detail. Literally it prints.

>> Compilation failure

That's it! No other outputs and etc. I appreciate if you can make any suggestion to make the compiler give more elaborate output for the failure. 

Kind Regards,

Mustafa

  • mustafa.gonul said:
    I was trying to compile the example source on our side with cl6x compiler included within SDK6 for Linux.

    Are you building from a command line or makefile or CCS? Could you show a screenshot of the entire compile command and output seen in whichever method you are using to build?

    What are the options passed to the compiler? Try adding the --verbose option to the compiler, that should print out more detailed progress information. 

  • Hi,

    Thanks for your patience, I could not respond in a short notice. 

    I divide and conquer by commenting the code (it is a huge file) to find where is the problem. The problem is I could not write and build variadic functions. I have also created example project derived from printf_debug which included in the SDK examples. 

    variadic_main.cpp

    #include <cstdio>
    
    extern "C" {
        extern int add_nums(int count, ...);
    }
    
    int main(int argc, char *argv[])
    {
        int total = add_nums(4, 1, 2, 3, 4);
    
        printf("total: %d\n", total);
    
        return 0;
    }

    variadic_target.c

    #pragma omp declare target
    #include <omp.h>
    #include <stdarg.h>
    #pragma omp end declare target
    
    int add_nums(int count, ...)
    {
        int result = 0;
        int i = 0;
    
        va_list args;
        va_start(args, count);
    
        for (i = 0; i < count; ++i) {
            result += va_arg(args, int);
        }
        va_end(args);
    
        return result;
    }
    
    

    I am building the example with Makefile not CCS. For this example I simply use the same Makefile used for printf_debug.

    include ../make.inc
    
    OA_TC_OPTS 			= -O3
    ifeq ($(VERBOSE),1)
    OA_HC_OPTS 			= -O3 -Wall -Wextra -fopenmp
    OA_SHELL_OPTS 		= -v -k --hc="$(OA_HC_OPTS)" --tc="$(OA_TC_OPTS)"
    else
    OA_HC_OPTS 			= -O3 -fopenmp
    OA_SHELL_OPTS 		= --hc="$(OA_HC_OPTS)" --tc="$(OA_TC_OPTS)"
    endif
    CXX_OPTS 			= -O3
    
    EXE     	= variadic
    HOST_CODE 	= variadic_main.cpp
    TARGET_CODE = variadic_target.c
    OBJS 		= $(patsubst %.cpp,%.o,$(HOST_CODE))
    
    $(EXE): $(OBJS)
    	$(OA_SHELL) $(OA_SHELL_OPTS) $(OBJS) $(TARGET_CODE) -o $@
    
    %.o: %.cpp
    	$(CXX) $(CXX_OPTS) -c $<
    
    clean:
    	@rm -f $(EXE) $(OA_SHELL_TMP_FILES) *.log
    

    You can see the output below:

    **** Build of configuration Default for project variadic ****
    
    make VERBOSE=1 -k 
     
    arm-linux-gnueabihf-g++ -O3 -c variadic_main.cpp
    clacc -v -k --hc="-O3 -Wall -Wextra -fopenmp" --tc="-O3" variadic_main.o variadic_target.c -o variadic
    >> DEBUG: Extra host compiler options: -O3 -Wall -Wextra -fopenmp
    >> DEBUG: Extra target compiler options: -O3
    >> DEBUG: Executable binary name: variadic
    >> DEBUG: Input files: variadic_main.o variadic_target.c 
    >> DEBUG: ARM object file or archive: variadic_main.o
    >> DEBUG: Source code file: variadic_target.c
    >> DEBUG: Using /home/mv/ti-processor-sdk-linux-rt-am57xx-evm-06.00.00.07/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-gcc for HOST compilation.
    >> DEBUG: Using /home/mv/ti-processor-sdk-linux-rt-am57xx-evm-06.00.00.07/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-g++ for HOST compilation.
    >> DEBUG: Using /home/mv/ti-processor-sdk-linux-rt-am57xx-evm-06.00.00.07/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/cl6x for TARGET compilation.
    >> DEBUG: Using /home/mv/ti-processor-sdk-linux-rt-am57xx-evm-06.00.00.07/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/cl6x for S2S compilation.
    >> DEBUG: Using /home/mv/ti-processor-sdk-linux-rt-am57xx-evm-06.00.00.07/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/clocl for TARGET compilation.
    cl6x --preinclude=/tmp/gcc_predefMbh6WP --openmp:host -pds=1173 -I/home/mv/ti-processor-sdk-linux-rt-am57xx-evm-06.00.00.07/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi/usr/include -O3 -I/home/mv/ti-processor-sdk-linux-rt-am57xx-evm-06.00.00.07/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/include -I/home/mv/ti-processor-sdk-linux-rt-am57xx-evm-06.00.00.07/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/include-fixed -I/home/mv/ti-processor-sdk-linux-rt-am57xx-evm-06.00.00.07/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/include -I/home/mv/ti-processor-sdk-linux-rt-am57xx-evm-06.00.00.07/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../arm-linux-gnueabihf/libc/usr/include variadic_target.c 
     
    >> Compilation failure
    >> ERROR: Failed to compile target code.
    "variadic_target.c", line 13: warning: function "__builtin_va_start" declared implicitly
    "variadic_target.c", line 13: warning: variable "args" is used before its value is set
    "variadic_target.c", line 16: warning: function "__builtin_va_arg" declared implicitly
    "variadic_target.c", line 16: error: expected an expression
    "variadic_target.c", line 18: warning: function "__builtin_va_end" declared implicitly
    1 error detected in the compilation of "variadic_target.c".
    make: *** [Makefile:46: variadic] Error 1
    
    **** Build Finished ****
    

    I appreciate if you can help me regarding the issue.

    Kind Regards,

    Mustafa

  • Thank you for the test case.  Especially since ...

    mustafa.gonul said:
    I divide and conquer by commenting the code (it is a huge file) to find where is the problem.

    I'm sure that was a lot of work!  I can reproduce the problem.  I filed the entry CODEGEN-6673 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • Hi,

    I would like to ask if there will be a new SDK release or patch release? I am not familiar with the procedure.

    I appreciate if you can give further information regarding the procedure.

    Kind regards,

    Mustafa

  • Use the Alert Me feature on the AM57x Processor SDK download page.

    Thanks and regards,

    -George