From 73500859556a13ad0d7b6396334ea0b37fc74db0 Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Sat, 8 Jul 2017 11:17:31 -0500 Subject: [PATCH] Fix broken make on windows (#2499) * fix Makefile for make on windows * clean up compilation warnings * fix for `no file name for include` make warning --- Makefile | 6 +++++- include/xgboost/tree_model.h | 2 +- src/tree/updater_fast_hist.cc | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d819125d7..22a0adc3f 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,9 @@ endif include $(DMLC_CORE)/make/dmlc.mk # include the plugins +ifdef XGB_PLUGINS include $(XGB_PLUGINS) +endif # set compiler defaults for OSX versus *nix # let people override either @@ -70,13 +72,15 @@ endif ifeq ($(UNAME), Windows) XGBOOST_DYLIB = lib/libxgboost.dll JAVAINCFLAGS += -I${JAVA_HOME}/include/win32 -else ifeq ($(UNAME), Darwin) +else +ifeq ($(UNAME), Darwin) XGBOOST_DYLIB = lib/libxgboost.dylib CFLAGS += -fPIC else XGBOOST_DYLIB = lib/libxgboost.so CFLAGS += -fPIC endif +endif ifeq ($(UNAME), Linux) LDFLAGS += -lrt diff --git a/include/xgboost/tree_model.h b/include/xgboost/tree_model.h index e9319c4ff..74cbed2e2 100644 --- a/include/xgboost/tree_model.h +++ b/include/xgboost/tree_model.h @@ -588,7 +588,7 @@ inline bst_float RegTree::FillNodeMeanValue(int nid) { inline void RegTree::CalculateContributions(const RegTree::FVec& feat, unsigned root_id, bst_float *out_contribs) const { - CHECK_GT(this->node_mean_values.size(), 0); + CHECK_GT(this->node_mean_values.size(), 0U); // this follows the idea of http://blog.datadive.net/interpreting-random-forests/ bst_float node_value; unsigned split_index; diff --git a/src/tree/updater_fast_hist.cc b/src/tree/updater_fast_hist.cc index 95c2142a8..81f0b36d1 100644 --- a/src/tree/updater_fast_hist.cc +++ b/src/tree/updater_fast_hist.cc @@ -324,7 +324,7 @@ class FastHistMaker: public TreeUpdater { std::numeric_limits::infinity()); } - CHECK_GT(out_preds.size(), 0); + CHECK_GT(out_preds.size(), 0U); for (const RowSetCollection::Elem rowset : row_set_collection_) { if (rowset.begin != nullptr && rowset.end != nullptr) {