unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Vinicius Monego <monego@posteo.net>
To: 48388@debbugs.gnu.org
Cc: Vinicius Monego <monego@posteo.net>
Subject: [bug#48388] [PATCH v3 2/3] gnu: Add xgboost.
Date: Sun, 27 Jun 2021 17:30:46 +0000	[thread overview]
Message-ID: <20210627173047.2576-2-monego@posteo.net> (raw)
In-Reply-To: <20210627173047.2576-1-monego@posteo.net>

* gnu/packages/machine-learning.scm (xgboost): New variable.
* gnu/packages/patches/xgboost-use-system-dmlc-core.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
---
Removed the python patch, updated to 1.4.2 and removed "in C++" from synopsis.

 gnu/local.mk                                  |  1 +
 gnu/packages/machine-learning.scm             | 32 +++++++++++++++++
 .../xgboost-use-system-dmlc-core.patch        | 34 +++++++++++++++++++
 3 files changed, 67 insertions(+)
 create mode 100644 gnu/packages/patches/xgboost-use-system-dmlc-core.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f7ff9af997..19db9787dc 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1842,6 +1842,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/xf86-video-voodoo-pcitag.patch		\
   %D%/packages/patches/xfce4-panel-plugins.patch		\
   %D%/packages/patches/xfce4-settings-defaults.patch		\
+  %D%/packages/patches/xgboost-use-system-dmlc-core.patch       \
   %D%/packages/patches/xmonad-dynamic-linking.patch		\
   %D%/packages/patches/xplanet-1.3.1-cxx11-eof.patch		\
   %D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch	\
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 9d6c5505f7..bbdfba960e 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1959,6 +1959,38 @@ offers the bricks to build efficient and scalable distributed machine
 learning libraries.")
       (license license:asl2.0))))
 
+(define-public xgboost
+  (package
+    (name "xgboost")
+    (version "1.4.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/dmlc/xgboost")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (patches (search-patches "xgboost-use-system-dmlc-core.patch"))
+       (sha256
+        (base32 "00liz816ahk9zj3jv3m2fqwlf6xxfbgvpmpl72iklx32vl192w5d"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:configure-flags (list "-DGOOGLE_TEST=ON")))
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("python" ,python-wrapper)))
+    (inputs
+     `(("dmlc-core" ,dmlc-core)))
+    (home-page "https://xgboost.ai/")
+    (synopsis "Gradient boosting (GBDT, GBRT or GBM) library")
+    (description
+     "XGBoost is an optimized distributed gradient boosting library designed
+to be highly efficient, flexible and portable.  It implements machine learning
+algorithms under the Gradient Boosting framework.  XGBoost provides a parallel
+tree boosting (also known as GBDT, GBM) that solve many data science problems
+in a fast and accurate way.")
+    (license license:asl2.0)))
+
 (define-public python-iml
   (package
     (name "python-iml")
diff --git a/gnu/packages/patches/xgboost-use-system-dmlc-core.patch b/gnu/packages/patches/xgboost-use-system-dmlc-core.patch
new file mode 100644
index 0000000000..c654694fec
--- /dev/null
+++ b/gnu/packages/patches/xgboost-use-system-dmlc-core.patch
@@ -0,0 +1,34 @@
+From 34167cc105e47589b86b6f62da76e0ab744002dd Mon Sep 17 00:00:00 2001
+From: Vinicius Monego <monego@posteo.net>
+Date: Tue, 11 May 2021 19:35:30 -0300
+Subject: [PATCH] Use dmlc-core from Guix.
+
+---
+This patch is a subset of the following Debian patch: https://sources.debian.org/src/xgboost/1.2.1-1/debian/patches/cmake.patch/
+
+Rabit is now developed as part of xgboost, so we don't build it separately.
+
+ CMakeLists.txt | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6cc19fbd..3b42bc17 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -150,11 +150,9 @@ endif (USE_OPENMP)
+
+ # dmlc-core
+ msvc_use_static_runtime()
+-add_subdirectory(${xgboost_SOURCE_DIR}/dmlc-core)
+-set_target_properties(dmlc PROPERTIES
+-  CXX_STANDARD 14
+-  CXX_STANDARD_REQUIRED ON
+-  POSITION_INDEPENDENT_CODE ON)
++add_library(dmlc SHARED IMPORTED)
++find_library(DMLC_LIBRARY dmlc)
++set_property(TARGET dmlc PROPERTY IMPORTED_LOCATION "${DMLC_LIBRARY}")
+ if (MSVC)
+   target_compile_options(dmlc PRIVATE
+                          -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE)
+--
+2.31.1
-- 
2.32.0





  reply	other threads:[~2021-06-27 18:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 23:56 [bug#48388] [PATCH 0/3] Add xgboost Vinicius Monego
2021-05-12 23:58 ` [bug#48388] [PATCH 1/3] gnu: Add dmlc-core Vinicius Monego
2021-05-12 23:58   ` [bug#48388] [PATCH 2/3] gnu: Add xgboost Vinicius Monego
2021-05-12 23:58   ` [bug#48388] [PATCH 3/3] gnu: Add python-xgboost Vinicius Monego
2021-05-13 15:29 ` [bug#48388] [PATCH v2 2/3] gnu: Add xgboost Vinicius Monego
2021-05-13 15:29   ` [bug#48388] [PATCH v2 3/3] gnu: Add python-xgboost Vinicius Monego
2021-06-27 17:30 ` [bug#48388] [PATCH v3 1/3] gnu: Add dmlc-core Vinicius Monego
2021-06-27 17:30   ` Vinicius Monego [this message]
2021-06-27 17:30   ` [bug#48388] [PATCH v3 3/3] gnu: Add python-xgboost Vinicius Monego
2021-06-27 23:11 ` [bug#48388] [PATCH v4 " Vinicius Monego
2021-09-25 19:36 ` [bug#48388] [PATCH v5 1/3] gnu: Add dmlc-core Vinicius Monego
2021-09-25 19:36   ` [bug#48388] [PATCH v5 2/3] gnu: Add xgboost Vinicius Monego
2021-09-25 19:36   ` [bug#48388] [PATCH v5 3/3] gnu: Add python-xgboost Vinicius Monego
2021-09-25 20:14   ` bug#48388: [PATCH v5 1/3] gnu: Add dmlc-core Leo Famulari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210627173047.2576-2-monego@posteo.net \
    --to=monego@posteo.net \
    --cc=48388@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).