Chris@49: // Copyright (C) 2008-2013 NICTA (www.nicta.com.au) Chris@49: // Copyright (C) 2008-2013 Conrad Sanderson Chris@49: // Chris@49: // This Source Code Form is subject to the terms of the Mozilla Public Chris@49: // License, v. 2.0. If a copy of the MPL was not distributed with this Chris@49: // file, You can obtain one at http://mozilla.org/MPL/2.0/. Chris@49: Chris@49: Chris@49: Chris@49: #define arma_hot Chris@49: #define arma_cold Chris@49: #define arma_pure Chris@49: #define arma_const Chris@49: #define arma_aligned Chris@49: #define arma_align_mem Chris@49: #define arma_warn_unused Chris@49: #define arma_deprecated Chris@49: #define arma_malloc Chris@49: #define arma_inline inline Chris@49: #define arma_noinline Chris@49: #define arma_ignore(variable) ((void)(variable)) Chris@49: Chris@49: Chris@49: #if defined(ARMA_BLAS_UNDERSCORE) Chris@49: #define arma_fortran2_noprefix(function) function##_ Chris@49: #define arma_fortran2_prefix(function) wrapper_##function##_ Chris@49: #else Chris@49: #define arma_fortran2_noprefix(function) function Chris@49: #define arma_fortran2_prefix(function) wrapper_##function Chris@49: #endif Chris@49: Chris@49: #if defined(ARMA_USE_WRAPPER) Chris@49: #define arma_fortran(function) arma_fortran2_prefix(function) Chris@49: #define arma_atlas(function) wrapper_##function Chris@49: #else Chris@49: #define arma_fortran(function) arma_fortran2_noprefix(function) Chris@49: #define arma_atlas(function) function Chris@49: #endif Chris@49: Chris@49: #define arma_fortran_prefix(function) arma_fortran2_prefix(function) Chris@49: #define arma_fortran_noprefix(function) arma_fortran2_noprefix(function) Chris@49: Chris@49: Chris@49: #define ARMA_INCFILE_WRAP(x) Chris@49: Chris@49: Chris@49: #if ( ((_POSIX_C_SOURCE >= 200112L) || (_XOPEN_SOURCE >= 600)) && !defined(__MINGW32__) && !defined(__APPLE__) ) Chris@49: #define ARMA_HAVE_POSIX_MEMALIGN Chris@49: #endif Chris@49: Chris@49: Chris@49: #if (__cplusplus >= 201103L) Chris@49: #if !defined(ARMA_USE_CXX11) Chris@49: #define ARMA_USE_CXX11 Chris@49: #endif Chris@49: #endif Chris@49: Chris@49: Chris@49: #if defined(ARMA_USE_CXX11) Chris@49: #if !defined(ARMA_USE_U64S64) Chris@49: #define ARMA_USE_U64S64 Chris@49: #endif Chris@49: #endif Chris@49: Chris@49: Chris@49: #if defined(ARMA_64BIT_WORD) Chris@49: #if !defined(ARMA_USE_U64S64) Chris@49: #define ARMA_USE_U64S64 Chris@49: #endif Chris@49: #endif Chris@49: Chris@49: Chris@49: #if defined(__INTEL_COMPILER) Chris@49: Chris@49: #if (__INTEL_COMPILER < 1000) Chris@49: #error "*** Need a newer compiler ***" Chris@49: #endif Chris@49: Chris@49: #define ARMA_GOOD_COMPILER Chris@49: #undef ARMA_HAVE_STD_TR1 Chris@49: Chris@49: #if (__INTEL_COMPILER <= 1110) Chris@49: #undef ARMA_HAVE_STD_ISFINITE Chris@49: #endif Chris@49: Chris@49: // #undef arma_aligned Chris@49: // #define arma_aligned __attribute__((aligned(16))) Chris@49: Chris@49: #if defined(_MSC_VER) Chris@49: #undef arma_align_mem Chris@49: #define arma_align_mem __declspec(align(16)) Chris@49: #else Chris@49: #undef arma_align_mem Chris@49: #define arma_align_mem __attribute__((aligned(16))) Chris@49: #endif Chris@49: Chris@49: #define ARMA_HAVE_ALIGNED_ATTRIBUTE Chris@49: #define ARMA_HAVE_ICC_ASSUME_ALIGNED Chris@49: Chris@49: #elif defined(__GNUG__) Chris@49: Chris@49: #if (__GNUC__ < 4) Chris@49: #error "*** Need a newer compiler ***" Chris@49: #endif Chris@49: Chris@49: #define ARMA_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) Chris@49: Chris@49: #define ARMA_GOOD_COMPILER Chris@49: #undef ARMA_HAVE_STD_TR1 Chris@49: Chris@49: #undef arma_pure Chris@49: #undef arma_const Chris@49: #undef arma_aligned Chris@49: #undef arma_align_mem Chris@49: #undef arma_warn_unused Chris@49: #undef arma_deprecated Chris@49: #undef arma_malloc Chris@49: #undef arma_inline Chris@49: #undef arma_noinline Chris@49: Chris@49: #define arma_pure __attribute__((__pure__)) Chris@49: #define arma_const __attribute__((__const__)) Chris@49: #define arma_aligned __attribute__((__aligned__)) Chris@49: #define arma_align_mem __attribute__((__aligned__(16))) Chris@49: #define arma_warn_unused __attribute__((__warn_unused_result__)) Chris@49: #define arma_deprecated __attribute__((__deprecated__)) Chris@49: #define arma_malloc __attribute__((__malloc__)) Chris@49: #define arma_inline inline __attribute__((__always_inline__)) Chris@49: #define arma_noinline __attribute__((__noinline__)) Chris@49: Chris@49: #define ARMA_HAVE_ALIGNED_ATTRIBUTE Chris@49: Chris@49: #if (ARMA_GCC_VERSION >= 40300) Chris@49: #undef arma_hot Chris@49: #undef arma_cold Chris@49: Chris@49: #define arma_hot __attribute__((__hot__)) Chris@49: #define arma_cold __attribute__((__cold__)) Chris@49: #endif Chris@49: Chris@49: #if (ARMA_GCC_VERSION >= 40200) Chris@49: #if defined(_GLIBCXX_USE_C99_MATH_TR1) && defined(_GLIBCXX_USE_C99_COMPLEX_TR1) Chris@49: #define ARMA_HAVE_STD_TR1 Chris@49: #endif Chris@49: #endif Chris@49: Chris@49: #if defined(__GXX_EXPERIMENTAL_CXX0X__) Chris@49: #undef ARMA_HAVE_STD_TR1 Chris@49: Chris@49: #if !defined(ARMA_USE_CXX11) Chris@49: #define ARMA_USE_CXX11 Chris@49: #endif Chris@49: #endif Chris@49: Chris@49: #if defined(__clang__) Chris@49: #undef ARMA_HAVE_STD_TR1 Chris@49: //#undef ARMA_GOOD_COMPILER Chris@49: #endif Chris@49: Chris@49: #if ( (ARMA_GCC_VERSION >= 40700) && (ARMA_GCC_VERSION <= 40701) ) Chris@49: #error "gcc versions 4.7.0 and 4.7.1 are unsupported; use 4.7.2 or later" Chris@49: // due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53549 Chris@49: #endif Chris@49: Chris@49: #if (ARMA_GCC_VERSION >= 40700) Chris@49: #define ARMA_HAVE_GCC_ASSUME_ALIGNED Chris@49: // TODO: future versions of clang may also have __builtin_assume_aligned Chris@49: #endif Chris@49: Chris@49: #undef ARMA_GCC_VERSION Chris@49: Chris@49: #endif Chris@49: Chris@49: Chris@49: #if defined(__APPLE__) Chris@49: #define ARMA_BLAS_SDOT_BUG Chris@49: #endif Chris@49: Chris@49: Chris@49: #if defined(_MSC_VER) Chris@49: Chris@49: #if (_MSC_VER < 1500) Chris@49: #error "*** Need a newer compiler ***" Chris@49: #endif Chris@49: Chris@49: #undef ARMA_GOOD_COMPILER Chris@49: #undef ARMA_HAVE_STD_ISFINITE Chris@49: #undef ARMA_HAVE_STD_SNPRINTF Chris@49: #undef ARMA_HAVE_LOG1P Chris@49: #undef ARMA_HAVE_STD_ISINF Chris@49: #undef ARMA_HAVE_STD_ISNAN Chris@49: #undef ARMA_HAVE_STD_TR1 Chris@49: Chris@49: // #undef arma_inline Chris@49: // #define arma_inline inline __forceinline Chris@49: Chris@49: #pragma warning(push) Chris@49: Chris@49: #pragma warning(disable: 4127) // conditional expression is constant Chris@49: #pragma warning(disable: 4510) // default constructor could not be generated Chris@49: #pragma warning(disable: 4511) // copy constructor can't be generated Chris@49: #pragma warning(disable: 4512) // assignment operator can't be generated Chris@49: #pragma warning(disable: 4513) // destructor can't be generated Chris@49: #pragma warning(disable: 4514) // unreferenced inline function has been removed Chris@49: #pragma warning(disable: 4522) // multiple assignment operators specified Chris@49: #pragma warning(disable: 4623) // default constructor can't be generated Chris@49: #pragma warning(disable: 4624) // destructor can't be generated Chris@49: #pragma warning(disable: 4625) // copy constructor can't be generated Chris@49: #pragma warning(disable: 4626) // assignment operator can't be generated Chris@49: #pragma warning(disable: 4710) // function not inlined Chris@49: #pragma warning(disable: 4711) // call was inlined Chris@49: #pragma warning(disable: 4714) // __forceinline can't be inlined Chris@49: Chris@49: #if (_MANAGED == 1) || (_M_CEE == 1) Chris@49: Chris@49: // don't do any alignment when compiling in "managed code" mode Chris@49: Chris@49: #else Chris@49: // #undef arma_aligned Chris@49: // #define arma_aligned __declspec(align(16)) Chris@49: Chris@49: #undef arma_align_mem Chris@49: #define arma_align_mem __declspec(align(16)) Chris@49: Chris@49: #define ARMA_HAVE_ALIGNED_ATTRIBUTE Chris@49: Chris@49: // disable warnings: "structure was padded due to __declspec(align(16))" Chris@49: #pragma warning(disable: 4324) Chris@49: Chris@49: #endif Chris@49: Chris@49: #endif Chris@49: Chris@49: Chris@49: #if defined(__CUDACC__) Chris@49: #undef ARMA_HAVE_STD_ISFINITE Chris@49: #undef ARMA_HAVE_STD_SNPRINTF Chris@49: #undef ARMA_HAVE_LOG1P Chris@49: #undef ARMA_HAVE_STD_ISINF Chris@49: #undef ARMA_HAVE_STD_ISNAN Chris@49: #undef ARMA_HAVE_STD_TR1 Chris@49: #endif Chris@49: Chris@49: Chris@49: #if defined(__SUNPRO_CC) Chris@49: #undef ARMA_HAVE_STD_ISFINITE Chris@49: #undef ARMA_HAVE_STD_SNPRINTF Chris@49: #undef ARMA_HAVE_LOG1P Chris@49: #undef ARMA_HAVE_STD_ISINF Chris@49: #undef ARMA_HAVE_STD_ISNAN Chris@49: #undef ARMA_HAVE_STD_TR1 Chris@49: #endif