From dbc266667f117954d78495a3875bf8e95f6bf54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Mon, 22 Jan 2024 00:22:12 +0000 Subject: [PATCH] Update pmix to 4.2.8 Exclude ix86, configure: abort in 32-bit environments https://github.com/openpmix/openpmix/pull/2892 and Open MPI v5.0.x does not support 32 bit https://github.com/open-mpi/ompi/issues/11248 --- construct_event_strings.py | 242 +++++++++++++++++++++++++++++++++++++ pmix.spec | 16 ++- sources | 2 +- 3 files changed, 257 insertions(+), 3 deletions(-) create mode 100644 construct_event_strings.py diff --git a/construct_event_strings.py b/construct_event_strings.py new file mode 100644 index 0000000..52f242f --- /dev/null +++ b/construct_event_strings.py @@ -0,0 +1,242 @@ +# +# Copyright (c) 2020 Intel, Inc. All rights reserved. +# Copyright (c) 2020-2022 Cisco Systems, Inc. All rights reserved +# Copyright (c) 2021-2023 Nanook Consulting. All rights reserved. +# Copyright (c) 2022 Triad National Security, LLC. All rights reserved. +# $COPYRIGHT$ +# +# Construct a dictionary for translating attributes to/from +# their defined name and their string representation - used +# by tools to interpret user input +# + +from __future__ import print_function +import os +import os.path +import sys +from optparse import OptionParser, OptionGroup + +index = 0 + + +def harvest_constants(options, path, constants): + global index + # open the file + try: + inputfile = open(path, "r") + except Exception as e: + print("File {path} could not be opened: {e}" + .format(path=path, e=e)) + return 1 + + # read the file - these files aren't too large + # so ingest the whole thing at one gulp + try: + lines = inputfile.readlines() + except Exception as e: + print("Error reading file {path}: {e}" + .format(path=path, e=e)) + inputfile.close() + return 1 + + inputfile.close() # we read everything, so done with the file + + firstline = True + + # find the start of the event codes + n = 0 + found = False + while n < len(lines): + if "PMIX ERROR CONSTANTS" in lines[n]: + found = True + n = n + 1 + break; + n = n + 1 + # error out if not found + if not found: + print("START OF EVENT CODES NOT FOUND") + return 1 + + # loop over the lines + while n < len(lines): + line = lines[n] + # remove white space at front and back + myline = line.strip() + # remove comment lines + if "/*" in myline or "*/" in myline or myline.startswith("*"): + n = n + 1 + continue + # if we have found the end of the event codes, we are done + if "PMIX_EXTERNAL_ERR_BASE" in myline or "PMIX_ERR_SYS_BASE" in myline or "PMIX_INTERNAL_ERR_DONE" in myline: + return 0 + # skip a well-known macro + if "PMIX_SYSTEM_EVENT" in myline: + n = n + 2 + continue + # if the line starts with #define, then we want it + if not myline.startswith("#define"): + n = n + 1 + continue + + value = myline[8:] + tokens = value.split() + if not firstline: + constants.write(",\n\n") + firstline = False + constants.write(" {.index = " + str(index) + ", .name = \"" + tokens[0] + "\", .code = " + str(tokens[1]) + "}") + index = index + 1 + n = n + 1 + + return 0 + + +def _write_header(options, base_path, num_elements): + contents = '''/* + * This file is autogenerated by construct_event_strings.py. + * Do not edit this file by hand. + */ + +#include "src/include/pmix_config.h" +#include "src/include/pmix_globals.h" +#include "include/pmix_common.h" + +#ifndef PMIX_EVENT_STRINGS_H +#define PMIX_EVENT_STRINGS_H + +BEGIN_C_DECLS + +PMIX_EXPORT extern const pmix_event_string_t pmix_event_strings[{ne}]; + +#define PMIX_EVENT_INDEX_BOUNDARY {nem1} + +END_C_DECLS + +#endif\n +'''.format(ne=num_elements, nem1=num_elements - 1) + + if options.dryrun: + constants = sys.stdout + outpath = None + else: + outpath = os.path.join(base_path, "pmix_event_strings.h") + try: + constants = open(outpath, "w+") + except Exception as e: + print("{outpath} CANNOT BE OPENED - EVENT STRINGS COULD NOT BE CONSTRUCTED: {e}" + .format(outpath=outpath, e=e)) + return 1 + constants.write(contents) + constants.close() + return 0 + + +def main(): + parser = OptionParser("usage: %prog [options]") + debugGroup = OptionGroup(parser, "Debug Options") + debugGroup.add_option("--dryrun", + action="store_true", dest="dryrun", default=False, + help="Show output to screen") + parser.add_option_group(debugGroup) + + (options, args) = parser.parse_args() + + # Find the top-level PMIx source tree dir. + # Start with the location of this script, which we know is in + # $top_srcdir/contrib. + top_src_dir = os.path.dirname(sys.argv[0]) + top_src_dir = os.path.join(top_src_dir, "..") + top_src_dir = os.path.abspath(top_src_dir) + + # Sanity check + checkfile = os.path.join(top_src_dir, "VERSION") + if not os.path.exists(checkfile): + print("ERROR: Could not find top source directory for Open PMIx") + return 1 + + source_include_dir = os.path.join(top_src_dir, "include") + util_include_dir = os.path.join(top_src_dir, "src", "util") + + # This script is invoked from src/include/Makefile.am, and + # therefore the cwd will be $(builddir)/src/include. Verify this + # by checking for a file that we know should be in there. + build_src_include_dir = os.getcwd() + checkfile = os.path.join(build_src_include_dir, "pmix_config.h") + if not os.path.exists(checkfile): + print("ERROR: Could not find build directory for Open PMIx") + return 1 + + if options.dryrun: + constants = sys.stdout + outpath = None + else: + outpath = os.path.join(build_src_include_dir, "pmix_event_strings.c") + try: + constants = open(outpath, "w+") + except Exception as e: + print("{outpath} CANNOT BE OPENED - EVENT STRINGS COULD NOT BE CONSTRUCTED: {e}" + .format(outpath=outpath, e=e)) + return 1 + + # write the source file + constants.write("""/* + * This file is autogenerated by construct_event_strings.py. + * Do not edit this file by hand. + */ + +#include "src/include/pmix_event_strings.h" + +const pmix_event_string_t pmix_event_strings[] = { +""") + + # scan across the header files in the src directory + # looking for events + + # pmix_common.h.in is in the src tree + rc = harvest_constants(options, + os.path.join(source_include_dir, "pmix_common.h.in"), + constants) + if 0 != rc: + constants.close() + if outpath: + os.remove(outpath) + print("HARVEST PMIX_COMMON FAILED - EVENT STRINGS COULD NOT BE CONSTRUCTED") + return 1 + constants.write(",\n\n") + + # pmix_deprecated.h is in the source tree + rc = harvest_constants(options, + os.path.join(source_include_dir, "pmix_deprecated.h"), + constants) + if 0 != rc: + constants.close() + if outpath: + os.remove(outpath) + print("HARVEST PMIX_DEPRECATED FAILED - EVENT STRINGS COULD NOT BE CONSTRUCTED") + return 1 + constants.write(",\n\n") + + # pmix_error.h is in the source tree + rc = harvest_constants(options, + os.path.join(util_include_dir, "pmix_error.h"), + constants) + if 0 != rc: + constants.close() + if outpath: + os.remove(outpath) + print("HARVEST PMIX_ERROR FAILED - EVENT STRINGS COULD NOT BE CONSTRUCTED") + return 1 + + # mark the end of the array + constants.write(""",\n + {.index = UINT32_MAX, .name = "", .code = -1} +}; +""") + constants.write("\n") + constants.close() + + # write the header + return _write_header(options, build_src_include_dir, index + 1) + + +if __name__ == '__main__': + exit(main()) diff --git a/pmix.spec b/pmix.spec index 56167cd..aead38f 100644 --- a/pmix.spec +++ b/pmix.spec @@ -1,10 +1,12 @@ Name: pmix -Version: 4.2.7 -Release: 2%{?dist} +Version: 4.2.8 +Release: 1%{?dist} Summary: Process Management Interface Exascale (PMIx) License: BSD-3-Clause URL: https://pmix.org/ Source0: https://github.com/openpmix/openpmix/releases/download/v%{version}/%{name}-%{version}.tar.bz2 +# file missing from release +Source1: construct_event_strings.py Patch1: https://github.com/openpmix/openpmix/pull/3245.patch BuildRequires: autoconf @@ -19,6 +21,8 @@ BuildRequires: munge-devel BuildRequires: perl-interpreter BuildRequires: zlib-devel +ExcludeArch: %{ix86} + %description The Process Management Interface (PMI) has been used for quite some time as a means of exchanging wireup information needed for interprocess @@ -59,6 +63,7 @@ based starters (e.g., mpirun). %prep %autosetup -p1 +cp %{S:1} contrib/ # touch lexer sources to recompile them find src -name \*.l -print -exec touch --no-create {} \; @@ -116,6 +121,13 @@ find %{buildroot} -name '*.la' | xargs rm -f %{_bindir}/* %changelog +* Sun Jan 21 2024 Sérgio Basto - 4.2.8-1 +- Update pmix to 4.2.8 +- Exclude ix86, configure: abort in 32-bit environments + https://github.com/openpmix/openpmix/pull/2892 + and Open MPI v5.0.x does not support 32 bit + https://github.com/open-mpi/ompi/issues/11248 + * Sun Jan 21 2024 Fedora Release Engineering - 4.2.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - Fix GCC-14 new errors (https://github.com/openpmix/openpmix/pull/3245) diff --git a/sources b/sources index fe303fa..1b0e428 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pmix-4.2.7.tar.bz2) = 119421863c8fca45a531ff86650515d2a761e422d99a3a627e9e4e22d30cbf01e4d65a2d4b7b93904bcf769db7f44a35b8905343d024bd817c966282a3ab8d1a +SHA512 (pmix-4.2.8.tar.bz2) = 2bc78cda82af24a9d7db204684e1778e0db183acc425095a91d46e4253209cec06542d497d5502c502b946b0ed1517f3b34f532d1107ccac1a09f2f267f14089