From patchwork Wed May 12 23:58:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 29272 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 077D327BC82; Thu, 13 May 2021 01:00:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BD3B027BC81 for ; Thu, 13 May 2021 01:00:09 +0100 (BST) Received: from localhost ([::1]:39312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgyls-0001ZE-Vb for patchwork@mira.cbaines.net; Wed, 12 May 2021 20:00:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgylm-0001Yy-Dk for guix-patches@gnu.org; Wed, 12 May 2021 20:00:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgylm-0002VM-4J for guix-patches@gnu.org; Wed, 12 May 2021 20:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lgylm-0007O6-2k for guix-patches@gnu.org; Wed, 12 May 2021 20:00:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48388] [PATCH 1/3] gnu: Add dmlc-core. References: <20210512235649.516594-1-monego@posteo.net> In-Reply-To: <20210512235649.516594-1-monego@posteo.net> Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 May 2021 00:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48388 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48388@debbugs.gnu.org Cc: Vinicius Monego Received: via spool by 48388-submit@debbugs.gnu.org id=B48388.162086396428297 (code B ref 48388); Thu, 13 May 2021 00:00:02 +0000 Received: (at 48388) by debbugs.gnu.org; 12 May 2021 23:59:24 +0000 Received: from localhost ([127.0.0.1]:40889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgyl9-0007ML-RO for submit@debbugs.gnu.org; Wed, 12 May 2021 19:59:24 -0400 Received: from mout02.posteo.de ([185.67.36.66]:37747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgyl8-0007M9-AO for 48388@debbugs.gnu.org; Wed, 12 May 2021 19:59:22 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 8474C2400E5 for <48388@debbugs.gnu.org>; Thu, 13 May 2021 01:59:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1620863956; bh=69WaDf0/HMG4guA2bJQNz/F2M8osnU2/ABRNoKtZVJA=; h=From:To:Cc:Subject:Date:From; b=FNVyLgl3H4W6TKmKkugFARZEC5C4VV6C+J5Qj2TlP1UaBAWv3xqpHc6Eqt7xV2I8T J/xn3GgsiNEx+dU8gaR0N3bCRo1dcYpxT1aTbRh1PVaunxrA2FNDLbi+de0fWtKT5A 8/yFPTJ+SHS9Jha4sXAvS1KoTuORqtp+5CR9VRfF/TX0vdMbMS7sWGMvMNsvl2Sc9l Pqgh6Xloc+BGmteHVv9JhswbE7fotElK/7bDyVMw2owRHtt57C1qT3+E8aXoeJVAVK 9KZuXos/RDThA3y97oUP3x4VA2ALA1WtjxHnac6al5JWQ7TYW4L5M8JEYnL/dQp0zS dRzZ680PmyXRw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FgWwf5R8xz6tm4; Thu, 13 May 2021 01:59:14 +0200 (CEST) From: Vinicius Monego Date: Wed, 12 May 2021 23:58:42 +0000 Message-Id: <20210512235844.516970-1-monego@posteo.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/machine-learning.scm (dmlc-core): New variable. --- gnu/packages/machine-learning.scm | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 837ebbba67..9d6c5505f7 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -1927,6 +1927,38 @@ together building blocks and a subclassing API with an imperative style for advanced research.") (license license:asl2.0))) +(define-public dmlc-core + ;; Version 0.4 is too old for xgboost. + (let ((version "0.5") + (commit "f00e3ec7abc9f293a1b7061157b0a4e22a735cf5") + (revision "0")) + (package + (name "dmlc-core") + (version (git-version version revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dmlc/dmlc-core") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1x4ad1jhn84fywlk031fmv1kxyiscclmrqn9hhj8gz0mh7z9vcrh")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags + (list "-DGOOGLE_TEST=ON"))) + (native-inputs + `(("googletest" ,googletest) + ("python" ,python-wrapper))) + (home-page "https://github.com/dmlc/dmlc-core") + (synopsis "Common bricks library for machine learning") + (description + "DMLC-Core is the backbone library to support all DMLC projects, +offers the bricks to build efficient and scalable distributed machine +learning libraries.") + (license license:asl2.0)))) + (define-public python-iml (package (name "python-iml") From patchwork Wed May 12 23:58:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 29273 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5CDCF27BC82; Thu, 13 May 2021 01:00:19 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BB05A27BC81 for ; Thu, 13 May 2021 01:00:18 +0100 (BST) Received: from localhost ([::1]:39554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgym1-0001kj-Tk for patchwork@mira.cbaines.net; Wed, 12 May 2021 20:00:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgylm-0001Z6-SE for guix-patches@gnu.org; Wed, 12 May 2021 20:00:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57583) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgylm-0002Wv-JB for guix-patches@gnu.org; Wed, 12 May 2021 20:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lgylm-0007OE-HS for guix-patches@gnu.org; Wed, 12 May 2021 20:00:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48388] [PATCH 2/3] gnu: Add xgboost. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 May 2021 00:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48388 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48388@debbugs.gnu.org Cc: Vinicius Monego Received: via spool by 48388-submit@debbugs.gnu.org id=B48388.162086397528323 (code B ref 48388); Thu, 13 May 2021 00:00:02 +0000 Received: (at 48388) by debbugs.gnu.org; 12 May 2021 23:59:35 +0000 Received: from localhost ([127.0.0.1]:40892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgylL-0007Mj-2g for submit@debbugs.gnu.org; Wed, 12 May 2021 19:59:35 -0400 Received: from mout01.posteo.de ([185.67.36.65]:55115) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgylI-0007MV-Nc for 48388@debbugs.gnu.org; Wed, 12 May 2021 19:59:33 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 7EB98240026 for <48388@debbugs.gnu.org>; Thu, 13 May 2021 01:59:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1620863966; bh=RElfYXUTPE2tdCZSEUR0bYB9Tnkabn8+IwOhKWrhM6A=; h=From:To:Cc:Subject:Date:From; b=neqJQd+3UfzxEcd6jfoyQ6tHg8eikFHENHMRIGttsAf/XB1eFWyPCQK93/gGv5Mze qEf4W6NI10hCZOTPOwSEnjDEMiRYJXBjMPpP/LOhkKvCzzvFEKEQb/s1DPYJ7RL3Oy e4QWdBMGvambYm97yEPsKiBV21AzYqOhEt4N64nDJq3Nxl5Bxw2pis0e2z0lth7uy/ Q/tkzVgUy9tjqL0PWAVdV2g8KxzwQE3Q3Zj0vN1OFd4cTXwc3WXiugf+zfeEf0XrOz pS9gmNC6yWjspBL2FQxmDKd/3FGKXNXEvL5eGJ8Z3IY20h9UTIna7mmjzL/Kt/cPRy 1qZMdCuGeQjKg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FgWwr5f2Kz6tm6; Thu, 13 May 2021 01:59:24 +0200 (CEST) From: Vinicius Monego Date: Wed, 12 May 2021 23:58:43 +0000 Message-Id: <20210512235844.516970-2-monego@posteo.net> In-Reply-To: <20210512235844.516970-1-monego@posteo.net> References: <20210512235844.516970-1-monego@posteo.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/machine-learning.scm (xgboost): New variable. --- gnu/local.mk | 2 + gnu/packages/machine-learning.scm | 33 +++++++++ ...xgboost-python-use-system-libxgboost.patch | 69 +++++++++++++++++++ .../xgboost-use-system-dmlc-core.patch | 35 ++++++++++ 4 files changed, 139 insertions(+) create mode 100644 gnu/packages/patches/xgboost-python-use-system-libxgboost.patch create mode 100644 gnu/packages/patches/xgboost-use-system-dmlc-core.patch diff --git a/gnu/local.mk b/gnu/local.mk index 37166bb2fc..e1d382c543 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1823,6 +1823,8 @@ 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-python-use-system-libxgboost.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..fd10de427f 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -1959,6 +1959,39 @@ 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.1") + (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-python-use-system-libxgboost.patch" + "xgboost-use-system-dmlc-core.patch")) + (sha256 + (base32 "0ixacmpcj844c09xigi1vd4rrckld84k32iarvhnvvm6yjih756y")))) + (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 in C++") + (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-python-use-system-libxgboost.patch b/gnu/packages/patches/xgboost-python-use-system-libxgboost.patch new file mode 100644 index 0000000000..992e6bb3fd --- /dev/null +++ b/gnu/packages/patches/xgboost-python-use-system-libxgboost.patch @@ -0,0 +1,69 @@ +From 768192b9c6700f0ae6b750c56b114d7022692a0b Mon Sep 17 00:00:00 2001 +From: Vinicius Monego +Date: Tue, 11 May 2021 19:30:55 -0300 +Subject: [PATCH] Python wrapper: use system libxgboost. + +--- +This patch was extended from the following Debian patch: https://sources.debian.org/src/xgboost/1.2.1-1/debian/patches/setup.py.patch/ + + python-package/setup.py | 4 ++-- + python-package/xgboost/__init__.py | 5 ++--- + python-package/xgboost/libpath.py | 5 +++++ + 3 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/python-package/setup.py b/python-package/setup.py +index a2feb766..b8b78429 100644 +--- a/python-package/setup.py ++++ b/python-package/setup.py +@@ -312,11 +312,11 @@ if __name__ == '__main__': + 'numpy', + 'scipy', + ], +- ext_modules=[CMakeExtension('libxgboost')], ++ # ext_modules=[CMakeExtension('libxgboost')], + cmdclass={ + 'build_ext': BuildExt, + 'sdist': Sdist, +- 'install_lib': InstallLib, ++ # 'install_lib': InstallLib, + 'install': Install + }, + extras_require={ +diff --git a/python-package/xgboost/__init__.py b/python-package/xgboost/__init__.py +index e0ff434d..658e84e6 100644 +--- a/python-package/xgboost/__init__.py ++++ b/python-package/xgboost/__init__.py +@@ -21,9 +21,8 @@ try: + except ImportError: + pass + +-VERSION_FILE = os.path.join(os.path.dirname(__file__), 'VERSION') +-with open(VERSION_FILE) as f: +- __version__ = f.read().strip() ++# This variable will be set during substitution. ++__version__ = '' + + __all__ = ['DMatrix', 'DeviceQuantileDMatrix', 'Booster', + 'train', 'cv', +diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py +index f7a7d9cd..88d9d986 100644 +--- a/python-package/xgboost/libpath.py ++++ b/python-package/xgboost/libpath.py +@@ -19,9 +19,14 @@ def find_lib_path() -> List[str]: + lib_path + List of all found library path to xgboost + """ ++ ++ # This variable will be set during substitution. ++ XGBOOST_PATH = '' ++ + curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__))) + dll_path = [ + # normal, after installation `lib` is copied into Python package tree. ++ os.path.join(XGBOOST_PATH, 'lib'), + os.path.join(curr_path, 'lib'), + # editable installation, no copying is performed. + os.path.join(curr_path, os.path.pardir, os.path.pardir, 'lib'), +-- +2.31.1 + 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..6209ae1f10 --- /dev/null +++ b/gnu/packages/patches/xgboost-use-system-dmlc-core.patch @@ -0,0 +1,35 @@ +From 34167cc105e47589b86b6f62da76e0ab744002dd Mon Sep 17 00:00:00 2001 +From: Vinicius Monego +Date: Tue, 11 May 2021 19:35:30 -0300 +Subject: [PATCH] Use dmlc-core from Guix. + +--- +This patch is a subset from 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 + From patchwork Wed May 12 23:58:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 29274 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 36B9427BC82; Thu, 13 May 2021 01:00:30 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id EFD3F27BC81 for ; Thu, 13 May 2021 01:00:29 +0100 (BST) Received: from localhost ([::1]:39780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgymD-0001tp-77 for patchwork@mira.cbaines.net; Wed, 12 May 2021 20:00:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgyln-0001ZD-6c for guix-patches@gnu.org; Wed, 12 May 2021 20:00:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57584) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgylm-0002Xy-UV for guix-patches@gnu.org; Wed, 12 May 2021 20:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lgylm-0007OL-UY for guix-patches@gnu.org; Wed, 12 May 2021 20:00:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48388] [PATCH 3/3] gnu: Add python-xgboost. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 May 2021 00:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48388 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48388@debbugs.gnu.org Cc: Vinicius Monego Received: via spool by 48388-submit@debbugs.gnu.org id=B48388.162086398328342 (code B ref 48388); Thu, 13 May 2021 00:00:02 +0000 Received: (at 48388) by debbugs.gnu.org; 12 May 2021 23:59:43 +0000 Received: from localhost ([127.0.0.1]:40895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgylS-0007N4-JK for submit@debbugs.gnu.org; Wed, 12 May 2021 19:59:42 -0400 Received: from mout02.posteo.de ([185.67.36.66]:56795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgylQ-0007Mk-EP for 48388@debbugs.gnu.org; Wed, 12 May 2021 19:59:41 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id B967D2400E5 for <48388@debbugs.gnu.org>; Thu, 13 May 2021 01:59:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1620863974; bh=Q2QSvtbR3k465/+kNKjA5fBdXSo2cgDx6VjPMpmhYIY=; h=From:To:Cc:Subject:Date:From; b=iVDlYDDraEyf94ECnTaLb6dxGI1lhx+41OJgBf3k86shAXY0k16mk9Zi8oWdEnlMw e2xxMUspYOol4R3ve/MoztturBnGkeMXMZLEvp1xepDe6tJOcBNahB2zWRbt57bUeT PvQpTBcGH36CWsLV3BuH9P6egeGIRNNNc0SQG52qwvJicJ1PO59bEsOu9Y0CbJZPRG rybmlGB59zRppMf3kA2vG/YCKd1jg0lt09blBn8eHbiK1mfPFW5CzBWFHVMi5J8K+o q2RXz/Mb/ky26Kos6C56NZOthqrZDBonMQuBt2UofNtBasaTeRxbN2/Qito+WZhO+q ABa3pqFqfoO+Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FgWx12nkzz6tm6; Thu, 13 May 2021 01:59:33 +0200 (CEST) From: Vinicius Monego Date: Wed, 12 May 2021 23:58:44 +0000 Message-Id: <20210512235844.516970-3-monego@posteo.net> In-Reply-To: <20210512235844.516970-1-monego@posteo.net> References: <20210512235844.516970-1-monego@posteo.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/machine-learning.scm (python-xgboost): New variable. --- gnu/packages/machine-learning.scm | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index fd10de427f..f7bb01f274 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -1992,6 +1992,66 @@ 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-xgboost + (package + (inherit xgboost) + (name "python-xgboost") + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'preparations + (lambda* (#:key inputs #:allow-other-keys) + ;; Move python-package content to parent directory to silence + ;; some warnings about files not being found if we chdir. + (rename-file "python-package/xgboost" "xgboost") + (rename-file "python-package/README.rst" "README.rst") + (rename-file "python-package/setup.cfg" "setup.cfg") + (rename-file "python-package/setup.py" "setup.py") + + (with-directory-excursion "xgboost" + ;; Version is read from a VERSION file, but that file is not + ;; part of the installation. + (substitute* "__init__.py" + (("__version__ = ''") + (string-append "__version__ = " "'" + ,(package-version xgboost) "'"))) + ;; The Python wrapper expects libxgboost to be found in the + ;; same source from where the wrapper builds. This workaround + ;; allows libxgboost to be used from the xgboost package. + (substitute* "libpath.py" + (("XGBOOST_PATH = ''") + (string-append "XGBOOST_PATH = " + "'" (assoc-ref inputs "xgboost") "'")))) + #t)) + (replace 'check + ;; Python-specific tests are located in tests/python. + (lambda* (#:key inputs outputs #:allow-other-keys) + (add-installed-pythonpath inputs outputs) + (invoke "pytest" "tests/python" + ;; FIXME: CLI tests fail with PermissionError. + "--ignore" "tests/python/test_cli.py" "-k" + (string-append + "not test_cli_regression_demo" + ;; The tests below open a network connection. + " and not test_model_compatibility" + " and not test_get_group" + " and not test_cv_no_shuffle" + " and not test_cv" + " and not test_training" + ;; "'['./runexp.sh']' returned non-zero exit status 1." + " and not test_cli_binary_classification"))))))) + (native-inputs + `(("python-pandas" ,python-pandas) + ("python-pytest" ,python-pytest) + ("python-scikit-learn" ,python-scikit-learn))) + (inputs + `(("xgboost" ,xgboost))) + (propagated-inputs + `(("python-numpy" ,python-numpy) + ("python-scipy" ,python-scipy))) + (synopsis "Python interface for the XGBoost library"))) + (define-public python-iml (package (name "python-iml")