Skip to content

Commit 8e0640e

Browse files
committed
build: Support static PMIx/PRRTE
Update the libevent, hwloc, pmix, and prrte configure checks to use OAC_CHECK_PACKAGE for external builds and to better pull in the static library dependencies from the hwloc and pmix. This solves the missing libz problem for building applications against a static OMPI/PMIx build. Signed-off-by: Brian Barrett <[email protected]>
1 parent 5d23e02 commit 8e0640e

File tree

6 files changed

+396
-347
lines changed

6 files changed

+396
-347
lines changed

config/ompi_setup_prrte.m4

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dnl
3838
dnl A Makefile conditional OMPI_WANT_PRRTE will be defined based on the
3939
dnl results of the build.
4040
AC_DEFUN([OMPI_SETUP_PRRTE],[
41-
OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy prrte_setup_success_var])
41+
OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy])
4242
4343
opal_show_subtitle "Configuring PRRTE"
4444
@@ -117,7 +117,7 @@ dnl _OMPI_SETUP_PRRTE_INTERNAL([action-if-success], [action-if-not-success])
117117
dnl
118118
dnl Attempt to configure the built-in PRRTE.
119119
AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL], [
120-
OPAL_VAR_SCOPE_PUSH([internal_prrte_args internal_prrte_extra_libs internal_prrte_happy deprecated_prefix_by_default print_prrte_warning internal_prrte_CPPFLAGS])
120+
OPAL_VAR_SCOPE_PUSH([internal_prrte_args internal_prrte_happy deprecated_prefix_by_default print_prrte_warning internal_prrte_CPPFLAGS opal_prrte_CPPFLAGS_save])
121121
122122
# This is really a PRTE option that should not be in Open MPI, but
123123
# there is not a great way to support the orterun/mpirun checks
@@ -163,18 +163,21 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL], [
163163
164164
AS_IF([test "$opal_libevent_mode" = "internal"],
165165
[internal_prrte_args="$internal_prrte_args --with-libevent --disable-libevent-lib-checks"
166-
internal_prrte_args="$internal_prrte_args --with-libevent-extra-libs=\"$opal_libevent_LIBS\""
167-
internal_prrte_CPPFLAGS="$internal_prrte_CPPFLAGS $opal_libevent_CPPFLAGS"])
166+
internal_prrte_args="$internal_prrte_args --with-libevent-extra-libs=\"$opal_libevent_BUILD_LIBS\""
167+
internal_prrte_CPPFLAGS="$internal_prrte_CPPFLAGS $opal_libevent_BUILD_CPPFLAGS"])
168168
169169
AS_IF([test "$opal_hwloc_mode" = "internal"],
170170
[internal_prrte_args="$internal_prrte_args --disable-hwloc-lib-checks"
171-
internal_prrte_args="$internal_prrte_args --with-hwloc-extra-libs=\"$opal_hwloc_LIBS\""
172-
internal_prrte_CPPFLAGS="$internal_prrte_CPPFLAGS $opal_hwloc_CPPFLAGS"])
171+
internal_prrte_args="$internal_prrte_args --with-hwloc-extra-libs=\"$opal_hwloc_BUILD_LIBS\""
172+
internal_prrte_CPPFLAGS="$internal_prrte_CPPFLAGS $opal_hwloc_BUILD_CPPFLAGS"])
173173
174174
AS_IF([test "$opal_pmix_mode" = "internal"],
175175
[internal_prrte_args="$internal_prrte_args --disable-pmix-lib-checks"
176-
internal_prrte_args="$internal_prrte_args --with-pmix-extra-libs=\"$opal_pmix_LIBS\""
177-
internal_prrte_CPPFLAGS="$internal_prrte_CPPFLAGS $opal_pmix_CPPFLAGS"])
176+
internal_prrte_args="$internal_prrte_args --with-pmix-extra-libs=\"$opal_pmix_BUILD_LIBS\""
177+
internal_prrte_CPPFLAGS="$internal_prrte_CPPFLAGS $opal_pmix_BUILD_CPPFLAGS"])
178+
179+
opal_prrte_CPPFLAGS_save="${CPPFLAGS}"
180+
OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${opal_pmix_CPPFLAGS}])
178181
179182
AC_MSG_CHECKING([if PMIx version is 4.0.0 or greater])
180183
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pmix_version.h>]],
@@ -193,6 +196,8 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL], [
193196
AC_MSG_WARN([--without-prrte option.])
194197
AC_MSG_ERROR([Cannot continue])])
195198
199+
CPPFLAGS="${opal_prrte_CPPFLAGS_save}"
200+
196201
AS_IF([test "$with_ft" != "no"],
197202
[internal_prrte_args="--enable-prte-ft $internal_prrte_args"],
198203
[])
@@ -249,23 +254,25 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_EXTERNAL], [
249254
250255
opal_prrte_CPPFLAGS_save=$CPPFLAGS
251256
252-
_OPAL_CHECK_PACKAGE_HEADER([opal_prrte], [prte.h], [$with_prrte],
253-
[setup_prrte_external_happy=yes],
254-
[setup_prrte_external_happy=no])
257+
AS_IF([test -n "${with_prrte}" -a "${with_prrte}" != "yes" -a "${with_prrte}" != "no"],
258+
[OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], ["-I${with_prrte}/include"])])
255259
256-
CPPFLAGS="$opal_prrte_CPPFLAGS_save $opal_prrte_CPPFLAGS"
260+
AC_CHECK_HEADER([prte.h], [setup_prrte_external_happy=yes],
261+
[setup_prrte_external_happy=no])
257262
258-
AC_MSG_CHECKING([if external PRRTE version is 2.0.0 or greater])
259-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <prte_version.h>]],
260-
[[
263+
AS_IF([test "${setup_prrte_external_happy}" = "yes"],
264+
[AC_CACHE_CHECK([if external PRRTE version is 2.0.0 or greater],
265+
[ompi_setup_prrte_cv_version_happy],
266+
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <prte_version.h>
267+
]], [[
261268
#if PRTE_NUMERIC_VERSION < 0x00020000
262269
#error "prrte API version is less than 2.0.0"
263270
#endif
264271
]])],
265-
[AC_MSG_RESULT([yes])
266-
setup_prrte_external_happy=yes],
267-
[AC_MSG_RESULT([no])
268-
setup_prrte_external_happy=no])
272+
[ompi_setup_prrte_cv_version_happy="yes"],
273+
[ompi_setup_prrte_cv_version_happy="no"])])
274+
AS_IF([test "${ompi_setup_prrte_cv_version_happy}" = "no"],
275+
[setup_prrte_external_happy="no"])])
269276
270277
CPPFLAGS="$opal_prrte_CPPFLAGS_save"
271278

config/opal_check_ofi.m4

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,22 @@ AC_DEFUN([_OPAL_CHECK_OFI],[
136136
[$opal_check_fi_info_pci],
137137
[check if pci data is available in ofi])
138138

139-
AC_CHECK_DECLS([PMIX_PACKAGE_RANK],
140-
[],
141-
[],
142-
[#include <pmix.h>])
143-
144139
AC_CHECK_DECLS([FI_OPT_FI_HMEM_P2P],
145140
[], [],
146141
[#include <rdma/fi_endpoint.h>])
147142

148143
AC_CHECK_TYPES([struct fi_ops_mem_monitor], [], [],
149144
[#ifdef HAVE_RDMA_FI_EXT_H
150145
#include <rdma/fi_ext.h>
151-
#endif])])
146+
#endif
147+
])
148+
149+
OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${opal_pmix_CPPFLAGS}])
150+
151+
AC_CHECK_DECLS([PMIX_PACKAGE_RANK],
152+
[],
153+
[],
154+
[#include <pmix.h>])])
152155

153156
CPPFLAGS=$opal_check_ofi_save_CPPFLAGS
154157
LDFLAGS=$opal_check_ofi_save_LDFLAGS

config/opal_config_hwloc.m4

Lines changed: 95 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,37 @@ dnl configure, abort.
1919
dnl
2020
dnl This macro will change the environment in the following way:
2121
dnl
22-
dnl * opal_hwloc_header [legacy] - will be set if building
23-
dnl internally, to the header file that should be included for
24-
dnl embedded builds. This is used by PRRTE, but should not
25-
dnl be used by new code.
2622
dnl * opal_hwloc_mode - either external or internal. If internal,
2723
dnl --with-hwloc should be ignored by other packages
28-
dnl * opal_hwloc_CPPFLAGS - the C Preprocessor flags necessary to
29-
dnl run the preprocessor on a file which relies on Hwloc
30-
dnl headers. This will be folded into the global CPPFLAGS,
31-
dnl so most people should never need this.
32-
dnl * opal_hwloc_LDFLAGS - the linker flags necessary to run the
33-
dnl linker on a file which relies on Hwloc libraries. This
34-
dnl will be folded into the global CPPFLAGS, so most people
35-
dnl should never need this.
36-
dnl * opal_hwloc_LIBS - the libraries necessary to link source which
37-
dnl uses Hwloc. Cannot be added to LIBS yet, because then
38-
dnl other execution tests later in configure (there are sadly
39-
dnl some) would fail if the path in LDFLAGS was not added to
40-
dnl LD_LIBRARY_PATH.
41-
dnl * opal_hwloc_WRAPPER_LDFLAGS - the linker flags necessary to
42-
dnl add to the wrapper compilers in order to link an opal
43-
dnl application when opal is built as a static library.
24+
dnl * CPPFLAGS, LDFLAGS, LIBS - Updated to build against hwloc.
25+
dnl Note that the values may be updated right before
26+
dnl config.status.
27+
dnl
28+
dnl OPAL_WRAPPER_FLAGS_ADD will be called to add the correct LDFLAGS,
29+
dnl STATIC_LDFLAGS, LIBS, and STATIC_LIBS for hwloc.
30+
dnl
31+
dnl The following environment variables will only be set if
32+
dnl opal_hwloc_mode is "internal":
33+
dnl
34+
dnl * opal_hwloc_BUILD_CPPFLAGS - the C Preprocessor flags
35+
dnl necessary to run the preprocessor on a file which relies
36+
dnl on hwloc headers. This will be folded into the global
37+
dnl CPPFLAGS (see note above).
38+
dnl * opal_hwloc_BUILD_LIBS - the libraries necessary to link
39+
dnl source which uses hwloc. Cannot be added to LIBS yet,
40+
dnl because then other execution tests later in configure
41+
dnl (there are sadly some) would fail if the path in LDFLAGS
42+
dnl was not added to LD_LIBRARY_PATH.
4443
dnl * opal_hwloc_WRAPPER_LIBS - the linker flags necessary to
4544
dnl add to the wrapper compilers in order to link an opal
4645
dnl application when opal is built as a static library.
47-
dnl * CPPFLAGS, LDFLAGS - Updated opal_hwloc_CPPFLAGS and
48-
dnl opal_hwloc_LDFLAGS.
4946
AC_DEFUN([OPAL_CONFIG_HWLOC], [
50-
OPAL_VAR_SCOPE_PUSH([external_hwloc_happy internal_hwloc_happy pkg_config_file pkg_config_happy pkg_config_ldflags pkg_config_libs])
47+
OPAL_VAR_SCOPE_PUSH([external_hwloc_happy internal_hwloc_happy opal_hwloc_STATIC_LDFLAGS opal_hwloc_LIBS opal_hwloc_STATIC_LIBS])
5148
5249
opal_show_subtitle "Configuring hwloc"
5350
5451
OPAL_3RDPARTY_WITH([hwloc], [hwloc], [package_hwloc])
5552
56-
opal_hwloc_header=""
57-
5853
# unless internal specifically requested by the user, try to find
5954
# an external that works.
6055
external_hwloc_happy=0
@@ -75,79 +70,54 @@ AC_DEFUN([OPAL_CONFIG_HWLOC], [
7570
AS_IF([test "$external_hwloc_happy" = "0" -a "$internal_hwloc_happy" = "0"],
7671
[AC_MSG_ERROR([Could not find viable hwloc build.])])
7772
78-
AS_IF([test "$opal_hwloc_mode" = "internal"],
79-
[pkg_config_file="${OMPI_TOP_BUILDDIR}/3rd-party/hwloc_directory/hwloc.pc"
80-
PKG_CONFIG_PATH="${OMPI_TOP_BUILDDIR}/3rd-party/hwloc_directory:${PKG_CONFIG_PATH}"],
81-
[test -n "$with_hwloc"],
82-
[pkg_config_file="${with_hwloc}/lib/pkgconfig/hwloc.pc"
83-
PKG_CONFIG_PATH="${with_hwloc}/lib/pkgconfig:${PKG_CONFIG_PATH}"],
84-
[pkg_config_file="hwloc"])
85-
86-
pkg_config_happy=1
87-
OPAL_GET_LDFLAGS_FROM_PC([$pkg_config_file], [pkg_config_ldflags], [pkg_config_happy=0])
88-
OPAL_GET_LIBS_FROM_PC([$pkg_config_file], [pkg_config_libs], [pkg_config_happy=0])
89-
90-
AS_IF([test $pkg_config_happy -ne 0],
91-
[opal_hwloc_WRAPPER_LDFLAGS="$pkg_config_ldflags"
92-
opal_hwloc_WRAPPER_LIBS="$pkg_config_libs"],
93-
[# guess that what we have from compiling OMPI is good enough
94-
AS_IF([test -z "$opal_hwloc_WRAPPER_LDFLAGS"],
95-
[opal_hwloc_WRAPPER_LDFLAGS="$opal_hwloc_LDFLAGS"])
96-
AS_IF([test -z "$opal_hwloc_WRAPPER_LIBS"],
97-
[opal_hwloc_WRAPPER_LIBS="$opal_hwloc_LIBS"])])
98-
99-
OPAL_WRAPPER_FLAGS_ADD([LDFLAGS], [$opal_hwloc_WRAPPER_LDFLAGS])
100-
OPAL_WRAPPER_FLAGS_ADD([LIBS], [$opal_hwloc_WRAPPER_LIBS])
101-
102-
# this will work even if there is no hwloc package included,
103-
# because hwloc_tarball and hwloc_directory will evaluate to an
104-
# empty string. These are relative to the 3rd-party/ directory.
73+
dnl this will work even if there is no hwloc package included,
74+
dnl because hwloc_tarball and hwloc_directory will evaluate to an
75+
dnl empty string. These are relative to the 3rd-party/ directory.
10576
OPAL_3RDPARTY_EXTRA_DIST="$OPAL_3RDPARTY_EXTRA_DIST hwloc_tarball"
10677
OPAL_3RDPARTY_DISTCLEAN_DIRS="$OPAL_3RDPARTY_DISTCLEAN_DIRS hwloc_directory"
10778
108-
AC_SUBST(opal_hwloc_CPPFLAGS)
109-
AC_SUBST(opal_hwloc_LIBS)
110-
AC_SUBST(opal_hwloc_LDFLAGS)
79+
OPAL_WRAPPER_FLAGS_ADD([LDFLAGS], [${opal_hwloc_LDFLAGS}])
80+
OPAL_WRAPPER_FLAGS_ADD([STATIC_LDFLAGS], [${opal_hwloc_STATIC_LDFLAGS}])
81+
OPAL_WRAPPER_FLAGS_ADD([LIBS], [${opal_hwloc_LIBS}])
82+
OPAL_WRAPPER_FLAGS_ADD([STATIC_LIBS], [${opal_hwloc_STATIC_LIBS}])
83+
OPAL_WRAPPER_FLAGS_ADD([PC_MODULES], [${opal_hwloc_PC_MODULES}])
84+
85+
AC_CONFIG_COMMANDS_PRE([OPAL_CONFIG_HWLOC_INTERNAL_LIBS_HANDLER])
11186
11287
OPAL_SUMMARY_ADD([Miscellaneous], [hwloc], [], [$opal_hwloc_mode])
11388
11489
OPAL_VAR_SCOPE_POP
11590
])
11691

92+
11793
dnl _OPAL_CONFIG_HWLOC_EXTERNAL(action-if-happy, action-if-not-happy)
11894
dnl
11995
dnl only safe to call from OPAL_CONFIG_HWLOC, assumes variables from
12096
dnl there are set.
12197
AC_DEFUN([_OPAL_CONFIG_HWLOC_EXTERNAL], [
12298
OPAL_VAR_SCOPE_PUSH([opal_hwloc_CPPFLAGS_save opal_hwloc_LDFLAGS_save opal_hwloc_LIBS_save opal_hwloc_external_support])
12399
100+
OAC_CHECK_PACKAGE([hwloc],
101+
[opal_hwloc],
102+
[hwloc.h],
103+
[hwloc],
104+
[hwloc_topology_init],
105+
[opal_hwloc_external_support=yes],
106+
[opal_hwloc_external_support=no])
107+
108+
# need these set for the tests below.
124109
opal_hwloc_CPPFLAGS_save=$CPPFLAGS
125110
opal_hwloc_LDFLAGS_save=$LDFLAGS
126111
opal_hwloc_LIBS_save=$LIBS
127112
128-
AS_IF([test ! -z "$with_hwloc_libdir"],
129-
[OPAL_CHECK_WITHDIR([hwloc-libdir], [$with_hwloc_libdir],
130-
[libhwloc.*])])
131-
132-
OPAL_CHECK_PACKAGE([opal_hwloc],
133-
[hwloc.h],
134-
[hwloc],
135-
[hwloc_topology_init],
136-
[],
137-
[$with_hwloc],
138-
[$with_hwloc_libdir],
139-
[opal_hwloc_external_support=yes],
140-
[opal_hwloc_external_support=no])
141-
142-
# need these set for the tests below. If things fail, will undo at the end.
143-
CPPFLAGS="$opal_hwloc_CPPFLAGS_save $opal_hwloc_CPPFLAGS"
144-
LDFLAGS="$opal_hwloc_LDFLAGS_save $opal_hwloc_LDFLAGS"
145-
LIBS="$opal_hwloc_LIBS_save $opal_hwloc_LIBS"
113+
OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [$opal_hwloc_CPPFLAGS])
114+
OPAL_FLAGS_APPEND_UNIQ([LDFLAGS], [$opal_hwloc_LDFLAGS])
115+
OPAL_FLAGS_APPEND_UNIQ([LIBS], [$opal_hwloc_LIBS])
146116
147117
AS_IF([test "$opal_hwloc_external_support" = "yes"],
148118
[AC_MSG_CHECKING([if external hwloc version is 1.11.0 or greater])
149-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <hwloc.h>]],
150-
[[
119+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <hwloc.h>
120+
]], [[
151121
#if HWLOC_API_VERSION < 0x00010500
152122
#error "hwloc API version is less than 0x00011100"
153123
#endif
@@ -158,16 +128,21 @@ AC_DEFUN([_OPAL_CONFIG_HWLOC_EXTERNAL], [
158128
opal_hwloc_external_support="no"])])
159129
160130
AS_IF([test "$opal_hwloc_external_support" = "yes"],
161-
[AC_CHECK_DECLS([HWLOC_OBJ_OSDEV_COPROC], [], [], [#include <hwloc.h>])
131+
[AC_CHECK_DECLS([HWLOC_OBJ_OSDEV_COPROC], [], [], [#include <hwloc.h>
132+
])
162133
AC_CHECK_FUNCS([hwloc_topology_dup])])
163134
135+
CPPFLAGS="$opal_hwloc_CPPFLAGS_save"
164136
LDFLAGS="$opal_hwloc_LDFLAGS_save"
165137
LIBS="$opal_hwloc_LIBS_save"
166138
167139
AS_IF([test "$opal_hwloc_external_support" = "yes"],
168-
[$1],
169-
[CPPFLAGS="$opal_hwloc_CPPFLAGS_save"
170-
$2])
140+
[dnl Do not add hwloc libs to LIBS until late, because
141+
dnl it will screw up other tests (like the pthread tests)
142+
opal_hwloc_BUILD_LIBS="${opal_hwloc_LIBS}"
143+
144+
$1],
145+
[$2])
171146
172147
OPAL_VAR_SCOPE_POP
173148
])
@@ -179,7 +154,7 @@ dnl external hwloc is not going to be used. Assumes that if
179154
dnl this function is called, that success means the internal package
180155
dnl will be used.
181156
AC_DEFUN([_OPAL_CONFIG_HWLOC_INTERNAL], [
182-
OPAL_VAR_SCOPE_PUSH([subconfig_happy internal_hwloc_location extra_configure_args found_enable_plugins hwloc_config_arg])
157+
OPAL_VAR_SCOPE_PUSH([subconfig_happy internal_hwloc_location extra_configure_args found_enable_plugins hwloc_config_arg pkg_config_file pkg_config_happy])
183158
184159
extra_configure_args=
185160
@@ -215,20 +190,42 @@ AC_DEFUN([_OPAL_CONFIG_HWLOC_INTERNAL], [
215190
[subconfig_happy=1], [subconfig_happy=0])
216191
OPAL_SUBDIR_ENV_RESTORE([opal_hwloc_configure])
217192
218-
AS_IF([test "$subconfig_happy" = "1"],
193+
AS_IF([test ${subconfig_happy} -eq 1],
219194
[internal_hwloc_location="3rd-party/hwloc_directory"
220-
# note: because we only ship/commit a tarball (and not the source
221-
# directory), the source is always expanded in the builddir, so we
222-
# only need to add a -I to the builddir.
195+
196+
dnl We do not consider it an error if pkg-config doesn't work / exist / etc.
197+
pkg_config_file="${OMPI_TOP_BUILDDIR}/3rd-party/hwloc_directory/hwloc.pc"
198+
pkg_config_happy=0
199+
200+
OAC_CHECK_PACKAGE_PARSE_PKGCONFIG([hwloc_internal], [opal_hwloc], [${pkg_config_file}], [pkg_config_happy=1])
201+
202+
dnl Don't pull LDFLAGS, because we don't have a good way to avoid
203+
dnl a -L to our install directory, which can cause some weirdness
204+
dnl if there's an old OMPI install there. And it makes filtering
205+
dnl redundant flags easier.
206+
opal_hwloc_LDFLAGS=
207+
208+
dnl with no pkg-config data, guess. assume that -L${libdir} is already added to LDFLAGS
209+
AS_IF([test $pkg_config_happy -eq 0],
210+
[opal_hwloc_STATIC_LDFLAGS=
211+
opal_hwloc_LIBS="-lhwloc"
212+
opal_hwloc_STATIC_LIBS=
213+
opal_hwloc_PC_MODULES=])
214+
215+
# note: because we only ship/commit a tarball (and not the
216+
# source directory), the source is always expanded in the
217+
# builddir, so we only need to add a -I to the builddir.
218+
# Overwrite the OAC_CHECK_PACKAGE_PARSE PKGCONFIG results,
219+
# because it's the install dir location, not the build
220+
# location.
223221
opal_hwloc_CPPFLAGS="-I$OMPI_TOP_BUILDDIR/$internal_hwloc_location/include -I$OMPI_TOP_SRCDIR/$internal_hwloc_location/include"
224-
CPPFLAGS="$CPPFLAGS $opal_hwloc_CPPFLAGS"
222+
opal_hwloc_BUILD_CPPFLAGS="${opal_hwloc_CPPFLAGS}"
223+
225224
# No need to update LDFLAGS, because they will install into
226225
# our tree and in the mean time are referenced by their .la
227226
# files.
228-
opal_hwloc_LIBS="$OMPI_TOP_BUILDDIR/$internal_hwloc_location/hwloc/libhwloc.la"
229-
opal_hwloc_WRAPPER_LIBS="-lhwloc"
230-
231-
opal_hwloc_header="$OMPI_TOP_BUILDDIR/$internal_hwloc_location/include/hwloc.h"
227+
opal_hwloc_BUILD_LIBS="$OMPI_TOP_BUILDDIR/$internal_hwloc_location/hwloc/libhwloc.la"
228+
opal_hwloc_WRAPPER_LIBS="${opal_hwloc_LIBS}"
232229
233230
# no need to add to DIST_SUBDIRS, because we only ship the
234231
# tarball. This is relative to the 3rd-party/ directory.
@@ -238,3 +235,12 @@ AC_DEFUN([_OPAL_CONFIG_HWLOC_INTERNAL], [
238235
239236
OPAL_VAR_SCOPE_POP
240237
])
238+
239+
240+
dnl We need to delay adding .la files to LIBS until the very end of
241+
dnl configure, to avoid pulling it into other configure tests.
242+
AC_DEFUN([OPAL_CONFIG_HWLOC_INTERNAL_LIBS_HANDLER], [
243+
OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${opal_hwloc_CPPFLAGS}])
244+
OPAL_FLAGS_APPEND_UNIQ([LDFLAGS], [$opal_hwloc_LDFLAGS])
245+
OPAL_FLAGS_APPEND_MOVE([LIBS], [${opal_hwloc_BUILD_LIBS}])
246+
])

0 commit comments

Comments
 (0)