Skip to content

Commit 488f656

Browse files
committed
fix an issue with configuring with external pmix
External pmix installs are frequently in non-standard locations and the path to their shared libraries are not ldconfig'd in because there may be multiple pmix installs. The way the configury was set up prior to this patch, the configuration would fail soon after the PMIX config stuff was called because it added some pmix lib stuff to the LDFLAGS, resulting in configury tests for things that require running the configure test to fail. This patch avoids this problem by resetting the LDFLAGS and LIBS back to what they were prior to the run of the external PMIX detection. The CFLAGS setting is left because there are many places in the ompi and opal source code where pmix_common.h needs to be included. Signed-off-by: Howard Pritchard <[email protected]>
1 parent 731b7e8 commit 488f656

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

config/opal_check_pmi.m4

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
# Copyright (c) 2014-2018 Research Organization for Information Science
1818
# and Technology (RIST). All rights reserved.
1919
# Copyright (c) 2016 IBM Corporation. All rights reserved.
20+
# Copyright (c) 2020 Triad National Security, LLC. All rights
21+
# reserved.
22+
#
2023
# $COPYRIGHT$
2124
#
2225
# Additional copyrights may follow
@@ -180,14 +183,17 @@ AC_DEFUN([OPAL_CHECK_PMIX_LIB],[
180183
[$3
181184
# add the new flags to our wrapper compilers
182185
AS_IF([test "$pmix_ext_install_incdir" != "/usr" && test "$pmix_ext_install_incdir" != "/usr/include"],
183-
[pmix_pmix4x_WRAPPER_EXTRA_CPPFLAGS="-I$pmix_ext_install_incdir"])
186+
[pmix_external_WRAPPER_EXTRA_CPPFLAGS="-I$pmix_ext_install_incdir"])
184187
AS_IF([test "$pmix_ext_install_libdir" != "/usr" && test "$pmix_ext_install_libdir" != "/usr/include"],
185-
[pmix_external_WRAPPER_EXTRA_LDFLAGS="-L$pmix_ext_install_libdir"])
186-
pmix_external_WRAPPER_EXTRA_LIBS=-lpmix],
187-
[CPPFLAGS=$opal_external_pmix_save_CPPFLAGS
188-
LDFLAGS=$opal_external_pmix_save_LDFLAGS
189-
LIBS=$opal_external_pmix_save_LIBS
190-
$4])
188+
[pmix_external_WRAPPER_EXTRA_LDFLAGS="-L$pmix_ext_install_libdir"
189+
pmix_external_WRAPPER_EXTRA_LIBS="-lpmix"])],
190+
[$4])
191+
192+
dnl swap back in original LDFLAGS, LIBS to avoid messing up subsequent configury checks
193+
dnl don't swap back in orig CFLAGS as there are lots of places where the external pmix
194+
dnl header file location needs to be known
195+
LDFLAGS=$opal_external_pmix_save_LDFLAGS
196+
LIBS=$opal_external_pmix_save_LIBS
191197
192198
OPAL_VAR_SCOPE_POP
193199
])
@@ -257,12 +263,15 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
257263
AS_IF([test "$pmix_ext_install_dir" != "/usr"],
258264
[opal_external_pmix_CPPFLAGS="-I$pmix_ext_install_dir/include"
259265
opal_external_pmix_LDFLAGS=-L$pmix_ext_install_libdir])
260-
opal_external_pmix_LIBS=-lpmix],
266+
opal_external_pmix_LIBS="-lpmix"],
261267
[AC_MSG_RESULT([internal])])
262268
263269
AC_DEFINE_UNQUOTED([OPAL_PMIX_V1],[$opal_external_have_pmix1],
264270
[Whether the external PMIx library is v1])
265271
272+
AC_SUBST(opal_external_pmix_LDFLAGS)
273+
AC_SUBST(opal_external_pmix_LIBS)
274+
266275
AS_IF([test "$opal_external_pmix_happy" = "yes"],
267276
[AS_IF([test "$opal_external_pmix_version" = "1x"],
268277
[OPAL_SUMMARY_ADD([[Miscellaneous]],[[PMIx support]], [opal_pmix], [External (1.2.5) WARNING - DYNAMIC OPS NOT SUPPORTED])],

opal/mca/pmix/external/Makefile.am

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#
22
# Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
33
# Copyright (c) 2016-2019 Intel, Inc. All rights reserved.
4+
# Copyright (c) 2020 Triad National Security, LLC. All rights
5+
# reserved.
6+
#
47
# $COPYRIGHT$
58
#
69
# Additional copyrights may follow
@@ -19,8 +22,10 @@ noinst_LTLIBRARIES = libmca_pmix_external.la
1922
libmca_pmix_external_la_SOURCES = \
2023
external.h \
2124
pmix_external_component.c
25+
26+
libmca_pmix_external_la_LIBADD = $(opal_external_pmix_LIBS)
2227
libmca_pmix_external_la_LDFLAGS = \
23-
-module -avoid-version
28+
-module -avoid-version $(opal_external_pmix_LDFLAGS)
2429

2530
# Conditionally install the header files
2631
if WANT_INSTALL_HEADERS

0 commit comments

Comments
 (0)