Use configure_file() to configure version only (#4974)
* Avoid writing build_config.h * Remove build_config.h all together. * Lint.
This commit is contained in:
committed by
Philip Hyunsu Cho
parent
5b1715d97c
commit
f24be2efb4
@@ -84,6 +84,20 @@
|
||||
#define XGBOOST_DEVICE
|
||||
#endif // defined (__CUDA__) || defined(__NVCC__)
|
||||
|
||||
// These check are for Makefile.
|
||||
#if !defined(XGBOOST_MM_PREFETCH_PRESENT) && !defined(XGBOOST_BUILTIN_PREFETCH_PRESENT)
|
||||
/* default logic for software pre-fetching */
|
||||
#if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64))) || defined(__INTEL_COMPILER)
|
||||
// Enable _mm_prefetch for Intel compiler and MSVC+x86
|
||||
#define XGBOOST_MM_PREFETCH_PRESENT
|
||||
#define XGBOOST_BUILTIN_PREFETCH_PRESENT
|
||||
#elif defined(__GNUC__)
|
||||
// Enable __builtin_prefetch for GCC
|
||||
#define XGBOOST_BUILTIN_PREFETCH_PRESENT
|
||||
#endif // GUARDS
|
||||
|
||||
#endif // !defined(XGBOOST_MM_PREFETCH_PRESENT) && !defined()
|
||||
|
||||
/*! \brief namespace of xgboost*/
|
||||
namespace xgboost {
|
||||
/*!
|
||||
@@ -232,7 +246,4 @@ using XGBoostVersionT = int32_t;
|
||||
#endif // DMLC_USE_CXX11 && defined(__GNUC__) && !defined(__clang_version__)
|
||||
} // namespace xgboost
|
||||
|
||||
/* Always keep this #include at the bottom of xgboost/base.h */
|
||||
#include <xgboost/build_config.h>
|
||||
|
||||
#endif // XGBOOST_BASE_H_
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/*!
|
||||
* Copyright 2019 by Contributors
|
||||
* \file build_config.h
|
||||
*
|
||||
* Generated from `cmake/build_config.h.in` by cmake.
|
||||
*/
|
||||
#ifndef XGBOOST_BUILD_CONFIG_H_
|
||||
#define XGBOOST_BUILD_CONFIG_H_
|
||||
|
||||
// These check are for Makefile.
|
||||
#if !defined(XGBOOST_MM_PREFETCH_PRESENT) && !defined(XGBOOST_BUILTIN_PREFETCH_PRESENT)
|
||||
/* default logic for software pre-fetching */
|
||||
#if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64))) || defined(__INTEL_COMPILER)
|
||||
// Enable _mm_prefetch for Intel compiler and MSVC+x86
|
||||
#define XGBOOST_MM_PREFETCH_PRESENT
|
||||
#define XGBOOST_BUILTIN_PREFETCH_PRESENT
|
||||
#elif defined(__GNUC__)
|
||||
// Enable __builtin_prefetch for GCC
|
||||
#define XGBOOST_BUILTIN_PREFETCH_PRESENT
|
||||
#endif // GUARDS
|
||||
|
||||
#endif // !defined(XGBOOST_MM_PREFETCH_PRESENT) && !defined()
|
||||
|
||||
#define XGBOOST_VER_MAJOR 1
|
||||
#define XGBOOST_VER_MINOR 0
|
||||
#define XGBOOST_VER_PATCH 0
|
||||
|
||||
#endif // XGBOOST_BUILD_CONFIG_H_
|
||||
11
include/xgboost/version_config.h
Normal file
11
include/xgboost/version_config.h
Normal file
@@ -0,0 +1,11 @@
|
||||
/*!
|
||||
* Copyright 2019 XGBoost contributors
|
||||
*/
|
||||
#ifndef XGBOOST_VERSION_CONFIG_H_
|
||||
#define XGBOOST_VERSION_CONFIG_H_
|
||||
|
||||
#define XGBOOST_VER_MAJOR 1
|
||||
#define XGBOOST_VER_MINOR 0
|
||||
#define XGBOOST_VER_PATCH 0
|
||||
|
||||
#endif // XGBOOST_VERSION_CONFIG_H_
|
||||
Reference in New Issue
Block a user