all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andy Tai <atai@atai.org>
To: 65630@debbugs.gnu.org
Cc: Andy Tai <atai@atai.org>
Subject: [bug#65630] [PATCH v3 3/4] gnu: onnx: Use G-Expressions.
Date: Sun, 10 Sep 2023 13:01:14 -0700	[thread overview]
Message-ID: <fd00927eff034ac9fad34ddea933b35a46afa179.1694375976.git.atai@atai.org> (raw)
In-Reply-To: <e118be2a4cca96322298560791afc5434f4c2927.1694375976.git.atai@atai.org>

* 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





  parent reply	other threads:[~2023-09-10 20:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30 16:40 [bug#65630] [PATCH] gnu: onnx: Update to 1.14.1 Andy Tai
2023-08-30 17:06 ` [bug#65630] [PATCH v2] " Andy Tai
2023-09-03  3:44 ` [bug#65630] [PATCH v2 1/2] gnu: python-protobuf: Update to 3.20.3 Andy Tai
2023-09-03  3:44   ` [bug#65630] [PATCH v2 2/2] gnu: onnx: Update to 1.14.1 Andy Tai
2023-09-09 13:42     ` [bug#65630] [PATCH] " Ludovic Courtès
2023-09-09 17:53       ` Andy Tai
2023-09-10 20:01 ` [bug#65630] [PATCH v3 1/4] gnu: python-protobuf: Update to 3.20.3 Andy Tai
2023-09-10 20:01   ` [bug#65630] [PATCH v3 2/4] gnu: onnx: Update to 1.14.1 Andy Tai
2023-09-10 20:01   ` Andy Tai [this message]
2023-09-10 20:01   ` [bug#65630] [PATCH v3 4/4] gnu: onnx-optimizer: Update to 0.3.17 Andy Tai
2024-01-04 17:11 ` [bug#65630] Sharlatan Hellseher

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

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

  git send-email \
    --in-reply-to=fd00927eff034ac9fad34ddea933b35a46afa179.1694375976.git.atai@atai.org \
    --to=atai@atai.org \
    --cc=65630@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.