GNU bug report logs - #49717
[PATCH] gnu: mesa-opencl-icd: Use absolute path for the library.

Previous Next

Package: guix-patches;

Reported by: Ivan Gankevich <i.gankevich <at> spbu.ru>

Date: Sat, 24 Jul 2021 10:03:02 UTC

Severity: normal

Tags: patch

Done: Guillaume Le Vaillant <glv <at> posteo.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49717 in the body.
You can then email your comments to 49717 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#49717; Package guix-patches. (Sat, 24 Jul 2021 10:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ivan Gankevich <i.gankevich <at> spbu.ru>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 24 Jul 2021 10:03:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ivan Gankevich <i.gankevich <at> spbu.ru>
To: guix-patches <at> gnu.org
Cc: Ivan Gankevich <i.gankevich <at> spbu.ru>
Subject: [PATCH] gnu: mesa-opencl-icd: Use absolute path for the library.
Date: Sat, 24 Jul 2021 13:01:28 +0300
* gnu/packages/gl.scm (mesa-opencl-icd): Use absolute path for OpenCL
  platform library in "mesa.icd" file.  With this patch setting
  LD_LIBRARY_PATH=$LIBRARY_PATH is no longer needed to run OpenCL
  applications.
---
 gnu/packages/gl.scm | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index c14e7c0d53..f693efb36b 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -475,10 +475,26 @@ from software emulation to complete hardware acceleration for modern GPUs.")
   (package/inherit mesa-opencl
     (name "mesa-opencl-icd")
     (arguments
-     (substitute-keyword-arguments (package-arguments mesa)
-       ((#:configure-flags flags)
-        `(cons "-Dgallium-opencl=icd"
-               ,(delete "-Dgallium-opencl=standalone" flags)))))))
+      (substitute-keyword-arguments (package-arguments mesa)
+        ((#:configure-flags flags)
+         `(cons "-Dgallium-opencl=icd"
+                ,(delete "-Dgallium-opencl=standalone" flags)))
+        ((#:phases phases)
+         `(modify-phases ,phases
+            (add-after 'install 'mesa-icd-absolute-path
+              (lambda _
+                ;; Use absolute path for OpenCL platform library.
+                ;; Otherwise we would have to set LD_LIBRARY_PATH=LIBRARY_PATH
+                ;; for ICD in our applications to find OpenCL platform.
+                (use-modules (guix build utils)
+                             (ice-9 textual-ports))
+                (let* ((out (assoc-ref %outputs "out"))
+                       (mesa-icd (string-append out "/etc/OpenCL/vendors/mesa.icd"))
+                       (old-path (call-with-input-file mesa-icd get-string-all))
+                       (new-path (string-append out "/lib/" (string-trim-both old-path))))
+                  (if (file-exists? new-path)
+                    (call-with-output-file mesa-icd
+                      (lambda (port) (format port "~a\n" new-path)))))))))))))
 
 (define-public mesa-headers
   (package/inherit mesa
-- 
2.32.0





Reply sent to Guillaume Le Vaillant <glv <at> posteo.net>:
You have taken responsibility. (Tue, 27 Jul 2021 16:41:01 GMT) Full text and rfc822 format available.

Notification sent to Ivan Gankevich <i.gankevich <at> spbu.ru>:
bug acknowledged by developer. (Tue, 27 Jul 2021 16:41:01 GMT) Full text and rfc822 format available.

Message #10 received at 49717-done <at> debbugs.gnu.org (full text, mbox):

From: Guillaume Le Vaillant <glv <at> posteo.net>
To: Ivan Gankevich <i.gankevich <at> spbu.ru>
Cc: 49717-done <at> debbugs.gnu.org
Subject: Re: [bug#49717] [PATCH] gnu: mesa-opencl-icd: Use absolute path for
 the library.
Date: Tue, 27 Jul 2021 16:40:26 +0000
[Message part 1 (text/plain, inline)]
I added a copyright line and pushed the patch as
8cfd9ef831caff790c837eca87b1164801459108.
Thanks.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 25 Aug 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 244 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.