@@ -178,15 +178,39 @@ dnl external hwloc is not going to be used. Assumes that if
178
178
dnl this function is called, that success means the internal package
179
179
dnl will be used.
180
180
AC_DEFUN ( [ _OPAL_CONFIG_HWLOC_INTERNAL] , [
181
- OPAL_VAR_SCOPE_PUSH(subconfig_happy subconfig_prefix internal_hwloc_location)
182
-
183
- AS_IF ( [ test ! -z $prefix] , [ subconfig_prefix="--prefix=$prefix"] )
181
+ OPAL_VAR_SCOPE_PUSH([ subconfig_happy internal_hwloc_location extra_configure_args found_enable_plugins hwloc_config_arg] )
182
+
183
+ extra_configure_args=
184
+
185
+ # look for a --{enable/disable}-plugins option in the top level
186
+ # configure arguments, so that we can add --enable-plugins if
187
+ # appropriate.
188
+ found_enable_plugins=0
189
+ eval "set x $ac_configure_args"
190
+ shift
191
+ for hwloc_config_arg
192
+ do
193
+ case $hwloc_config_arg in
194
+ --enable-plugins|--enable-plugins=*|--disable-plugins)
195
+ found_enable_plugins=1
196
+ ;;
197
+ esac
198
+ done
199
+
200
+ # while the plugins in hwloc are not explicitly using Open MPI's dlopen
201
+ # interface, it seems rude to enable plugins in hwloc if the builder asked
202
+ # us not to use plugins in Open MPI. So only enable plugins in hwloc if there's
203
+ # a chance we're going to do so. We enable plugins by default so that libhwloc
204
+ # does not end up with a dependency on libcuda, which would mean everything else
205
+ # would end up with a dependency on libcuda (and similar).
206
+ AS_IF ( [ test $found_enable_plugins -eq 0 -a "$enable_dlopen" != "no"] ,
207
+ [ extra_configure_args="--enable-plugins"] )
184
208
185
209
# Note: To update the version of hwloc shipped, update the
186
210
# constant in autogen.pl.
187
211
OPAL_EXPAND_TARBALL([ 3rd-party/hwloc_tarball] , [ 3rd-party/hwloc_directory] , [ configure] )
188
212
OPAL_SUBDIR_ENV_CLEAN([ opal_hwloc_configure] )
189
- PAC_CONFIG_SUBDIR_ARGS([ 3rd-party/hwloc_directory] , [ ] , [ [ --enable-debug] ] ,
213
+ PAC_CONFIG_SUBDIR_ARGS([ 3rd-party/hwloc_directory] , [ $extra_configure_args ] , [ [ --enable-debug] ] ,
190
214
[ subconfig_happy=1] , [ subconfig_happy=0] )
191
215
OPAL_SUBDIR_ENV_RESTORE([ opal_hwloc_configure] )
192
216
0 commit comments