Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:44:41

0001 //  Copyright 2011 John Maddock
0002 //  Copyright 2013, 2017-2018 Cray, Inc.
0003 //  Use, modification and distribution are subject to the
0004 //  Boost Software License, Version 1.0. (See accompanying file
0005 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 //  See http://www.boost.org for most recent version.
0008 
0009 // Cray C++ compiler setup.
0010 //
0011 // There are a few parameters that affect the macros defined in this file:
0012 //
0013 // - What version of CCE (Cray Compiling Environment) are we running? This
0014 //   comes from the '_RELEASE_MAJOR', '_RELEASE_MINOR', and
0015 //   '_RELEASE_PATCHLEVEL' macros.
0016 // - What C++ standards conformance level are we using (e.g. '-h
0017 //   std=c++14')? This comes from the '__cplusplus' macro.
0018 // - Are we using GCC extensions ('-h gnu' or '-h nognu')? If we have '-h
0019 //   gnu' then CCE emulates GCC, and the macros '__GNUC__',
0020 //   '__GNUC_MINOR__', and '__GNUC_PATCHLEVEL__' are defined.
0021 //
0022 // This file is organized as follows:
0023 //
0024 // - Verify that the combination of parameters listed above is supported.
0025 //   If we have an unsupported combination, we abort with '#error'.
0026 // - Establish baseline values for all Boost macros.
0027 // - Apply changes to the baseline macros based on compiler version. These
0028 //   changes are cummulative so each version section only describes the
0029 //   changes since the previous version.
0030 //   - Within each version section, we may also apply changes based on
0031 //     other parameters (i.e. C++ standards conformance level and GCC
0032 //     extensions).
0033 //
0034 // To test changes to this file:
0035 //
0036 // ```
0037 // module load cce/8.6.5 # Pick the version you want to test.
0038 // cd boost/libs/config/test/all
0039 // b2 -j 8 toolset=cray cxxstd=03 cxxstd=11 cxxstd=14 cxxstd-dialect=gnu linkflags=-lrt
0040 // ```
0041 // Note: Using 'cxxstd-dialect=iso' is not supported at this time (the
0042 // tests run, but many tests fail).
0043 //
0044 // Note: 'linkflags=-lrt' is needed in Cray Linux Environment. Otherwise
0045 // you get an 'undefined reference to clock_gettime' error.
0046 //
0047 // Note: If a test '*_fail.cpp' file compiles, but fails to run, then it is
0048 // reported as a defect. However, this is not actually a defect. This is an
0049 // area where the test system is somewhat broken. Tests that are failing
0050 // because of this problem are noted in the comments.
0051 //
0052 // Pay attention to the macro definitions for the macros you wish to
0053 // modify. For example, only macros categorized as compiler macros should
0054 // appear in this file; platform macros should not appear in this file.
0055 // Also, some macros have to be defined to specific values; it is not
0056 // always enough to define or undefine a macro.
0057 //
0058 // Macro definitions are available in the source code at:
0059 //
0060 // `boost/libs/config/doc/html/boost_config/boost_macro_reference.html`
0061 //
0062 // Macro definitions are also available online at:
0063 //
0064 // http://www.boost.org/doc/libs/master/libs/config/doc/html/boost_config/boost_macro_reference.html
0065 //
0066 // Typically, if you enable a feature, and the tests pass, then you have
0067 // nothing to worry about. However, it's sometimes hard to figure out if a
0068 // disabled feature needs to stay disabled. To get a list of disabled
0069 // features, run 'b2' in 'boost/libs/config/checks'. These are the macros
0070 // you should pay attention to (in addition to macros that cause test
0071 // failures).
0072 
0073 ////
0074 //// Front matter
0075 ////
0076 
0077 // In a developer build of the Cray compiler (i.e. a compiler built by a
0078 // Cray employee), the release patch level is reported as "x". This gives
0079 // versions that look like e.g. "8.6.x".
0080 //
0081 // To accomplish this, the the Cray compiler preprocessor inserts:
0082 //
0083 // #define _RELEASE_PATCHLEVEL x
0084 //
0085 // If we are using a developer build of the compiler, we want to use the
0086 // configuration macros for the most recent patch level of the release. To
0087 // accomplish this, we'll pretend that _RELEASE_PATCHLEVEL is 99.
0088 //
0089 // However, it's difficult to detect if _RELEASE_PATCHLEVEL is x. We must
0090 // consider that the x will be expanded if x is defined as a macro
0091 // elsewhere. For example, imagine if someone put "-D x=3" on the command
0092 // line, and _RELEASE_PATCHLEVEL is x. Then _RELEASE_PATCHLEVEL would
0093 // expand to 3, and we could not distinguish it from an actual
0094 // _RELEASE_PATCHLEVEL of 3. This problem only affects developer builds; in
0095 // production builds, _RELEASE_PATCHLEVEL is always an integer.
0096 //
0097 // IMPORTANT: In developer builds, if x is defined as a macro, you will get
0098 // an incorrect configuration. The behavior in this case is undefined.
0099 //
0100 // Even if x is not defined, we have to use some trickery to detect if
0101 // _RELEASE_PATCHLEVEL is x. First we define BOOST_CRAY_x to some arbitrary
0102 // magic value, 9867657. Then we use BOOST_CRAY_APPEND to append the
0103 // expanded value of _RELEASE_PATCHLEVEL to the string "BOOST_CRAY_".
0104 //
0105 // - If _RELEASE_PATCHLEVEL is undefined, we get "BOOST_CRAY_".
0106 // - If _RELEASE_PATCHLEVEL is 5, we get "BOOST_CRAY_5".
0107 // - If _RELEASE_PATCHLEVEL is x (and x is not defined) we get
0108 //   "BOOST_CRAY_x":
0109 //
0110 // Then we check if BOOST_CRAY_x is equal to the output of
0111 // BOOST_CRAY_APPEND. In other words, the output of BOOST_CRAY_APPEND is
0112 // treated as a macro name, and expanded again. If we can safely assume
0113 // that BOOST_CRAY_ is not a macro defined as our magic number, and
0114 // BOOST_CRAY_5 is not a macro defined as our magic number, then the only
0115 // way the equality test can pass is if _RELEASE_PATCHLEVEL expands to x.
0116 //
0117 // So, that is how we detect if we are using a developer build of the Cray
0118 // compiler.
0119 
0120 #define BOOST_CRAY_x 9867657 // Arbitrary number
0121 #define BOOST_CRAY_APPEND(MACRO) BOOST_CRAY_APPEND_INTERNAL(MACRO)
0122 #define BOOST_CRAY_APPEND_INTERNAL(MACRO) BOOST_CRAY_##MACRO
0123 
0124 #if BOOST_CRAY_x == BOOST_CRAY_APPEND(_RELEASE_PATCHLEVEL)
0125 
0126     // This is a developer build.
0127     //
0128     // - _RELEASE_PATCHLEVEL is defined as x, and x is not defined as a macro.
0129 
0130     // Pretend _RELEASE_PATCHLEVEL is 99, so we get the configuration for the
0131     // most recent patch level in this release.
0132 
0133     #define BOOST_CRAY_VERSION (_RELEASE_MAJOR * 10000 + _RELEASE_MINOR * 100 + 99)
0134 
0135 #else
0136 
0137     // This is a production build.
0138     //
0139     // _RELEASE_PATCHLEVEL is not defined as x, or x is defined as a macro.
0140 
0141     #define BOOST_CRAY_VERSION (_RELEASE_MAJOR * 10000 + _RELEASE_MINOR * 100 + _RELEASE_PATCHLEVEL)
0142 
0143 #endif // BOOST_CRAY_x == BOOST_CRAY_APPEND(_RELEASE_PATCHLEVEL)
0144 
0145 #undef BOOST_CRAY_APPEND_INTERNAL
0146 #undef BOOST_CRAY_APPEND
0147 #undef BOOST_CRAY_x
0148 
0149 
0150 #ifdef __GNUC__
0151 #   define BOOST_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
0152 #endif
0153 
0154 #ifndef BOOST_COMPILER
0155 #   define BOOST_COMPILER "Cray C++ version " BOOST_STRINGIZE(_RELEASE_MAJOR) "." BOOST_STRINGIZE(_RELEASE_MINOR) "." BOOST_STRINGIZE(_RELEASE_PATCHLEVEL)
0156 #endif
0157 
0158 // Since the Cray compiler defines '__GNUC__', we have to emulate some
0159 // additional GCC macros in order to make everything work.
0160 //
0161 // FIXME: Perhaps Cray should fix the compiler to define these additional
0162 // macros for GCC emulation?
0163 
0164 #if __cplusplus >= 201103L && defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
0165 #   define __GXX_EXPERIMENTAL_CXX0X__ 1
0166 #endif
0167 
0168 ////
0169 //// Parameter validation
0170 ////
0171 
0172 // FIXME: Do we really need to support compilers before 8.5? Do they pass
0173 // the Boost.Config tests?
0174 
0175 #if BOOST_CRAY_VERSION < 80000
0176 #  error "Boost is not configured for Cray compilers prior to version 8, please try the configure script."
0177 #endif
0178 
0179 // We only support recent EDG based compilers.
0180 
0181 #ifndef __EDG__
0182 #  error "Unsupported Cray compiler, please try running the configure script."
0183 #endif
0184 
0185 ////
0186 //// Baseline values
0187 ////
0188 
0189 #include <boost/config/compiler/common_edg.hpp>
0190 
0191 #define BOOST_HAS_NRVO
0192 #define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
0193 #define BOOST_NO_CXX11_AUTO_DECLARATIONS
0194 #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
0195 #define BOOST_NO_CXX11_CHAR16_T
0196 #define BOOST_NO_CXX11_CHAR32_T
0197 #define BOOST_NO_CXX11_CONSTEXPR
0198 #define BOOST_NO_CXX11_DECLTYPE
0199 #define BOOST_NO_CXX11_DECLTYPE_N3276
0200 #define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
0201 #define BOOST_NO_CXX11_DELETED_FUNCTIONS
0202 #define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
0203 #define BOOST_NO_CXX11_FINAL
0204 #define BOOST_NO_CXX11_OVERRIDE
0205 #define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
0206 #define BOOST_NO_CXX11_LAMBDAS
0207 #define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
0208 #define BOOST_NO_CXX11_NOEXCEPT
0209 #define BOOST_NO_CXX11_NULLPTR
0210 #define BOOST_NO_CXX11_RANGE_BASED_FOR
0211 #define BOOST_NO_CXX11_RAW_LITERALS
0212 #define BOOST_NO_CXX11_REF_QUALIFIERS
0213 #define BOOST_NO_CXX11_RVALUE_REFERENCES
0214 #define BOOST_NO_CXX11_SCOPED_ENUMS
0215 #define BOOST_NO_CXX11_SFINAE_EXPR
0216 #define BOOST_NO_CXX11_STATIC_ASSERT
0217 #define BOOST_NO_CXX11_TEMPLATE_ALIASES
0218 #define BOOST_NO_CXX11_THREAD_LOCAL
0219 #define BOOST_NO_CXX11_UNICODE_LITERALS
0220 #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
0221 #define BOOST_NO_CXX11_USER_DEFINED_LITERALS
0222 #define BOOST_NO_CXX11_VARIADIC_MACROS
0223 #define BOOST_NO_CXX11_VARIADIC_TEMPLATES
0224 #define BOOST_NO_CXX11_UNRESTRICTED_UNION
0225 #define BOOST_NO_SFINAE_EXPR
0226 #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
0227 
0228 //#define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
0229 #define BOOST_MATH_DISABLE_STD_FPCLASSIFY
0230 //#define BOOST_HAS_FPCLASSIFY
0231 
0232 #define BOOST_SP_USE_PTHREADS 
0233 #define BOOST_AC_USE_PTHREADS 
0234 
0235 //
0236 // Everything that follows is working around what are thought to be
0237 // compiler shortcomings. Revist all of these regularly.
0238 //
0239 
0240 //#define BOOST_USE_ENUM_STATIC_ASSERT
0241 //#define BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS //(this may be implied by the previous #define
0242 
0243 // These constants should be provided by the compiler.
0244 
0245 #ifndef __ATOMIC_RELAXED
0246 #define __ATOMIC_RELAXED 0
0247 #define __ATOMIC_CONSUME 1
0248 #define __ATOMIC_ACQUIRE 2
0249 #define __ATOMIC_RELEASE 3
0250 #define __ATOMIC_ACQ_REL 4
0251 #define __ATOMIC_SEQ_CST 5
0252 #endif
0253 
0254 ////
0255 //// Version changes
0256 ////
0257 
0258 //
0259 // 8.5.0
0260 //
0261 
0262 #if BOOST_CRAY_VERSION >= 80500
0263 
0264 #if __cplusplus >= 201103L
0265 
0266 #undef BOOST_HAS_NRVO
0267 #undef BOOST_NO_COMPLETE_VALUE_INITIALIZATION
0268 #undef BOOST_NO_CXX11_AUTO_DECLARATIONS
0269 #undef BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
0270 #undef BOOST_NO_CXX11_CHAR16_T
0271 #undef BOOST_NO_CXX11_CHAR32_T
0272 #undef BOOST_NO_CXX11_CONSTEXPR
0273 #undef BOOST_NO_CXX11_DECLTYPE
0274 #undef BOOST_NO_CXX11_DECLTYPE_N3276
0275 #undef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
0276 #undef BOOST_NO_CXX11_DELETED_FUNCTIONS
0277 #undef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
0278 #undef BOOST_NO_CXX11_FINAL
0279 #undef BOOST_NO_CXX11_OVERRIDE
0280 #undef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
0281 #undef BOOST_NO_CXX11_LAMBDAS
0282 #undef BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
0283 #undef BOOST_NO_CXX11_NOEXCEPT
0284 #undef BOOST_NO_CXX11_NULLPTR
0285 #undef BOOST_NO_CXX11_RANGE_BASED_FOR
0286 #undef BOOST_NO_CXX11_RAW_LITERALS
0287 #undef BOOST_NO_CXX11_REF_QUALIFIERS
0288 #undef BOOST_NO_CXX11_RVALUE_REFERENCES
0289 #undef BOOST_NO_CXX11_SCOPED_ENUMS
0290 #undef BOOST_NO_CXX11_SFINAE_EXPR
0291 #undef BOOST_NO_CXX11_STATIC_ASSERT
0292 #undef BOOST_NO_CXX11_TEMPLATE_ALIASES
0293 #undef BOOST_NO_CXX11_THREAD_LOCAL
0294 #undef BOOST_NO_CXX11_UNICODE_LITERALS
0295 #undef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
0296 #undef BOOST_NO_CXX11_USER_DEFINED_LITERALS
0297 #undef BOOST_NO_CXX11_VARIADIC_MACROS
0298 #undef BOOST_NO_CXX11_VARIADIC_TEMPLATES
0299 #undef BOOST_NO_CXX11_UNRESTRICTED_UNION
0300 #undef BOOST_NO_SFINAE_EXPR
0301 #undef BOOST_NO_TWO_PHASE_NAME_LOOKUP
0302 #undef BOOST_MATH_DISABLE_STD_FPCLASSIFY
0303 #undef BOOST_SP_USE_PTHREADS 
0304 #undef BOOST_AC_USE_PTHREADS 
0305 
0306 #define BOOST_HAS_VARIADIC_TMPL
0307 #define BOOST_HAS_UNISTD_H
0308 #define BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG
0309 #define BOOST_HAS_TR1_COMPLEX_OVERLOADS
0310 #define BOOST_HAS_STDINT_H
0311 #define BOOST_HAS_STATIC_ASSERT
0312 #define BOOST_HAS_SIGACTION
0313 #define BOOST_HAS_SCHED_YIELD
0314 #define BOOST_HAS_RVALUE_REFS
0315 #define BOOST_HAS_PTHREADS
0316 #define BOOST_HAS_PTHREAD_YIELD
0317 #define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
0318 #define BOOST_HAS_PARTIAL_STD_ALLOCATOR
0319 #define BOOST_HAS_NRVO
0320 #define BOOST_HAS_NL_TYPES_H
0321 #define BOOST_HAS_NANOSLEEP
0322 #define BOOST_NO_CXX11_SMART_PTR
0323 #define BOOST_NO_CXX11_HDR_FUNCTIONAL
0324 #define BOOST_NO_CXX14_CONSTEXPR
0325 #define BOOST_HAS_LONG_LONG
0326 #define BOOST_HAS_FLOAT128
0327 
0328 #if __cplusplus < 201402L
0329 #define BOOST_NO_CXX11_DECLTYPE_N3276
0330 #endif // __cplusplus < 201402L
0331 
0332 #endif // __cplusplus >= 201103L
0333 
0334 #endif // BOOST_CRAY_VERSION >= 80500
0335 
0336 //
0337 // 8.6.4
0338 // (versions prior to 8.6.5 do not define _RELEASE_PATCHLEVEL)
0339 //
0340 
0341 #if BOOST_CRAY_VERSION >= 80600
0342 
0343 #if __cplusplus >= 199711L
0344 #define BOOST_HAS_FLOAT128
0345 #define BOOST_HAS_PTHREAD_YIELD // This is a platform macro, but it improves test results.
0346 #define BOOST_NO_COMPLETE_VALUE_INITIALIZATION // This is correct. Test compiles, but fails to run.
0347 #undef  BOOST_NO_CXX11_CHAR16_T
0348 #undef  BOOST_NO_CXX11_CHAR32_T
0349 #undef  BOOST_NO_CXX11_INLINE_NAMESPACES
0350 #undef  BOOST_NO_CXX11_FINAL
0351 #undef BOOST_NO_CXX11_OVERRIDE
0352 #undef  BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS
0353 #undef  BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
0354 #define BOOST_NO_CXX11_SFINAE_EXPR // This is correct, even though '*_fail.cpp' test fails.
0355 #undef  BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
0356 #undef  BOOST_NO_CXX11_VARIADIC_MACROS
0357 #undef  BOOST_NO_CXX11_VARIADIC_TEMPLATES
0358 // 'BOOST_NO_DEDUCED_TYPENAME' test is broken. The test files are enabled /
0359 // disabled with an '#ifdef BOOST_DEDUCED_TYPENAME'. However,
0360 // 'boost/libs/config/include/boost/config/detail/suffix.hpp' ensures that
0361 // 'BOOST_DEDUCED_TYPENAME' is always defined (the value it is defined as
0362 // depends on 'BOOST_NO_DEDUCED_TYPENAME'). So, modifying
0363 // 'BOOST_NO_DEDUCED_TYPENAME' has no effect on which tests are run.
0364 //
0365 // The 'no_ded_typename_pass.cpp' test should always compile and run
0366 // successfully, because 'BOOST_DEDUCED_TYPENAME' must always have an
0367 // appropriate value (it's not just something that you turn on or off).
0368 // Therefore, if you wish to test changes to 'BOOST_NO_DEDUCED_TYPENAME',
0369 // you have to modify 'no_ded_typename_pass.cpp' to unconditionally include
0370 // 'boost_no_ded_typename.ipp'.
0371 #undef  BOOST_NO_DEDUCED_TYPENAME // This is correct. Test is broken.
0372 #undef  BOOST_NO_SFINAE_EXPR
0373 #undef  BOOST_NO_TWO_PHASE_NAME_LOOKUP
0374 #endif // __cplusplus >= 199711L
0375 
0376 #if __cplusplus >= 201103L
0377 #undef  BOOST_NO_CXX11_ALIGNAS
0378 #undef  BOOST_NO_CXX11_ALIGNOF
0379 #undef  BOOST_NO_CXX11_DECLTYPE_N3276
0380 #define BOOST_NO_CXX11_HDR_ATOMIC
0381 #undef  BOOST_NO_CXX11_HDR_FUNCTIONAL
0382 #define BOOST_NO_CXX11_HDR_REGEX // This is correct. Test compiles, but fails to run.
0383 #undef  BOOST_NO_CXX11_SFINAE_EXPR
0384 #undef  BOOST_NO_CXX11_SMART_PTR
0385 #undef  BOOST_NO_CXX11_TRAILING_RESULT_TYPES
0386 #endif // __cplusplus >= 201103L
0387 
0388 #if __cplusplus >= 201402L
0389 #undef  BOOST_NO_CXX14_CONSTEXPR
0390 #define BOOST_NO_CXX14_DIGIT_SEPARATORS
0391 #endif // __cplusplus == 201402L
0392 
0393 #endif // BOOST_CRAY_VERSION >= 80600
0394 
0395 //
0396 // 8.6.5
0397 // (no change from 8.6.4)
0398 //
0399 
0400 //
0401 // 8.7.0
0402 //
0403 
0404 #if BOOST_CRAY_VERSION >= 80700
0405 
0406 #if __cplusplus >= 199711L
0407 #endif // __cplusplus >= 199711L
0408 
0409 #if __cplusplus >= 201103L
0410 #undef  BOOST_NO_CXX11_HDR_ATOMIC
0411 #undef  BOOST_NO_CXX11_HDR_REGEX
0412 #endif // __cplusplus >= 201103L
0413 
0414 #if __cplusplus >= 201402L
0415 #endif // __cplusplus == 201402L
0416 
0417 #endif // BOOST_CRAY_VERSION >= 80700
0418 
0419 //
0420 // Next release
0421 //
0422 
0423 #if BOOST_CRAY_VERSION > 80799
0424 
0425 #if __cplusplus >= 199711L
0426 #endif // __cplusplus >= 199711L
0427 
0428 #if __cplusplus >= 201103L
0429 #endif // __cplusplus >= 201103L
0430 
0431 #if __cplusplus >= 201402L
0432 #endif // __cplusplus == 201402L
0433 
0434 #endif // BOOST_CRAY_VERSION > 80799
0435 
0436 ////
0437 //// Remove temporary macros
0438 ////
0439 
0440 // I've commented out some '#undef' statements to signify that we purposely
0441 // want to keep certain macros.
0442 
0443 //#undef __GXX_EXPERIMENTAL_CXX0X__
0444 //#undef BOOST_COMPILER
0445 #undef BOOST_GCC_VERSION
0446 #undef BOOST_CRAY_VERSION