Developer Guide and Reference

Contents

Modifying Your makefile

If you use makefiles to build your gcc* application, you need to change the value for the
GCC
compiler variable to use the Intel® C++ Compiler. You may also want to review the options specified by
CFLAGS
. For example:

Sample gcc* makefile
# Use gcc compiler CC = gcc # Compile-time flags CFLAGS = -O2 -std=c99 all: area_app area_app: area_main.o area_functions.o     $(CC) area_main.o area_functions.o -o area area_main.o: area_main.c     $(CC) -c $(CFLAGS) area_main.c area_functions.o: area_functions.c     $(CC) -c -fno-asm $(CFLAGS) area_functions.c clean: rm -rf *o area
Sample makefile modified for the Intel® C/C++ Compiler
# Use Intel C Compiler CC = icc # Compile-time flags CFLAGS = -std=c99 all: area_app area_app: area_main.o area_functions.o     $(CC) area_main.o area_functions.o -o area area_main.o: area_main.c     $(CC) -c $(CFLAGS) area_main.c area_functions.o: area_functions.c     $(CC) -c -fno-asm $(CFLAGS) area_functions.c clean: rm -rf *o area
If your gcc* code includes features that are not supported with the Intel® C++ Compiler (compiler options, language extensions, macros, pragmas, and so on), you can compile those sources separately with gcc* if necessary.
In the above makefile,
area_functions.c
is an example of a source file that includes features unique to gcc*. Because the Intel® C++ Compiler uses the
O2
option by default and gcc* uses option
O0
as the default, we instruct gcc* to compile at option
O2
. We also include the
-fno-asm
switch from the original makefile because this switch is not supported with the Intel® C++ Compiler.
Sample makefile modified for using the Intel® C/C++ Compiler a