From 25bd428e72b048f3f89acc81deff77095b91dcad Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 9 Nov 2021 05:09:10 -0500 Subject: [PATCH] import hwloc-2.2.0-3.el8 --- .gitignore | 1 + .hwloc.metadata | 1 + SOURCES/0001.patch | 74 ---------------------------------------------- SPECS/hwloc.spec | 46 ++++++++++++++++++++++++---- 4 files changed, 42 insertions(+), 80 deletions(-) delete mode 100644 SOURCES/0001.patch diff --git a/.gitignore b/.gitignore index 080fbc1..a97325e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +SOURCES/hwloc-1.11.9.tar.bz2 SOURCES/hwloc-2.2.0.tar.bz2 diff --git a/.hwloc.metadata b/.hwloc.metadata index 75159e1..65d3b20 100644 --- a/.hwloc.metadata +++ b/.hwloc.metadata @@ -1 +1,2 @@ +f403351c2ab08e4a1bef24f466a6e992feb8b0b8 SOURCES/hwloc-1.11.9.tar.bz2 1b87ff3820b28e718dfdca626a1d27521ea613f6 SOURCES/hwloc-2.2.0.tar.bz2 diff --git a/SOURCES/0001.patch b/SOURCES/0001.patch deleted file mode 100644 index 1a8ea8d..0000000 --- a/SOURCES/0001.patch +++ /dev/null @@ -1,74 +0,0 @@ -From: Prarit Bhargava - -Subject: linux: fix support for NUMA node0 being offline - -commit 0114c2b0b3e39265e0829eebfff87ac9f4412fe9 -Author: Brice Goglin -Date: Mon Apr 26 20:35:42 2021 +0200 - - linux: fix support for NUMA node0 being offline - - Just like we didn't support offline CPU#0 until commit - 7bcc273efd50536961ba16d474efca4ae163229b, we need to - support node0 being offline as well. - It's not clear whether it's a new Linux feature or not, - this was reported on a POWER LPAR VM. - - The symptoms are different here because we got no NUMA - nodes at all, hence the core hwloc added a default - machine-wide node. But this node got marked disallowed - by Linux cgroups. Hence load() failed with - "Topology does not contain any NUMA node, aborting!" - - We opportunistically assume node0 is online to avoid - the overhead in the vast majority of cases. If node0 - is missing, we parse "online" to find the first node. - - Thanks to Jirka Hladky for the report. - - Signed-off-by: Brice Goglin - -Signed-off-by: Prarit Bhargava - -diff -urNp hwloc-2.2.0.orig/hwloc/topology-linux.c hwloc-2.2.0/hwloc/topology-linux.c ---- hwloc-2.2.0.orig/hwloc/topology-linux.c 2021-05-10 14:44:42.690559128 -0400 -+++ hwloc-2.2.0/hwloc/topology-linux.c 2021-05-10 14:44:57.858982883 -0400 -@@ -5342,6 +5342,9 @@ static const char *find_sysfs_cpu_path(i - - static const char *find_sysfs_node_path(int root_fd) - { -+ unsigned first; -+ int err; -+ - if (!hwloc_access("/sys/bus/node/devices", R_OK|X_OK, root_fd) - && !hwloc_access("/sys/bus/node/devices/node0/cpumap", R_OK, root_fd)) - return "/sys/bus/node/devices"; -@@ -5350,6 +5353,28 @@ static const char *find_sysfs_node_path( - && !hwloc_access("/sys/devices/system/node/node0/cpumap", R_OK, root_fd)) - return "/sys/devices/system/node"; - -+ /* node0 might be offline, fallback to looking at the first online node. -+ * online contains comma-separated ranges, just read the first number. -+ */ -+ hwloc_debug("Failed to find sysfs node files using node0, looking at online nodes...\n"); -+ err = hwloc_read_path_as_uint("/sys/devices/system/node/online", &first, root_fd); -+ if (err) { -+ hwloc_debug("Failed to find read /sys/devices/system/node/online.\n"); -+ } else { -+ char path[PATH_MAX]; -+ hwloc_debug("Found node#%u as first online node\n", first); -+ -+ snprintf(path, sizeof(path), "/sys/bus/node/devices/node%u/cpumap", first); -+ if (!hwloc_access("/sys/bus/node/devices", R_OK|X_OK, root_fd) -+ && !hwloc_access(path, R_OK, root_fd)) -+ return "/sys/bus/node/devices"; -+ -+ snprintf(path, sizeof(path), "/sys/devices/system/node/node%u/cpumap", first); -+ if (!hwloc_access("/sys/devices/system/node", R_OK|X_OK, root_fd) -+ && !hwloc_access(path, R_OK, root_fd)) -+ return "/sys/devices/system/node"; -+ } -+ - return NULL; - } - diff --git a/SPECS/hwloc.spec b/SPECS/hwloc.spec index 794e014..d51c29c 100644 --- a/SPECS/hwloc.spec +++ b/SPECS/hwloc.spec @@ -1,11 +1,12 @@ Summary: Portable Hardware Locality - portable abstraction of hierarchical architectures Name: hwloc Version: 2.2.0 -Release: 2%{?dist} +Release: 3%{?dist} License: BSD URL: http://www.open-mpi.org/projects/hwloc/ Source0: http://www.open-mpi.org/software/hwloc/v2.0/downloads/%{name}-%{version}.tar.bz2 -Patch0: 0001.patch +Source1: http://www.open-mpi.org/software/hwloc/v1.11/downloads/%{name}-1.11.9.tar.bz2 + Requires: %{name}-libs%{?_isa} = %{version}-%{release} BuildRequires: gcc @@ -79,10 +80,31 @@ Requires: %{name}-plugins%{?_isa} = %{version}-%{release} - GL support - libxml support -%prep -%autosetup -p1 +%package -n compat-hwloc1 +Summary: Compat package for hwloc-1.11.9 +%description -n compat-hwloc1 + This package contains a compat library for hwloc-1.11.9. + +%prep +%setup -q hwloc_src -b 1 %build + +# BUILD THE PACKAGE + +# The ./configure script will support --runstatedir= when generated with +# autoconf 2.70. Until then, tell it about /run using the export: +export runstatedir=/run +%configure --enable-plugins --disable-silent-rules +# Remove rpaths +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +make %{?_smp_mflags} + + +# BUILD THE COMPAT LIBRARY + +cd ../%{name}-1.11.9 # The ./configure script will support --runstatedir= when generated with # autoconf 2.70. Until then, tell it about /run using the export: export runstatedir=/run @@ -93,6 +115,9 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{?_smp_mflags} %install + +# INSTALL THE PACKAGE + make install DESTDIR=%{buildroot} INSTALL="%{__install} -p" # We don't ship .la files. @@ -118,8 +143,11 @@ mv %{buildroot}%{_datadir}/%{name}/hwloc-dump-hwdata.service %{buildroot}%{_unit rm %{buildroot}%{_datadir}/%{name}/hwloc-dump-hwdata.service %endif -%check -LD_LIBRARY_PATH=$PWD/hwloc/.libs make check +# INSTALL THE COMPAT LIBRARY + +cd ../%{name}-1.11.9 +mkdir -p %{buildroot}%{_libdir} +cp ./src/.libs/libhwloc.so.5 %{buildroot}%{_libdir}/ %ifarch %{ix86} x86_64 %post @@ -175,7 +203,13 @@ LD_LIBRARY_PATH=$PWD/hwloc/.libs make check %dir %{_libdir}/%{name} %{_libdir}/%{name}/hwloc* +%files -n compat-hwloc1 +%{_libdir}/libhwloc*so.5* + %changelog +* Wed Jul 7 2021 Prarit Bhargava - 2.2.0-3 +- Add compat-hwloc1 subpackage [1979150] + * Mon May 17 2021 Prarit Bhargava - 2.2.0-2 - Add support for node 0 offline