openmpi: fix pmix version check in v5 (#44928)

* OpenMPI 5 w/ PRRTE 3 series PMIX version check fix

OpenMPI fails to compile otherwise when targeting external PMIX 4.2.6 and likely others.

```
  >> 3369    base/ess_base_bootstrap.c:72:14: error: static declaration of 'pmix_getline' follows non-static declaration
     3370       72 | static char *pmix_getline(FILE *fp)
     3371          |              ^
     3372    /opt/pmix/include/pmix/src/util/pmix_string_copy.h:83:19: note: previous declaration is here
     3373       83 | PMIX_EXPORT char *pmix_getline(FILE *fp);
     3374          |                   ^
     3375    1 error generated.
  >> 3376    make[4]: *** [Makefile:820: base/ess_base_bootstrap.lo] Error 1
```

Upstream PRRTE fix (not released yet): https://github.com/openpmix/prrte/pull/1957
Upstream OpenMPI issue: https://github.com/open-mpi/ompi/issues/12537 ("fixed in next release")

Co-authored-by: Shahzeb Siddiqui <shahzebmsiddiqui@gmail.com>
This commit is contained in:
Matthew Lesko 2024-07-16 00:33:12 -04:00 committed by GitHub
parent 318a7e0e30
commit 9a22ae11c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 72 additions and 0 deletions

View File

@ -433,6 +433,12 @@ class Openmpi(AutotoolsPackage, CudaPackage):
patch("btlsmcuda-fix-problem-with-makefile.patch", when="@5.0.0")
patch("accelerator-build-components-as-dso-s-by-default.patch", when="@5.0.0:5.0.1")
# OpenMPI 5.0.0-5.0.3 needs to change PMIX version check to compile w/ PMIX > 4.2.5
# https://github.com/open-mpi/ompi/issues/12537#issuecomment-2103350910
# https://github.com/openpmix/prrte/pull/1957
patch("pmix_getline_pmix_version.patch", when="@5.0.0:5.0.3")
patch("pmix_getline_pmix_version-prte.patch", when="@5.0.3")
variant(
"fabrics",
values=disjoint_sets(

View File

@ -0,0 +1,14 @@
diff --git a/3rd-party/prrte/src/tools/prte/prte.c b/3rd-party/prrte/src/tools/prte/prte.c
index 3c62ef4b66..d15347d324 100644
--- a/3rd-party/prrte/src/tools/prte/prte.c
+++ b/3rd-party/prrte/src/tools/prte/prte.c
@@ -256,7 +256,7 @@ static void shutdown_callback(int fd, short flags, void *arg)
exit(PRTE_ERROR_DEFAULT_EXIT_CODE);
}
-#if PMIX_NUMERIC_VERSION < 0x00040208
+#if PMIX_NUMERIC_VERSION < 0x00040205
static char *pmix_getline(FILE *fp)
{
char *ret, *buff;

View File

@ -0,0 +1,52 @@
diff --git a/3rd-party/prrte/src/mca/ess/base/ess_base_bootstrap.c b/3rd-party/prrte/src/mca/ess/base/ess_base_bootstrap.c
index 48ce664915..f37bd7bea2 100644
--- a/3rd-party/prrte/src/mca/ess/base/ess_base_bootstrap.c
+++ b/3rd-party/prrte/src/mca/ess/base/ess_base_bootstrap.c
@@ -68,7 +68,7 @@ static pmix_status_t regex_parse_value_range(char *base, char *range,
char ***names);
static pmix_status_t read_file(char *regexp, char ***names);
-#if PMIX_NUMERIC_VERSION < 0x00040208
+#if PMIX_NUMERIC_VERSION < 0x00040205
static char *pmix_getline(FILE *fp)
{
char *ret, *buff;
diff --git a/3rd-party/prrte/src/mca/ras/base/ras_base_allocate.c b/3rd-party/prrte/src/mca/ras/base/ras_base_allocate.c
index bc9db628f5..858f1397fb 100644
--- a/3rd-party/prrte/src/mca/ras/base/ras_base_allocate.c
+++ b/3rd-party/prrte/src/mca/ras/base/ras_base_allocate.c
@@ -59,7 +59,7 @@
#include "src/mca/ras/base/ras_private.h"
-#if PMIX_NUMERIC_VERSION < 0x00040208
+#if PMIX_NUMERIC_VERSION < 0x00040205
static char *pmix_getline(FILE *fp)
{
char *ret, *buff;
diff --git a/3rd-party/prrte/src/mca/rmaps/rank_file/rmaps_rank_file.c b/3rd-party/prrte/src/mca/rmaps/rank_file/rmaps_rank_file.c
index b8316e0a8e..dfd0b847d0 100644
--- a/3rd-party/prrte/src/mca/rmaps/rank_file/rmaps_rank_file.c
+++ b/3rd-party/prrte/src/mca/rmaps/rank_file/rmaps_rank_file.c
@@ -71,7 +71,7 @@ static int prte_rmaps_rf_process_lsf_affinity_hostfile(prte_job_t *jdata, prte_r
char *prte_rmaps_rank_file_slot_list = NULL;
-#if PMIX_NUMERIC_VERSION < 0x00040208
+#if PMIX_NUMERIC_VERSION < 0x00040205
static char *pmix_getline(FILE *fp)
{
char *ret, *buff;
diff --git a/3rd-party/prrte/src/mca/rmaps/seq/rmaps_seq.c b/3rd-party/prrte/src/mca/rmaps/seq/rmaps_seq.c
index 555aa39c42..356fb72aa9 100644
--- a/3rd-party/prrte/src/mca/rmaps/seq/rmaps_seq.c
+++ b/3rd-party/prrte/src/mca/rmaps/seq/rmaps_seq.c
@@ -109,7 +109,7 @@ static bool quickmatch(prte_node_t *nd, char *name)
return false;
}
-#if PMIX_NUMERIC_VERSION < 0x00040208
+#if PMIX_NUMERIC_VERSION < 0x00040205
static char *pmix_getline(FILE *fp)
{
char *ret, *buff;