~ruther/guix-local

09e78c34af071f1c0b09d673ed243829739a9239 — David Elsing 1 year, 4 months ago a0a9044
gnu: python-pytorch-for-r-torch: Fix build.

The build fails because the types of function pointers with return type
'__m256' and 'const __m256' (or '__m512' and 'const __m512') are not treated
as compatible by the compiler.

* gnu/packages/machine-learning.scm (python-pytorch-for-r-torch)
[arguments]: New field.
[inputs]: Add foxi.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
1 files changed, 12 insertions(+), 0 deletions(-)

M gnu/packages/machine-learning.scm
M gnu/packages/machine-learning.scm => gnu/packages/machine-learning.scm +12 -0
@@ 5128,11 5128,23 @@ Note: currently this package does not provide GPU support.")
    (name "python-pytorch")
    (version %python-pytorch-for-r-torch-version)
    (source %python-pytorch-for-r-torch-src)
    (arguments
     (substitute-keyword-arguments (package-arguments python-pytorch)
       ((#:phases phases)
        #~(modify-phases #$phases
            ;; See https://github.com/pytorch/pytorch/issues/61244
            (add-after 'unpack 'fix-aten-vec
              (lambda _
                (substitute*
                    '("aten/src/ATen/cpu/vec/vec512/vec512_bfloat16.h"
                      "aten/src/ATen/cpu/vec/vec256/vec256_bfloat16.h")
                  (("map\\(const __") "map(__"))))))))
    (native-inputs
     (modify-inputs (package-native-inputs python-pytorch)
       (replace "ideep-pytorch" ideep-pytorch-for-r-torch)))
    (inputs
     (modify-inputs (package-inputs python-pytorch)
       (prepend foxi)
       (prepend qnnpack)
       (replace "qnnpack-pytorch" qnnpack-pytorch-for-r-torch)
       (replace "oneapi-dnnl" oneapi-dnnl-for-r-torch)