gnu: python-pytorch: Fix build with GCC 14.

Fixes guix/guix#1593.

* gnu/packages/machine-learning.scm (python-pytorch)[arguments]: Add
missing <algorithm> header in 'use-system-libraries phase to fix
std::for_each compilation error with GCC 14.

Signed-off-by: Danny Milosavljevic <dannym@friendly-machines.com>
This commit is contained in:
Ayan Das 2025-07-29 09:48:13 +05:30 committed by Danny Milosavljevic
parent bb5ca7f0e4
commit 9fdf0800f5
No known key found for this signature in database
GPG key ID: E71A35542C30BAA5

View file

@ -5152,6 +5152,10 @@ PyTorch.")
(substitute* "aten/src/ATen/native/vulkan/api/Allocator.h"
(("<include/vk_mem_alloc.h>")
"<vk_mem_alloc.h>"))
;; Fix missing <algorithm> header for std::for_each in Vulkan API
(substitute* "aten/src/ATen/native/vulkan/api/QueryPool.cpp"
(("#include <utility>" all)
(string-append all "\n#include <algorithm>")))
;; For Vulkan
(substitute* "CMakeLists.txt"
(("append_cxx_flag.*-Werror=(return-type|range-loop-construct).*") ""))