System Studio 2013 build error, for Inspector static-analysis

System Studio 2013 build error, for Inspector static-analysis

eric s.'s picture

Have a project originally built with gcc/gnu tools, targeting Atom 6xx series.

Now importing to System Studio 2013.

Existing make files were edited to switch over to icc. All compiled ok.

Then added static analyzer (for Inspector) via CFLAGS, as,

  -diag-enable sc-precise

to each of the corresponding sub-module make files.

This resulted in following error during build, for one sub-module (called SMBus):

cd ../SMBus; make debug_menu;
make[2]: Entering directory `/home/eric/Projects/PTL/branches/PhaseII_Debug/Code/PTL/SMBus'
make clean;
make[3]: Entering directory `/home/eric/Projects/PTL/branches/PhaseII_Debug/Code/PTL/SMBus'
rm -f *.o *~ core SmBusTest SmBusQTest
make[3]: Leaving directory `/home/eric/Projects/PTL/branches/PhaseII_Debug/Code/PTL/SMBus'
make;
make[3]: Entering directory `/home/eric/Projects/PTL/branches/PhaseII_Debug/Code/PTL/SMBus'
cc -ggdb -m32 -Wall -Wno-unused-but-set-variable -I. -I../include -I../Tasking -I../Debug -diag-enable sc-precise  -DPTL_BOARD -DDEBUG    -c -o SmBusTest.o SmBusTest.c
cc: sc-precise: No such file or directory
cc1: warning: unrecognized gcc debugging option: i
cc1: warning: unrecognized gcc debugging option: g
cc1: warning: unrecognized gcc debugging option: -
cc1: warning: unrecognized gcc debugging option: e
cc1: warning: unrecognized gcc debugging option: n
cc1: warning: unrecognized gcc debugging option: b
cc1: warning: unrecognized gcc debugging option: l
cc1: warning: unrecognized gcc debugging option: e
make[3]: *** [SmBusTest.o] Error 1
make[3]: Leaving directory `/home/eric/Projects/PTL/branches/PhaseII_Debug/Code/PTL/SMBus'
make[2]: *** [debug_menu] Error 2
make[2]: Leaving directory `/home/eric/Projects/PTL/branches/PhaseII_Debug/Code/PTL/SMBus'
make[1]: *** [PTL_DebugMenu] Error 2
make[1]: Leaving directory `/home/eric/Projects/PTL/branches/PhaseII_Debug/Code/PTL/DebugMenu'
make: *** [PTL_DebugMenu] Error 2
-------------------

When the static analyzer string is removed from the makefile from the module called SMBus, but leave everything else unchanged, the build completes. However, in this case, was expecting a .diag file to be generated (per documentation) but none appears in the project folder (that I can find anyways).

Comparing the various makefiles, I don't see any differences that would explain why this modules make fails but the others compiled earlier in the build didn't generate an error. Also tried changing the sc to just 1 (--diag-enable sc1), resulting in the same type of error, this time for sc1 not valid.

Hope someone can offer some guidance. What other info would help figure this out?

Thank you.

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
eric s.'s picture

uploading makefile for the failing module. had to add .txt to get past gatekeeper...

Attachments: 

AttachmentSize
Download Makefile.txt1.51 KB
yang-wang (Intel)'s picture

According to the error output, SmBusTest.c is built with gcc, not icc. gcc reports the error for the static analyze options since static check is a feature of icc compiler only. You may go to folder `/home/eric/Projects/PTL/branches/PhaseII_Debug/Code/PTL/SMBus' and check the Makefile option for the file SmBusTest.c.

thanks.

-Yang

eric s.'s picture

Hi Yang, 

Thank you for the rapid response.

I did notice that but forgot to point out in my post - I can't explain why gcc was used.

In the module source folder, there is one Makefile, and all gcc's in that file have been changed to icc. Doing a text search inside that file verifies no gcc strings remain.

Still puzzled.

(The Makefile I attached is the one from that folder. )

Thanks again.

ES.

yang-wang (Intel)'s picture

Hi Eric,
     In your Makefile, it looks like you need to move the "make;" to the bottom of the file.

debug_menu:
    make clean;
    make;
    icc -c $(CFLAGS) $(SYSLIBS) -DDEBUG_MENU -o SmBusTest.o SmBusTest.c
    icc -c $(CFLAGS) $(SYSLIBS) -DDEBUG_MENU -o SmBusQTest.o SmBusQTest.c
change to
   debug_menu:    
       make clean;
        icc -c $(CFLAGS) $(SYSLIBS) -DDEBUG_MENU -o SmBusTest.o SmBusTest.c    
        icc -c $(CFLAGS) $(SYSLIBS) -DDEBUG_MENU -o SmBusQTest.o SmBusQTest.c
       make;

Otherwise in your Makefile, when the "make;" is invoked, it will generate the SmBusTest.o and SmBusQTest.o first, then to generate the SmBusTest. When it compiles the SmBusTest.c to SmBusTest.o, there is no rule defined in this Makefile. It will call the $CC envorinment varaible to compile the .o file, which will use the default gcc compiler. That's why you see the error.
    You may change your Makefile to add rule for the .o files. This might be the best solution.

thanks.

-Yang

Login to leave a comment.