Escolar Documentos
Profissional Documentos
Cultura Documentos
White Paper
Intel C++ Compiler for Windows* Compatibility with Versions of Microsoft Visual C++*
Table of Contents
Introduction ............................................................................................................................................................................................................................. 3 Overview.............................................................................................................................................................................................................................. 3 Important Notes .............................................................................................................................................................................................................. 3 General Compatibility ......................................................................................................................................................................................................... 4 Compatibility Options .................................................................................................................................................................................................... 4 Remark, Warning, and Error Diagnostics ............................................................................................................................................................ 4 Microsoft Visual C++* Pragmas Support ........................................................................................................................................................... 4 Differences in Treatment of Inline Assembly Labels .................................................................................................................................. 5 Differences with Macro Expansions ..................................................................................................................................................................... 5 Differences in Precompiled Header (PCH) Support...................................................................................................................................... 5 Differences in the enum type .................................................................................................................................................................................. 5 Scope of Function Defined in a Namespace .................................................................................................................................................... 5 Unsupported Major Language Features ............................................................................................................................................................ 5 Unsupported Preprocessor Features .................................................................................................................................................................. 6 Unsupported Compiler Options ............................................................................................................................................................................... 6 Safe Exception Handling and Security Checks ............................................................................................................................................... 6 Mixing Unmanaged Code Compiled with the Intel C++ Compiler with Managed Code ............................................................ 6 Compatibility in OpenMP* Support........................................................................................................................................................................ 7 User Interface Compatibility .......................................................................................................................................................................................... 9 Integration with Microsoft Visual Studio IDE................................................................................................................................................... 9 New Features of the IDE Integration................................................................................................................................................................10 Debugging Capability .................................................................................................................................................................................................10 Automation Interfaces ..............................................................................................................................................................................................10 Unsupported Visual C++ Project Types...........................................................................................................................................................11 Whole Program Optimization and Interprocedural Optimization .......................................................................................................11 The Intel-64-based Processor and IA-64-based Processor Targeting .........................................................................................12 Note about the Intel C++ Compiler for Intel-64 ........................................................................................................................................12 Note about the Intel C++ Compiler for IA-64 ...............................................................................................................................................12 References ............................................................................................................................................................................................................................13
Intel C++ Compiler for Windows* Compatibility with Versions of Microsoft Visual C++*
White Paper
Introduction
The Intel C++ Compiler 11.0 for Windows* supports the Microsoft* Visual C++* extensions to the C and C++ languages. This document describes the important differences of the Intel C++ Compiler 11.0 and Visual C++ extensions.
Overview
The Intel C++ Compiler is source- and binary- (native code) compatible with the Microsoft* Visual C++* Compiler. It is also well integrated into the following Microsoft development environments: Microsoft Visual C++ .NET 2003, Microsoft Visual C++ 2005, and Microsoft Visual C++ 2008. The Intel C++ Compiler generates optimized code with the advanced features of Intel IA-32 processors, Intel 64 (previously named EM64T), and the Intel IA-64 (previously named Itanium) processors. As a result of its compatibility with the Microsoft Visual C++ Compiler, the Intel C++ Compiler allows the user to take advantage of its performance-enhancement features by selectively rebuilding only the parts of the application deemed to be performance sensitive. If necessary, object files and libraries built with either of the two compilers can be mixed and matched. The Intel C Compiler for Windows conforms to the following standards: ++ 1. ANSI/ISO standard ISO/IEC 9899:1990 for C languageC99 features are mostly supported 2. ANSI/ISO standard ISO/IEC 14882:1998 for C++ language 3. OpenMP* 3.0 API specification
Important Notes
The Intel C++ Compiler for Windows version 11.0 no longer supports Microsoft Visual C++ 6.0. When compiling the program for the IA-32 architecture, /arch:SSE2 (formerly /QxW) is now the default. This means that generated programs require that they be run on a processor that supports the Intel Streaming SIMD Extensions 2 (Intel SSE2), such as the Intel Pentium 4 processor and certain AMD* processors. Use /arch:IA32 if you want the program to run on any processor. This document contains key information in regard to the compatibility between the Intel C++ Compiler and Microsoft Visual C++ .NET 2003, Visual C++ 2005, and Visual C++ 2008.
White Paper
Intel C++ Compiler for Windows* Compatibility with Versions of Microsoft Visual C++*
General Compatibility
Compatibility Options
The following Intel Compiler options provide compatibility with different versions of Microsoft Visual C++: /Qvc7.1 /Qvc8 /Qvc9 Microsoft Visual C++ .NET 2003 Microsoft Visual C++ 2005 Microsoft Visual C++ 2008
If your program is built with both Intel C++ Compiler and Visual C++ Compiler, be sure to set the correct compatibility option when building with Intel C++ Compiler. From the build environment window, the Intel C++ Compiler driver icl.exe will set the corresponding compatibility option within the Visual Studio* IDE, the Intel C++ Compiler IDE integration will set the option automatically. The Intel C++ Compiler also provides the option, /Qms[0,1,2], Visual C++ Compiler. You can control the level of compatibility in this area with the /Qms[0,1,2] option: /Qms0 instructs the compiler to disable Microsoft compatibility bugs. /Qms1 instructs the compiler to enable most Microsoft compatibility bugs (default). /Qms2 instructs the compiler to implement full Microsoft compatibility. The following macro is predefined in the Intel C++ Compiler to specify the level of Microsoft compatibility provided: __INTEL_MS_COMPAT_LEVEL__ - the value of this macro is [0,1,2] that is controlled by the -Qms option. The default value is 1. automatically if cl.exe is on the path. If you build the program
#pragma optimize(, [on|off]) - The Intel C++ Compiler only supports the enabling and disabling of the not accept a list of optimizations like Visual C++ does. The Intel compiler accepts the following pragmas without error, but they will have no effect. specific optimizations specified by the compiler options. It does
Intel C++ Compiler for Windows* Compatibility with Versions of Microsoft Visual C++*
White Paper
beyond the point where a declaration is seen in the primary Microsoft Visual C++ Compiler ignores all text, including declarations preceding the #include statement of the specified file.
PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its PCH files with a .pchi filename suffix and reduce build time. The /Qpchi option is on by default; use /Qpchi- to turn it off.
White Paper
Intel C++ Compiler for Windows* Compatibility with Versions of Microsoft Visual C++*
The Intel C++ Compiler for Windows supports the safe exception handler feature with option /Qsafeseh for 32-bit binary and is on by default.
Mixing Unmanaged Code Compiled with the Intel C++ Compiler with Managed Code
If you use the managed extensions to the C++ language in Microsoft Visual C++ .NET, you can use the Intel C++ Compiler for your non-managed code, and achieve better application performance. Make sure managed keywords do not appear in your non-managed code. For information on how to mix unmanaged code and managed code, refer to the article, An Overview of Managed/Unmanaged Code Interoperability, at the Microsoft Web site. Note: This URL is available at the Microsoft MSDN* Web site. If it changes, please search for the article.
enable the security checks with the Intel C++ Compiler if you are
Option
Description Adds to assembly search path Compiles for the common language runtime (managed C++) Forces use of assembly/module Merges injected code to file Name the PDB file used for debug information for specified source files Use /Qopenmp instead Maximum memory allocation (percentage of the default) Force parameters passed in registers to be written to the stack Process XML documentation comments and optionally name the .xdc file Use /QaxSSE3, /arch:SSE2, and /QxSSE3 instead. You can find more up to date information at Intel Compilers ProcessorSpecific Optimization Options Put debug information in every object (Microsoft PCH-specific option)
Table 1. Unsupported Compiler Options of Visual C++ .NET 2003, Visual C++ 2005, and Visual C++ 2008.
Intel C++ Compiler for Windows* Compatibility with Versions of Microsoft Visual C++*
White Paper
The taskqueuing pragmas are #pragma taskq and #pragma task. The #pragma taskq specifies the environment within which the enclosed units of work (tasks) are to be executed. From among all the threads that encounter a taskq pragma, one is chosen to execute it initially. The #pragma task specifies a unit of work, potentially executed by intel_omp_task).
a different thread. (#pragma intel_omp_taskq and #pragma 3. Implemented extension functions in the OpenMP run-time library and implemented extension environment variables 4. Support for debugging OpenMP code 5. Support for enhanced debugging by providing an OpenMP stub library for debugging purposes that links in the OpenMP stub APIs, but still runs sequentially; this is supported through the /Qopenmp_stub option 6. Support for the Intel Thread Checker and Intel Thread Profiler via /Qtcheck and /Qopenmp_profile
Intel compiler and the code compiled by the Visual C++* compiler will reference different locations for the variable even when referenced by the same thread. Thus, use the same compiler to compile all source modules that use the same threadprivate objects.
White Paper
Intel C++ Compiler for Windows* Compatibility with Versions of Microsoft Visual C++*
In the Intel C++ Compiler 10.1 release we provided OpenMP Compatibility libraries. Those libraries will be used if you specify /Qopenmp /Qopenmp-lib:compat. In the 11.0 release of the Intel C++ Compiler the OpenMP Compatibility libraries are used by default when you specify the /Qopenmp switch. To use the OpenMP Compatibility Libraries provided by Intel C++ Compiler, see the table for options:
Intel C++ Compiler 10.1 To use the compatibility libraries To use with legacy libs Intel C++ Compiler 11.0
If you have to use two different compilers to compile your OpenMP source code, please follow the instructions below on using the /Qopenmp-lib option:
Compiler 1 Compiler 2 Intel C++ 9.1 Intel C++ 11.0 or 10.1 Visual C++ 2005 or 2008 Intel C++ 9.1 Intel C++ 11.0 or 10.1 legacy compat compat Visual C++ 2005 or 2008 Follow the 3 rules compat NA
Intel C++ Compiler for Windows* Compatibility with Versions of Microsoft Visual C++*
White Paper
The 3rd icon will revert the work. From the Intel C++ Compilers build environment window, use ICProjConvert110.exe.
White Paper
Intel C++ Compiler for Windows* Compatibility with Versions of Microsoft Visual C++*
Debugging Capability
The Intel C++ Compiler is fully source- and binary- (native code only) compatible with the Microsoft Visual C++ .NET 2003, Visual C++ 2005, or Visual C++ 2008 Compiler when the option /Qvc7.1, /Qvc8, or /Qvc9 is specified. Binaries built with the Intel C++ Compiler can be debugged from within the Microsoft Visual C++ IDE. Its possible to build only several files or build several projects with the Intel C++ Compiler.
Automation Interfaces
The Intel C++ Integration has provided a set of automation interfaces since version 10.0. In this release, the ICManifestTool is added. Experienced developers can use the following automation interfaces to obtain information about and manipulate Intel C++ projects. ICProjectEngine, ICCollection, ICProject, ICPlatform, ICConfiguration, ICFile, ICFilter, ICFileConfiguration, ICDebugSettings CppCompilerTool, ICLinkerTool, ICLibrarianTool, ICResourceCompilerTool, ICMidlTool, ICManifestTool, ICCustomBuildTool, ICPreBuildEventTool, ICPreLinkEventTool, ICPostBuildEventTool, ICBscMakeTool IntelSettings, IntelCompiler, ProjectConversions Please refer to the Users Guide for a full description and examples on how to use the interfaces listed above.
Use of Profile Guided Optimization is made much easier. A new menu item is added to the Project pop-up menu.
The following features have been added to the Intel C++ Compiler 10.0 for Windows. Support for the Inherited Project Property feature of Visual Studio 2005 Support for the Custom Build Rule feature of Visual Studio 2005 Improved support for the Remote Debugging feature, to match the exact behavior of Visual C++ Support for the automation interfaces of the Intel C++ Project System (See the next section for details) new toolbar has been added. The functionality associated A with each icon on the toolbar is Intel C++ Quick Start, Use Intel C++, and Use Visual C++.
10
Intel C++ Compiler for Windows* Compatibility with Versions of Microsoft Visual C++*
White Paper
If you do need to mix and match object files, you should use Intel C++ Compiler. These tools will emit the following warning in this case and continue linking with the Whole Program Optimization disabled: IPO: WARNING #11021: Whole program optimization will be disabled; test.obj appears to be a Microsoft(R) /GL compiled object file. Recompile with the Intel(R) compiler using the /GL option for whole program optimization. If you use the link tools (link.exe, lib.exe) provided with Visual C++, you will get the following warning and errors: t2.obj : warning LNK4229: invalid directive /Intel(R) compiler non-linkable IL object file encountered; ignored xxx.obj : error LNK2001: unresolved external symbol int __cdecl foo(void) (?foo@@YAHXZ) xxx.exe : fatal error LNK1120: 1 unresolved externals If you build the project within the Visual Studio IDE, the Intel C++ Compiler integration will cause the correct linking tools to be used. the tools (i.e., icl, xilink, or xilib) provided with the
11
White Paper
Intel C++ Compiler for Windows* Compatibility with Versions of Microsoft Visual C++*
Visual Studio 2005 and 2008 provides the following refined options under the Whole Program Optimization option: Use Link Time Code Generation Profile Guided Optimization - instrument Profile Guided Optimization update Profile Guided Optimization optimize With this option only, if you have some files compiled with the Intel C++ Compiler, youll get the following link error: LINK : fatal error LNK1269: inconsistent file ipo_xxxxobj.obj specified with / LTCG:PGOPTIMIZE but not with / LTCG:PGINSTRUMENT The first three options will not cause any link errors. But, the Profile Guided Optimization instrument/update options will not have any affect on the files compiled with the Intel C++ Compiler.
12
Intel C++ Compiler for Windows* Compatibility with Versions of Microsoft Visual C++*
White Paper
References
You can find useful information about compiler compatibility in the following documents, available on the Intel C++ Compiler 11.0 for Windows web site: Intel C++ Compiler 11.0 for Windows Release Notes Intel C++ Compiler 11.0 for Windows Users Guide Optimizing Applications with the Intel C++ and Fortran Compilers for Windows and Linux
13
Intel, the Intel logo, Intel. Leap ahead. and Intel. Leap ahead. logo, Pentium, Intel Core, and Itanium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. *Other names and brands may be claimed as the property of others. INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTELS TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. Intel products are not intended for use in medical, life saving, life sustaining applications. Intel may make changes to specifications and product descriptions at any time, without notice.
Copyright
0505/DXM/OMD/PDF 300348-002