User and Reference Guide for the Intel® C++ Compiler 14.0

Modifying Your makefile

If you use makefiles to build your Microsoft application, you need to change the value for the compiler variable to use the Intel compiler. You may also want to review the options specified by CPPFLAGS. A simple example follows:

Microsoft makefile

# name of the program PROGRAM = area.exe
# names of source files
CPPSOURCES = area_main.cpp area_functions.cpp
# names of object files
CPPOBJECTS = area_main.obj area_functions.obj
# Microsoft Compiler options
CPPFLAGS = /RTC1 /EHsc 
# Use the Microsoft C++ Compiler
CPP = cl
# link objects
$(PROGRAM): $(CPPOBJECTS)
     link.exe /out:$@ $(CPPOBJECTS)
# build objects
area_main.obj: area_main.cpp area_headers.h
area_functions.obj: area_functions.cpp area_headers.h
# clean
clean:
     del  $(CPPOBJECTS) $(PROGRAM)

Modified makefile for Intel Compiler

Before you can run nmake with the Intel compiler, you need to set the proper environment. In this example, only the name of the compiler changed:

# name of the program
PROGRAM = area.exe
# names of source files
CPPSOURCES = area_main.cpp area_functions.cpp
# names of object files
CPPOBJECTS = area_main.obj area_functions.obj
# Intel® C++ Compiler options
CPPFLAGS = /RTC1 /EHsc 
# Use the Intel® C++ Compiler
CPP = icl
# link objects
$(PROGRAM): $(CPPOBJECTS)
     link.exe
 /out:$@ $(CPPOBJECTS)
# build objects
area_main.obj: area_main.cpp area_headers.h
area_functions.obj: area_functions.cpp area_headers.h
# clean
clean:
     del
$(CPPOBJECTS) $(PROGRAM)

With the modified makefile, the output of nmake is similar to the following:

Microsoft ® Program Maintenance Utility Version 8.00.50727.42 
Copyright (C) Microsoft Corporation. All rights reserved.

        icl /RTC1 /EHsc  /c area_main.cpp area_functions.cpp 

Intel® C++ Compiler for applications running on IA-32 
Copyright (C) 1985-2006 Intel Corporation. All rights reserved. 

area_main.cpp 
area_functions.cpp
        link.exe /out:area.exe area_main.obj area_functions.obj 

Microsoft ® Incremental Linker Version 8.00.50727.42 
Copyright (C) Microsoft Corporation. All rights reserved.

Submit feedback on this help topic