diff --git a/0002-Update-gloo-for-gcc11-compile.patch b/0002-Update-gloo-for-gcc11-compile.patch new file mode 100644 index 0000000000000000000000000000000000000000..55b46a106657c5942c2adae1764b016ff1162bf4 --- /dev/null +++ b/0002-Update-gloo-for-gcc11-compile.patch @@ -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(), diff --git a/pytorch.spec b/pytorch.spec index 7f747eefffdc92d6b857c6af46ed4e0a7a5b7f3a..713a424eca3ce338177b06d4512d7383350bb5a9 100644 --- a/pytorch.spec +++ b/pytorch.spec @@ -1,13 +1,14 @@ %global _empty_manifest_terminate_build 0 Name: pytorch Version: 1.11.0 -Release: 1 +Release: 2 Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration License: BSD-3 URL: https://pytorch.org/ Source0: https://github.com/pytorch/pytorch/releases/download/v%{version}/pytorch-v%{version}.tar.gz Patch0001: 0001-Remove-breakpad-dependency.patch +Patch0002: 0002-Update-gloo-for-gcc11-compile.patch BuildRequires: g++ Requires: python3-future @@ -85,6 +86,9 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog +* Thu Feb 16 2023 Dongxing Wang - 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 - 1.11.0-1 - upgrade to 1.11.0