Package: guix-patches;
Reported by: Andy Tai <atai <at> atai.org>
Date: Wed, 30 Aug 2023 16:41:02 UTC
Severity: normal
Tags: patch
Merged with 65650
Done: Greg Hogan <code <at> greghogan.com>
Bug is archived. No further changes may be made.
Message #28 received at 65630 <at> debbugs.gnu.org (full text, mbox):
From: Andy Tai <atai <at> atai.org> To: 65630 <at> debbugs.gnu.org Cc: Andy Tai <atai <at> atai.org> Subject: [PATCH v3 3/4] gnu: onnx: Use G-Expressions. Date: Sun, 10 Sep 2023 13:01:14 -0700
* gnu/packages/machine-learning.scm (onnx)[arguments]: Convert to list of G-Expressions. --- gnu/packages/machine-learning.scm | 88 ++++++++++++++++--------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index c1f5925b11..3c26eb4e64 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -1078,50 +1078,52 @@ (define-public onnx (snippet '(delete-file-recursively "third_party")))) (build-system python-build-system) (arguments - '(#:phases (modify-phases %standard-phases - (add-before 'build 'pass-cmake-arguments - (lambda* (#:key outputs #:allow-other-keys) - ;; Pass options to the CMake-based build process. - (define out - (assoc-ref outputs "out")) - - (define args - ;; Copy arguments from 'cmake-build-system', plus ask - ;; for shared libraries. - (list "-DCMAKE_BUILD_TYPE=RelWithDebInfo" - (string-append "-DCMAKE_INSTALL_PREFIX=" out) - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE" - (string-append "-DCMAKE_INSTALL_RPATH=" out - "/lib") - "-DCMAKE_VERBOSE_MAKEFILE=ON" - "-DONNX_USE_PROTOBUF_SHARED_LIBS=ON" - "-DONNX_OPT_USE_SYSTEM_PROTOBUF=ON" + (list #:phases #~(modify-phases %standard-phases + (add-before 'build 'pass-cmake-arguments + (lambda* (#:key outputs #:allow-other-keys) + ;; Pass options to the CMake-based build process. + (define out + (assoc-ref outputs "out")) + + (define args + ;; Copy arguments from 'cmake-build-system', plus ask + ;; for shared libraries. + (list "-DCMAKE_BUILD_TYPE=RelWithDebInfo" + (string-append "-DCMAKE_INSTALL_PREFIX=" out) + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE" + (string-append "-DCMAKE_INSTALL_RPATH=" out + "/lib") + "-DCMAKE_VERBOSE_MAKEFILE=ON" + "-DONNX_USE_PROTOBUF_SHARED_LIBS=ON" + "-DONNX_OPT_USE_SYSTEM_PROTOBUF=ON" ; force system copy use; - "-DBUILD_SHARED_LIBS=ON")) - - ;; This environment variable is honored by 'setup.py', - ;; which passes it down to 'cmake'. - (setenv "CMAKE_ARGS" (string-join args)) - - ;; This one is honored by 'setup.py' and passed to 'make - ;; -j'. - (setenv "MAX_JOBS" - (number->string (parallel-job-count))))) - (add-before 'check 'make-test-directory-writable - (lambda _ - ;; Make things writable for tests. - (setenv "HOME" (getcwd)) - (for-each make-file-writable - (find-files "onnx/examples" "." - #:directories? #t)))) - (add-after 'install 'install-from-cmake - (lambda _ - ;; Run "make install" in the build tree 'setup.py' - ;; created for CMake so that libonnx.so, - ;; libonnx_proto.so, etc. are installed. - (invoke "make" "install" - "-C" ".setuptools-cmake-build")))))) + "-DBUILD_SHARED_LIBS=ON")) + + ;; This environment variable is honored by 'setup.py', + ;; which passes it down to 'cmake'. + (setenv "CMAKE_ARGS" + (string-join args)) + + ;; This one is honored by 'setup.py' and passed to 'make + ;; -j'. + (setenv "MAX_JOBS" + (number->string (parallel-job-count))))) + (add-before 'check 'make-test-directory-writable + (lambda _ + ;; Make things writable for tests. + (setenv "HOME" + (getcwd)) + (for-each make-file-writable + (find-files "onnx/examples" "." + #:directories? #t)))) + (add-after 'install 'install-from-cmake + (lambda _ + ;; Run "make install" in the build tree 'setup.py' + ;; created for CMake so that libonnx.so, + ;; libonnx_proto.so, etc. are installed. + (invoke "make" "install" "-C" + ".setuptools-cmake-build")))))) (native-inputs (list cmake googletest -- 2.41.0
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.