!10 fix issue: I6CF14 pytorch build problem in openEuler:Mainline
From: @desert-sailor Reviewed-by: @sinever Signed-off-by: @sinever
This commit is contained in:
commit
efa58f0d7c
55
0002-Update-gloo-for-gcc11-compile.patch
Normal file
55
0002-Update-gloo-for-gcc11-compile.patch
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
diff -Naur a/third_party/gloo/gloo/common/linux.cc b/third_party/gloo/gloo/common/linux.cc
|
||||||
|
--- a/third_party/gloo/gloo/common/linux.cc 2022-03-11 01:01:52.000000000 +0800
|
||||||
|
+++ b/third_party/gloo/gloo/common/linux.cc 2023-02-16 11:09:11.493631531 +0800
|
||||||
|
@@ -187,29 +187,28 @@
|
||||||
|
static int getInterfaceSpeedGLinkSettings(int sock, struct ifreq* ifr) {
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
|
||||||
|
constexpr auto link_mode_data_nwords = 3 * 127;
|
||||||
|
- struct {
|
||||||
|
- struct ethtool_link_settings req;
|
||||||
|
- __u32 link_mode_data[link_mode_data_nwords];
|
||||||
|
- } ecmd;
|
||||||
|
+ constexpr auto bufsize = sizeof(struct ethtool_link_settings) + sizeof(__u32)*link_mode_data_nwords;
|
||||||
|
+ char buf[bufsize];
|
||||||
|
+ struct ethtool_link_settings* ecmd = (struct ethtool_link_settings*)buf;
|
||||||
|
int rv;
|
||||||
|
|
||||||
|
- ifr->ifr_data = (__caddr_t)&ecmd;
|
||||||
|
- memset(&ecmd, 0, sizeof(ecmd));
|
||||||
|
- ecmd.req.cmd = ETHTOOL_GLINKSETTINGS;
|
||||||
|
+ ifr->ifr_data = (__caddr_t)buf;
|
||||||
|
+ memset(buf, 0, bufsize);
|
||||||
|
+ ecmd->cmd = ETHTOOL_GLINKSETTINGS;
|
||||||
|
|
||||||
|
rv = ioctl(sock, SIOCETHTOOL, ifr);
|
||||||
|
- if (rv < 0 || ecmd.req.link_mode_masks_nwords >= 0) {
|
||||||
|
+ if (rv < 0 || ecmd->link_mode_masks_nwords >= 0) {
|
||||||
|
return SPEED_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
- ecmd.req.cmd = ETHTOOL_GLINKSETTINGS;
|
||||||
|
- ecmd.req.link_mode_masks_nwords = -ecmd.req.link_mode_masks_nwords;
|
||||||
|
+ ecmd->cmd = ETHTOOL_GLINKSETTINGS;
|
||||||
|
+ ecmd->link_mode_masks_nwords = - (ecmd->link_mode_masks_nwords);
|
||||||
|
rv = ioctl(sock, SIOCETHTOOL, ifr);
|
||||||
|
if (rv < 0) {
|
||||||
|
return SPEED_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
- return ecmd.req.speed;
|
||||||
|
+ return ecmd->speed;
|
||||||
|
#else
|
||||||
|
(void)sock;
|
||||||
|
(void)ifr;
|
||||||
|
diff -Naur a/third_party/gloo/gloo/test/tls_tcp_test.cc b/third_party/gloo/gloo/test/tls_tcp_test.cc
|
||||||
|
--- a/third_party/gloo/gloo/test/tls_tcp_test.cc 2022-03-11 01:01:52.000000000 +0800
|
||||||
|
+++ b/third_party/gloo/gloo/test/tls_tcp_test.cc 2023-02-16 11:12:33.779302224 +0800
|
||||||
|
@@ -72,7 +72,7 @@
|
||||||
|
}
|
||||||
|
} catch (::gloo::IoException e) {
|
||||||
|
exception_thrown = true;
|
||||||
|
- ASSERT_THAT(e.what(), ::testing::ContainsRegex("unknown ca"));
|
||||||
|
+ ASSERT_THAT(e.what(), ::testing::ContainsRegex("[unknown ca|Connect timeout|Connection refused]"));
|
||||||
|
} catch (::gloo::EnforceNotMet e) {
|
||||||
|
exception_thrown = true;
|
||||||
|
ASSERT_THAT(e.what(),
|
||||||
@ -1,13 +1,14 @@
|
|||||||
%global _empty_manifest_terminate_build 0
|
%global _empty_manifest_terminate_build 0
|
||||||
Name: pytorch
|
Name: pytorch
|
||||||
Version: 1.11.0
|
Version: 1.11.0
|
||||||
Release: 1
|
Release: 2
|
||||||
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
|
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
|
||||||
License: BSD-3
|
License: BSD-3
|
||||||
URL: https://pytorch.org/
|
URL: https://pytorch.org/
|
||||||
Source0: https://github.com/pytorch/pytorch/releases/download/v%{version}/pytorch-v%{version}.tar.gz
|
Source0: https://github.com/pytorch/pytorch/releases/download/v%{version}/pytorch-v%{version}.tar.gz
|
||||||
|
|
||||||
Patch0001: 0001-Remove-breakpad-dependency.patch
|
Patch0001: 0001-Remove-breakpad-dependency.patch
|
||||||
|
Patch0002: 0002-Update-gloo-for-gcc11-compile.patch
|
||||||
|
|
||||||
BuildRequires: g++
|
BuildRequires: g++
|
||||||
Requires: python3-future
|
Requires: python3-future
|
||||||
@ -85,6 +86,9 @@ mv %{buildroot}/doclist.lst .
|
|||||||
%{_docdir}/*
|
%{_docdir}/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Feb 16 2023 Dongxing Wang <dxwangk@isoftstone.com> - 1.11.0-2
|
||||||
|
- fixes: error: the CXX 11 compiler error (linux.cc flexible array member not at end of struct)
|
||||||
|
|
||||||
* Mon Jun 13 2022 Zhipeng Xie <xiezhipeng1@huawei.com> - 1.11.0-1
|
* Mon Jun 13 2022 Zhipeng Xie <xiezhipeng1@huawei.com> - 1.11.0-1
|
||||||
- upgrade to 1.11.0
|
- upgrade to 1.11.0
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user