From fb6d3924b807478822d28124eec4e0977be84f3e Mon Sep 17 00:00:00 2001 From: kelyons <37812254+kelyons@users.noreply.github.com> Date: Thu, 5 Mar 2026 12:38:06 -0700 Subject: [PATCH] genpapifdef: Resolve install conflict between i686 and x86_64 papi-devel RPMs /usr/include/f77papi.h, /usr/include/f90papi.h, /usr/include/fpapi.h are generated at build time by a perl helper script src/maint/genpapifdef.pl. The order of the keys in the %defs and %presets hashes are not guaranteed by the perl interpreter to be identical on the i686 and x86_64 architectures. This results in a different header file being generated by the genpapifdef.pl script on each architecture. When these files are included in a papi-devel RPM package, RPM views the files as conflicting and will not allow installation of both the i686 and x86_64 packages at the same time. This patch sorts the keys of the %defs and %presets hashes prior to looping through them, which makes the order consistent on i686 and x86_64. Since the order of the keys is consistent, the same header files are produced, RPM no longer views the files as conflicting, and it is possible to install both the i686 and x86_64 papi-devel packages at the same time. Orabug: 39036654 Signed-off-by: Kevin Lyons Reviewed-by: Alex Burmashev --- src/maint/genpapifdef.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/maint/genpapifdef.pl b/src/maint/genpapifdef.pl index 5acfde0ff..ff2e73c1f 100755 --- a/src/maint/genpapifdef.pl +++ b/src/maint/genpapifdef.pl @@ -225,7 +225,7 @@ sub write_defs_fort { printf STDOUT "C General purpose defines\n"; printf STDOUT "C\n\n"; - foreach my $key (keys %defs) { + foreach my $key (sort keys %defs) { # skip unneeded definition if ($key =~ /PAPI_MH_/ || $key =~ /PAPI_PRESET_/ || $key =~ /PAPI_DEF_ITIMER/) { next; } printf STDOUT "#define %-18s %s\n", $key, ($papi_defs{$key} == 0x80000000) ? "((-2147483647) - 1)" : $papi_defs{$key}; @@ -248,7 +248,7 @@ sub write_defs_f77 { printf STDOUT "! General purpose defines\n"; printf STDOUT "!\n\n"; - foreach my $key (keys %defs) { + foreach my $key (sort keys %defs) { # skip unneeded definition if ($key =~ /PAPI_MH_/ || $key =~ /PAPI_PRESET_/ || $key =~ /PAPI_DEF_ITIMER/) { next; } printf STDOUT "INTEGER %-18s\nPARAMETER(%s=%s)\n", $key, $key, ($papi_defs{$key} == 0x80000000) ? "((-2147483647) - 1)" : $papi_defs{$key}; @@ -271,7 +271,7 @@ sub write_defs_f90 { printf STDOUT "! General purpose defines\n"; printf STDOUT "!\n\n"; - foreach my $key (keys %defs) { + foreach my $key (sort keys %defs) { # skip unneeded definition if ($key =~ /PAPI_MH_/ || $key =~ /PAPI_PRESET_/ || $key =~ /PAPI_DEF_ITIMER/) { next; } printf STDOUT "INTEGER, PARAMETER :: %-18s = %s\n", $key, ($papi_defs{$key} == 0x80000000) ? "((-2147483647) - 1)" : $papi_defs{$key}; @@ -286,7 +286,7 @@ sub write_presets_fort { printf STDOUT "C PAPI preset event values\n"; printf STDOUT "C\n\n"; - foreach my $key (keys %presets) { + foreach my $key (sort keys %presets) { if ($papi_presets{$key} == -2147483648) { printf STDOUT "#define %-18s ((-2147483647) - 1)\n", $key; } else { @@ -303,7 +303,7 @@ sub write_presets_f77 { printf STDOUT "! PAPI preset event values\n"; printf STDOUT "!\n\n"; - foreach my $key (keys %presets) { + foreach my $key (sort keys %presets) { if ($papi_presets{$key} == -2147483648) { printf STDOUT "INTEGER %-18s\nPARAMETER(%s=(-2147483647) - 1)\n", $key, $key; } else { @@ -320,7 +320,7 @@ sub write_presets_f90 { printf STDOUT "! PAPI preset event values\n"; printf STDOUT "!\n\n"; - foreach my $key (keys %presets) { + foreach my $key (sort keys %presets) { if ($papi_presets{$key} == -2147483648) { printf STDOUT "INTEGER, PARAMETER :: %-18s = ((-2147483647) - 1)\n", $key; } else {