diff --git a/src/common/algorithm.h b/src/common/algorithm.h index 937b6b638..739a84968 100644 --- a/src/common/algorithm.h +++ b/src/common/algorithm.h @@ -13,7 +13,8 @@ #include "xgboost/context.h" // Context // clang with libstdc++ works as well -#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__sun) && !defined(sun) && !defined(__APPLE__) +#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__sun) && !defined(sun) && \ + !defined(__APPLE__) && __has_include() #define GCC_HAS_PARALLEL 1 #endif // GLIC_VERSION