[R] enable R compile

[R] Enable R build for windows and linux
This commit is contained in:
tqchen
2016-01-10 23:15:18 -08:00
parent 72347e2d45
commit 2dc6c2dc52
16 changed files with 625 additions and 540 deletions

View File

@@ -103,7 +103,7 @@ inline static bool CmpSecond(const std::pair<float, unsigned> &a,
return a.second > b.second;
}
#ifdef XGBOOST_STRICT_R_MODE_
#if XGBOOST_STRICT_R_MODE
// check nan
bool CheckNAN(double v);
double LogGamma(double v);

View File

@@ -6,7 +6,10 @@
#ifndef XGBOOST_COMMON_THREAD_LOCAL_H_
#define XGBOOST_COMMON_THREAD_LOCAL_H_
#if DMLC_ENABLE_STD_THREAD
#include <mutex>
#endif
#include <memory>
#include <vector>
@@ -63,12 +66,19 @@ class ThreadLocalStore {
* \param str the string pointer
*/
void RegisterDelete(T *str) {
#if DMLC_ENABLE_STD_THREAD
std::unique_lock<std::mutex> lock(mutex_);
data_.push_back(str);
lock.unlock();
#else
data_.push_back(str);
#endif
}
#if DMLC_ENABLE_STD_THREAD
/*! \brief internal mutex */
std::mutex mutex_;
#endif
/*!\brief internal data */
std::vector<T*> data_;
};