aboutsummaryrefslogtreecommitdiff
path: root/misc/xgboost
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2019-12-14 21:37:35 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2019-12-14 21:37:35 +0000
commite5b3f48e26055d35bcacce92518227193869db7f (patch)
tree9549a3b5dc1d9f7519d7a6648b126430d5e9c48d /misc/xgboost
parent284a16829f7ce38baa47945271e63c060ad90c5e (diff)
downloadports-e5b3f48e26055d35bcacce92518227193869db7f.tar.gz
ports-e5b3f48e26055d35bcacce92518227193869db7f.zip
Notes
Diffstat (limited to 'misc/xgboost')
-rw-r--r--misc/xgboost/Makefile35
-rw-r--r--misc/xgboost/distinfo7
-rw-r--r--misc/xgboost/files/patch-CMakeLists.txt26
-rw-r--r--misc/xgboost/files/patch-rabit_CMakeLists.txt34
-rw-r--r--misc/xgboost/files/patch-src_common_json.cc11
-rw-r--r--misc/xgboost/files/patch-src_common_timer.cc14
-rw-r--r--misc/xgboost/pkg-descr5
-rw-r--r--misc/xgboost/pkg-plist46
8 files changed, 178 insertions, 0 deletions
diff --git a/misc/xgboost/Makefile b/misc/xgboost/Makefile
new file mode 100644
index 000000000000..05fe53cb3463
--- /dev/null
+++ b/misc/xgboost/Makefile
@@ -0,0 +1,35 @@
+# $FreeBSD$
+
+PORTNAME= xgboost
+DISTVERSIONPREFIX= v
+DISTVERSION= 0.90-235
+DISTVERSIONSUFFIX= -gad4a1c73
+CATEGORIES= misc # machine-learning
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT, GBM)
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+LIB_DEPENDS= libdmlc.so:devel/dmlc-core
+
+USES= cmake compiler:c++11-lang localbase
+USE_GITHUB= yes
+GH_ACCOUNT= dmlc
+GH_TUPLE= dmlc:rabit:2f25347:rabit/rabit \
+ NVlabs:cub:b20808b:cub/cub
+USE_LDCONFIG= yes
+
+LDFLAGS+= ${LOCALBASE}/lib/libdmlc.so -lexecinfo
+
+OPTIONS_DEFINE= OPENMP
+
+OPENMP_CMAKE_BOOL= USE_OPENMP
+OPENMP_LIB_DEPENDS= libomp.so:devel/openmp
+OPENMP_BROKEN= error: unsupported argument 'libomp -I/usr/local/include -L/usr/local/lib' to option 'fopenmp='
+
+post-patch: # https://github.com/dmlc/rabit/issues/131
+ @${FIND} ${WRKSRC} -name "*.h" -o -name "*.cc" | ${XARGS} ${REINPLACE_CMD} -i '' -e 's| _assert(| _xassert(|; s| _assert)| _xassert)|'
+
+.include <bsd.port.mk>
diff --git a/misc/xgboost/distinfo b/misc/xgboost/distinfo
new file mode 100644
index 000000000000..618d0db125bc
--- /dev/null
+++ b/misc/xgboost/distinfo
@@ -0,0 +1,7 @@
+TIMESTAMP = 1576356559
+SHA256 (dmlc-xgboost-v0.90-235-gad4a1c73_GH0.tar.gz) = c5fd4f9c152ba56961a43b677397251f20f78e534571926247f8d24275f9642b
+SIZE (dmlc-xgboost-v0.90-235-gad4a1c73_GH0.tar.gz) = 1131611
+SHA256 (dmlc-rabit-2f25347_GH0.tar.gz) = 9a9f9b754d1f8f8f0949faded75859e791cc56c75c38928467649fc227bee7e0
+SIZE (dmlc-rabit-2f25347_GH0.tar.gz) = 90555
+SHA256 (NVlabs-cub-b20808b_GH0.tar.gz) = 5d613bf9c4bd3f60803720b982291c585e5e9cce83a93b5ef576bd3ce6d141e4
+SIZE (NVlabs-cub-b20808b_GH0.tar.gz) = 390976
diff --git a/misc/xgboost/files/patch-CMakeLists.txt b/misc/xgboost/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..1641729409de
--- /dev/null
+++ b/misc/xgboost/files/patch-CMakeLists.txt
@@ -0,0 +1,26 @@
+--- CMakeLists.txt.orig 2019-12-14 20:50:22 UTC
++++ CMakeLists.txt
+@@ -101,16 +101,16 @@ endif (USE_CUDA)
+
+ # dmlc-core
+ msvc_use_static_runtime()
+-add_subdirectory(${xgboost_SOURCE_DIR}/dmlc-core)
+-set_target_properties(dmlc PROPERTIES
+- CXX_STANDARD 11
+- CXX_STANDARD_REQUIRED ON
+- POSITION_INDEPENDENT_CODE ON)
+-list(APPEND LINKED_LIBRARIES_PRIVATE dmlc)
++#add_subdirectory(${xgboost_SOURCE_DIR}/dmlc-core)
++#set_target_properties(dmlc PROPERTIES
++# CXX_STANDARD 11
++# CXX_STANDARD_REQUIRED ON
++# POSITION_INDEPENDENT_CODE ON)
++#list(APPEND LINKED_LIBRARIES_PRIVATE dmlc)
+
+ # rabit
+ set(RABIT_BUILD_DMLC OFF)
+-set(DMLC_ROOT ${xgboost_SOURCE_DIR}/dmlc-core)
++set(DMLC_ROOT ${CMAKE_INSTALL_PREFIX})
+ set(RABIT_WITH_R_LIB ${R_LIB})
+ add_subdirectory(rabit)
+
diff --git a/misc/xgboost/files/patch-rabit_CMakeLists.txt b/misc/xgboost/files/patch-rabit_CMakeLists.txt
new file mode 100644
index 000000000000..72c6dfe368d0
--- /dev/null
+++ b/misc/xgboost/files/patch-rabit_CMakeLists.txt
@@ -0,0 +1,34 @@
+--- rabit/CMakeLists.txt.orig 2019-12-14 20:43:47 UTC
++++ rabit/CMakeLists.txt
+@@ -13,7 +13,7 @@ set(DMLC_ROOT ${CMAKE_CURRENT_LIST_DIR}/../dmlc-core)
+
+ # moved from xgboost build
+ if(R_LIB OR MINGW OR WIN32)
+- add_library(rabit src/engine_empty.cc src/c_api.cc)
++ add_library(rabit SHARED src/engine_empty.cc src/c_api.cc)
+ set(rabit_libs rabit)
+ set_target_properties(rabit
+ PROPERTIES CXX_STANDARD 11
+@@ -21,10 +21,10 @@ if(R_LIB OR MINGW OR WIN32)
+ POSITION_INDEPENDENT_CODE ON)
+ else()
+ find_package(Threads REQUIRED)
+- add_library(rabit_empty src/engine_empty.cc src/c_api.cc)
+- add_library(rabit_base src/allreduce_base.cc src/engine_base.cc src/c_api.cc)
++ add_library(rabit_empty SHARED src/engine_empty.cc src/c_api.cc)
++ add_library(rabit_base SHARED src/allreduce_base.cc src/engine_base.cc src/c_api.cc)
+
+- add_library(rabit src/allreduce_base.cc src/allreduce_robust.cc src/engine.cc src/c_api.cc)
++ add_library(rabit SHARED src/allreduce_base.cc src/allreduce_robust.cc src/engine.cc src/c_api.cc)
+ add_library(rabit_mock_static src/allreduce_base.cc src/allreduce_robust.cc src/engine_mock.cc src/c_api.cc)
+ add_library(rabit_mock SHARED src/allreduce_base.cc src/allreduce_robust.cc src/engine_mock.cc src/c_api.cc)
+ target_link_libraries(rabit Threads::Threads)
+@@ -43,7 +43,7 @@ if(RABIT_BUILD_MPI)
+ if (NOT MPI_CXX_FOUND)
+ message(FATAL_ERROR "CXX Interface for MPI is required for building MPI backend.")
+ endif (NOT MPI_CXX_FOUND)
+- add_library(rabit_mpi src/engine_mpi.cc ${MPI_INCLUDE_PATH})
++ add_library(rabit_mpi SHARED src/engine_mpi.cc ${MPI_INCLUDE_PATH})
+ target_link_libraries(rabit_mpi ${MPI_CXX_LIBRARIES})
+ list(APPEND rabit_libs rabit_mpi)
+ endif()
diff --git a/misc/xgboost/files/patch-src_common_json.cc b/misc/xgboost/files/patch-src_common_json.cc
new file mode 100644
index 000000000000..25e750cf9280
--- /dev/null
+++ b/misc/xgboost/files/patch-src_common_json.cc
@@ -0,0 +1,11 @@
+--- src/common/json.cc.orig 2019-12-14 20:32:28 UTC
++++ src/common/json.cc
+@@ -630,7 +630,7 @@ Json JsonReader::ParseNumber() {
+ // multiply zero by inf which gives nan.
+ if (f != 0.0) {
+ // Only use exp10 from libc on gcc+linux
+-#if !defined(__GNUC__) || defined(_WIN32) || defined(__APPLE__)
++#if !defined(__GNUC__) || defined(_WIN32) || defined(__APPLE__) || defined(__FreeBSD__)
+ #define exp10(val) std::pow(10, (val))
+ #endif // !defined(__GNUC__) || defined(_WIN32) || defined(__APPLE__)
+ f *= exp10(exponent);
diff --git a/misc/xgboost/files/patch-src_common_timer.cc b/misc/xgboost/files/patch-src_common_timer.cc
new file mode 100644
index 000000000000..8ed4ea329c3a
--- /dev/null
+++ b/misc/xgboost/files/patch-src_common_timer.cc
@@ -0,0 +1,14 @@
+--- src/common/timer.cc.orig 2019-12-14 20:35:26 UTC
++++ src/common/timer.cc
+@@ -44,8 +44,9 @@ std::vector<Monitor::StatMap> Monitor::CollectFromOthe
+ statistic[kv.first] = Object();
+ auto& j_pair = statistic[kv.first];
+ j_pair["count"] = Integer(kv.second.count);
+- j_pair["elapsed"] = Integer(std::chrono::duration_cast<std::chrono::microseconds>(
+- kv.second.timer.elapsed).count());
++ // https://github.com/dmlc/xgboost/issues/5117
++ j_pair["elapsed"] = 1; //Integer(std::chrono::duration_cast<std::chrono::microseconds>(
++ //kv.second.timer.elapsed).count());
+ }
+
+ std::stringstream ss;
diff --git a/misc/xgboost/pkg-descr b/misc/xgboost/pkg-descr
new file mode 100644
index 000000000000..bba4247ecd28
--- /dev/null
+++ b/misc/xgboost/pkg-descr
@@ -0,0 +1,5 @@
+Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM)
+Library, for Python, R, Java, Scala, C++ and more. Runs on single machine,
+Hadoop, Spark, Flink and DataFlow.
+
+WWW: https://xgboost.ai/
diff --git a/misc/xgboost/pkg-plist b/misc/xgboost/pkg-plist
new file mode 100644
index 000000000000..f45367aad952
--- /dev/null
+++ b/misc/xgboost/pkg-plist
@@ -0,0 +1,46 @@
+bin/xgboost
+include/rabit/c_api.h
+include/rabit/internal/engine.h
+include/rabit/internal/io.h
+include/rabit/internal/rabit-inl.h
+include/rabit/internal/socket.h
+include/rabit/internal/thread_local.h
+include/rabit/internal/timer.h
+include/rabit/internal/utils.h
+include/rabit/rabit.h
+include/rabit/serializable.h
+include/xgboost/base.h
+include/xgboost/c_api.h
+include/xgboost/data.h
+include/xgboost/feature_map.h
+include/xgboost/gbm.h
+include/xgboost/generic_parameters.h
+include/xgboost/host_device_vector.h
+include/xgboost/json.h
+include/xgboost/json_io.h
+include/xgboost/learner.h
+include/xgboost/linear_updater.h
+include/xgboost/logging.h
+include/xgboost/metric.h
+include/xgboost/model.h
+include/xgboost/objective.h
+include/xgboost/parameter.h
+include/xgboost/predictor.h
+include/xgboost/span.h
+include/xgboost/tree_model.h
+include/xgboost/tree_updater.h
+include/xgboost/version_config.h
+lib/cmake/rabit/rabitConfig.cmake
+lib/cmake/rabit/rabitConfigVersion.cmake
+lib/cmake/rabit/rabitTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/rabit/rabitTargets.cmake
+lib/cmake/xgboost/XGBoostTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/xgboost/XGBoostTargets.cmake
+lib/cmake/xgboost/xgboost-config-version.cmake
+lib/cmake/xgboost/xgboost-config.cmake
+lib/librabit.so
+lib/librabit_base.so
+lib/librabit_empty.so
+lib/librabit_mock.so
+lib/librabit_mock_static.a
+lib/libxgboost.so