Disable gcc parallel extension if openmp is not available. (#8871)
`<parallel/algorithm>` internally includes the <omp.h> header, which leads to an error when openmp is not available.
This commit is contained in:
parent
228a46e8ad
commit
cad7401783
@ -13,7 +13,8 @@
|
|||||||
#include "xgboost/context.h" // Context
|
#include "xgboost/context.h" // Context
|
||||||
|
|
||||||
// clang with libstdc++ works as well
|
// 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(<omp.h>)
|
||||||
#define GCC_HAS_PARALLEL 1
|
#define GCC_HAS_PARALLEL 1
|
||||||
#endif // GLIC_VERSION
|
#endif // GLIC_VERSION
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user