]> git.donarmstrong.com Git - rsem.git/blob - boost/config/compiler/intel.hpp
Updated boost to v1.55.0
[rsem.git] / boost / config / compiler / intel.hpp
1 //  (C) Copyright John Maddock 2001-8.
2 //  (C) Copyright Peter Dimov 2001.
3 //  (C) Copyright Jens Maurer 2001.
4 //  (C) Copyright David Abrahams 2002 - 2003.
5 //  (C) Copyright Aleksey Gurtovoy 2002 - 2003.
6 //  (C) Copyright Guillaume Melquiond 2002 - 2003.
7 //  (C) Copyright Beman Dawes 2003.
8 //  (C) Copyright Martin Wille 2003.
9 //  Use, modification and distribution are subject to the
10 //  Boost Software License, Version 1.0. (See accompanying file
11 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
12
13 //  See http://www.boost.org for most recent version.
14
15 //  Intel compiler setup:
16
17 #include "boost/config/compiler/common_edg.hpp"
18
19 #if defined(__INTEL_COMPILER)
20 #  define BOOST_INTEL_CXX_VERSION __INTEL_COMPILER
21 #elif defined(__ICL)
22 #  define BOOST_INTEL_CXX_VERSION __ICL
23 #elif defined(__ICC)
24 #  define BOOST_INTEL_CXX_VERSION __ICC
25 #elif defined(__ECC)
26 #  define BOOST_INTEL_CXX_VERSION __ECC
27 #endif
28
29 // Flags determined by comparing output of 'icpc -dM -E' with and without '-std=c++0x'
30 #if (!(defined(_WIN32) || defined(_WIN64)) && defined(__STDC_HOSTED__) && (__STDC_HOSTED__ && (BOOST_INTEL_CXX_VERSION <= 1200))) || defined(__GXX_EXPERIMENTAL_CPP0X__) || defined(__GXX_EXPERIMENTAL_CXX0X__)
31 #  define BOOST_INTEL_STDCXX0X
32 #endif
33 #if defined(_MSC_VER) && (_MSC_VER >= 1600)
34 #  define BOOST_INTEL_STDCXX0X
35 #endif
36
37 #ifdef BOOST_INTEL_STDCXX0X
38 #define BOOST_COMPILER "Intel C++ C++0x mode version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
39 #else
40 #define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
41 #endif
42 #define BOOST_INTEL BOOST_INTEL_CXX_VERSION
43
44 #if defined(_WIN32) || defined(_WIN64)
45 #  define BOOST_INTEL_WIN BOOST_INTEL
46 #else
47 #  define BOOST_INTEL_LINUX BOOST_INTEL
48 #endif
49
50 #if (BOOST_INTEL_CXX_VERSION <= 600)
51
52 #  if defined(_MSC_VER) && (_MSC_VER <= 1300) // added check for <= VC 7 (Peter Dimov)
53
54 // Boost libraries assume strong standard conformance unless otherwise
55 // indicated by a config macro. As configured by Intel, the EDG front-end
56 // requires certain compiler options be set to achieve that strong conformance.
57 // Particularly /Qoption,c,--arg_dep_lookup (reported by Kirk Klobe & Thomas Witt)
58 // and /Zc:wchar_t,forScope. See boost-root/tools/build/intel-win32-tools.jam for
59 // details as they apply to particular versions of the compiler. When the
60 // compiler does not predefine a macro indicating if an option has been set,
61 // this config file simply assumes the option has been set.
62 // Thus BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP will not be defined, even if
63 // the compiler option is not enabled.
64
65 #     define BOOST_NO_SWPRINTF
66 #  endif
67
68 // Void returns, 64 bit integrals don't work when emulating VC 6 (Peter Dimov)
69
70 #  if defined(_MSC_VER) && (_MSC_VER <= 1200)
71 #     define BOOST_NO_VOID_RETURNS
72 #     define BOOST_NO_INTEGRAL_INT64_T
73 #  endif
74
75 #endif
76
77 #if (BOOST_INTEL_CXX_VERSION <= 710) && defined(_WIN32)
78 #  define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
79 #endif
80
81 // See http://aspn.activestate.com/ASPN/Mail/Message/boost/1614864
82 #if BOOST_INTEL_CXX_VERSION < 600
83 #  define BOOST_NO_INTRINSIC_WCHAR_T
84 #else
85 // We should test the macro _WCHAR_T_DEFINED to check if the compiler
86 // supports wchar_t natively. *BUT* there is a problem here: the standard
87 // headers define this macro if they typedef wchar_t. Anyway, we're lucky
88 // because they define it without a value, while Intel C++ defines it
89 // to 1. So we can check its value to see if the macro was defined natively
90 // or not.
91 // Under UNIX, the situation is exactly the same, but the macro _WCHAR_T
92 // is used instead.
93 #  if ((_WCHAR_T_DEFINED + 0) == 0) && ((_WCHAR_T + 0) == 0)
94 #    define BOOST_NO_INTRINSIC_WCHAR_T
95 #  endif
96 #endif
97
98 #if defined(__GNUC__) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
99 //
100 // Figure out when Intel is emulating this gcc bug
101 // (All Intel versions prior to 9.0.26, and versions
102 // later than that if they are set up to emulate gcc 3.2
103 // or earlier):
104 //
105 #  if ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)) || (BOOST_INTEL < 900) || (__INTEL_COMPILER_BUILD_DATE < 20050912)
106 #     define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
107 #  endif
108 #endif
109 #if (defined(__GNUC__) && (__GNUC__ < 4)) || (defined(_WIN32) && (BOOST_INTEL_CXX_VERSION <= 1200)) || (BOOST_INTEL_CXX_VERSION <= 1200)
110 // GCC or VC emulation:
111 #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
112 #endif
113 //
114 // Verify that we have actually got BOOST_NO_INTRINSIC_WCHAR_T
115 // set correctly, if we don't do this now, we will get errors later
116 // in type_traits code among other things, getting this correct
117 // for the Intel compiler is actually remarkably fragile and tricky:
118 //
119 #ifdef __cplusplus
120 #if defined(BOOST_NO_INTRINSIC_WCHAR_T)
121 #include <cwchar>
122 template< typename T > struct assert_no_intrinsic_wchar_t;
123 template<> struct assert_no_intrinsic_wchar_t<wchar_t> { typedef void type; };
124 // if you see an error here then you need to unset BOOST_NO_INTRINSIC_WCHAR_T
125 // where it is defined above:
126 typedef assert_no_intrinsic_wchar_t<unsigned short>::type assert_no_intrinsic_wchar_t_;
127 #else
128 template< typename T > struct assert_intrinsic_wchar_t;
129 template<> struct assert_intrinsic_wchar_t<wchar_t> {};
130 // if you see an error here then define BOOST_NO_INTRINSIC_WCHAR_T on the command line:
131 template<> struct assert_intrinsic_wchar_t<unsigned short> {};
132 #endif
133 #endif
134
135 #if defined(_MSC_VER) && (_MSC_VER+0 >= 1000)
136 #  if _MSC_VER >= 1200
137 #     define BOOST_HAS_MS_INT64
138 #  endif
139 #  define BOOST_NO_SWPRINTF
140 #  define BOOST_NO_TWO_PHASE_NAME_LOOKUP
141 #elif defined(_WIN32)
142 #  define BOOST_DISABLE_WIN32
143 #endif
144
145 // I checked version 6.0 build 020312Z, it implements the NRVO.
146 // Correct this as you find out which version of the compiler
147 // implemented the NRVO first.  (Daniel Frey)
148 #if (BOOST_INTEL_CXX_VERSION >= 600)
149 #  define BOOST_HAS_NRVO
150 #endif
151
152 // Branch prediction hints
153 // I'm not sure 8.0 was the first version to support these builtins,
154 // update the condition if the version is not accurate. (Andrey Semashev)
155 #if defined(__GNUC__) && BOOST_INTEL_CXX_VERSION >= 800
156 #define BOOST_LIKELY(x) __builtin_expect(x, 1)
157 #define BOOST_UNLIKELY(x) __builtin_expect(x, 0)
158 #endif
159
160 //
161 // versions check:
162 // we don't support Intel prior to version 6.0:
163 #if BOOST_INTEL_CXX_VERSION < 600
164 #  error "Compiler not supported or configured - please reconfigure"
165 #endif
166
167 // Intel on MacOS requires
168 #if defined(__APPLE__) && defined(__INTEL_COMPILER)
169 #  define BOOST_NO_TWO_PHASE_NAME_LOOKUP
170 #endif
171
172 // Intel on Altix Itanium
173 #if defined(__itanium__) && defined(__INTEL_COMPILER)
174 #  define BOOST_NO_TWO_PHASE_NAME_LOOKUP
175 #endif
176
177 //
178 // An attempt to value-initialize a pointer-to-member may trigger an
179 // internal error on Intel <= 11.1 (last checked version), as was
180 // reported by John Maddock, Intel support issue 589832, May 2010.
181 // Moreover, according to test results from Huang-Vista-x86_32_intel,
182 // intel-vc9-win-11.1 may leave a non-POD array uninitialized, in some
183 // cases when it should be value-initialized.
184 // (Niels Dekker, LKEB, May 2010)
185 // Apparently Intel 12.1 (compiler version number 9999 !!) has the same issue (compiler regression).
186 #if defined(__INTEL_COMPILER)
187 #  if (__INTEL_COMPILER <= 1110) || (__INTEL_COMPILER == 9999) || (defined(_WIN32) && (__INTEL_COMPILER < 1500))
188 #    define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
189 #  endif
190 #endif
191
192 //
193 // Dynamic shared object (DSO) and dynamic-link library (DLL) support
194 //
195 #if defined(__GNUC__) && (__GNUC__ >= 4)
196 #  define BOOST_SYMBOL_EXPORT __attribute__((visibility("default")))
197 #  define BOOST_SYMBOL_IMPORT
198 #  define BOOST_SYMBOL_VISIBLE __attribute__((visibility("default")))
199 #endif
200 //
201 // C++0x features
202 //     - ICC added static_assert in 11.0 (first version with C++0x support)
203 //
204 #if defined(BOOST_INTEL_STDCXX0X)
205 #  undef  BOOST_NO_CXX11_STATIC_ASSERT
206 //
207 // These pass our test cases, but aren't officially supported according to:
208 // http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler/
209 //
210 //#  undef  BOOST_NO_CXX11_LAMBDAS
211 //#  undef  BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
212 //#  undef  BOOST_NO_CXX11_DECLTYPE
213 //#  undef  BOOST_NO_CXX11_AUTO_DECLARATIONS
214 //#  undef  BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
215 #endif
216
217 #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION >= 1200)
218 //#  undef  BOOST_NO_CXX11_RVALUE_REFERENCES // Enabling this breaks Filesystem and Exception libraries
219 //#  undef  BOOST_NO_CXX11_SCOPED_ENUMS  // doesn't really work!!
220 #  undef  BOOST_NO_CXX11_DELETED_FUNCTIONS
221 #  undef  BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
222 #  undef  BOOST_NO_CXX11_LAMBDAS
223 #  undef  BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
224 #  undef  BOOST_NO_CXX11_DECLTYPE
225 #  undef  BOOST_NO_CXX11_AUTO_DECLARATIONS
226 #  undef  BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
227 #  undef  BOOST_NO_CXX11_TRAILING_RESULT_TYPES
228 #endif
229
230 // icl Version 12.1.0.233 Build 20110811 and possibly some other builds
231 // had an incorrect __INTEL_COMPILER value of 9999. Intel say this has been fixed.
232 #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION > 1200)
233 #  undef  BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
234 #  undef  BOOST_NO_CXX11_NULLPTR
235 #  undef  BOOST_NO_CXX11_RVALUE_REFERENCES
236 #  undef  BOOST_NO_SFINAE_EXPR
237 #  undef  BOOST_NO_CXX11_TEMPLATE_ALIASES
238 #  undef  BOOST_NO_CXX11_VARIADIC_TEMPLATES
239
240 // http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler/
241 // continues to list scoped enum support as "Partial"
242 //#  undef  BOOST_NO_CXX11_SCOPED_ENUMS
243 #endif
244 #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION >= 1310) && !defined(_MSC_VER)
245 #  undef BOOST_NO_CXX11_INLINE_NAMESPACES
246 #  undef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
247 // This one generates internal compiler errors in multiprecision, disabled for now:
248 //#  undef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS  
249 // This one generates errors when used with conditional exception specifications, for example in multiprecision:
250 //#  undef BOOST_NO_CXX11_NOEXCEPT
251 #  undef BOOST_NO_CXX11_RANGE_BASED_FOR
252 #  undef BOOST_NO_CXX11_SCOPED_ENUMS
253 #  undef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
254 #endif
255 #if (BOOST_INTEL_CXX_VERSION >= 1310)
256 #  undef  BOOST_NO_SFINAE_EXPR
257 #endif
258 #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION >= 1400) && !defined(_MSC_VER)
259 #  undef BOOST_NO_CXX11_UNICODE_LITERALS 
260 #  undef BOOST_NO_CXX11_RAW_LITERALS 
261 // This one generates errors when used with conditional exception specifications, for example in multiprecision:
262 //#  undef BOOST_NO_CXX11_NOEXCEPT 
263 // This breaks multiprecision:
264 //#  undef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS 
265 #  undef BOOST_NO_CXX11_HDR_THREAD 
266 #  undef BOOST_NO_CXX11_CHAR32_T 
267 #  undef BOOST_NO_CXX11_CHAR16_T
268 #endif
269
270 #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION <= 1310)
271 #  define BOOST_NO_CXX11_HDR_FUTURE
272 #  define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
273 #endif
274
275 #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION == 1400)
276 // A regression in Intel's compiler means that <tuple> seems to be broken in this release as well as <future> :
277 #  define BOOST_NO_CXX11_HDR_FUTURE
278 #  define BOOST_NO_CXX11_HDR_TUPLE
279 #endif
280
281 #if defined(_MSC_VER) && (_MSC_VER <= 1700)
282 //
283 // Although the Intel compiler is capable of supporting these, it appears not to in MSVC compatibility mode:
284 //
285 #  define  BOOST_NO_CXX11_HDR_INITIALIZER_LIST
286 #  define  BOOST_NO_CXX11_VARIADIC_TEMPLATES
287 #  define  BOOST_NO_CXX11_DELETED_FUNCTIONS
288 #  define  BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
289 #  define  BOOST_NO_CXX11_TEMPLATE_ALIASES
290 #  if(BOOST_INTEL_CXX_VERSION < 1310)
291 #     define  BOOST_NO_CXX11_TRAILING_RESULT_TYPES
292 #  endif
293 #endif
294
295 #if (BOOST_INTEL_CXX_VERSION < 1200)
296 //
297 // fenv.h appears not to work with Intel prior to 12.0:
298 //
299 #  define BOOST_NO_FENV_H
300 #endif
301
302 #if defined(_MSC_VER) && (_MSC_VER >= 1600)
303 #  define BOOST_HAS_STDINT_H
304 #endif
305
306 #if defined(__LP64__) && defined(__GNUC__) && (BOOST_INTEL_CXX_VERSION >= 1310)
307 #  define BOOST_HAS_INT128
308 #endif
309
310 //
311 // last known and checked version:
312 #if (BOOST_INTEL_CXX_VERSION > 1310)
313 #  if defined(BOOST_ASSERT_CONFIG)
314 #     error "Unknown compiler version - please run the configure tests and report the results"
315 #  elif defined(_MSC_VER)
316 //
317 //      We don't emit this warning any more, since we have so few
318 //      defect macros set anyway (just the one).
319 //
320 //#     pragma message("Unknown compiler version - please run the configure tests and report the results")
321 #  endif
322 #endif
323