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:
Jiaming Yuan
2019-10-23 02:47:00 -04:00
committed by Philip Hyunsu Cho
parent 5b1715d97c
commit f24be2efb4
14 changed files with 74 additions and 68 deletions

View File

@@ -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_

View File

@@ -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_

View 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_