@@ -84,7 +84,7 @@ AC_DEFUN([MCA_opal_hwloc_external_POST_CONFIG],[
84
84
AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
85
85
AC_CONFIG_FILES([opal/mca/hwloc/external/Makefile])
86
86
87
- OPAL_VAR_SCOPE_PUSH([opal_hwloc_external_CPPFLAGS_save opal_hwloc_external_CFLAGS_save opal_hwloc_external_LDFLAGS_save opal_hwloc_external_LIBS_save opal_hwloc_external_want opal_hwloc_external_tmp opal_hwloc_external_lstopo])
87
+ OPAL_VAR_SCOPE_PUSH([opal_hwloc_external_CPPFLAGS_save opal_hwloc_external_CFLAGS_save opal_hwloc_external_LDFLAGS_save opal_hwloc_external_LIBS_save opal_hwloc_external_tmp opal_hwloc_external_lstopo opal_hwloc_summary_msg ])
88
88
89
89
AC_ARG_WITH([hwloc-libdir],
90
90
[AC_HELP_STRING([--with-hwloc-libdir= DIR],
@@ -98,16 +98,9 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
98
98
AC_MSG_WARN([were specified, which does not make sense.])
99
99
AC_MSG_ERROR([Cannot continue])])
100
100
101
- # Do we want this external component? (slightly redundant logic,
102
- # but hopefully slightly more clear...)
103
- opal_hwloc_external_want=no
104
- AS_IF([test " $with_hwloc_libdir " != " " ], [opal_hwloc_external_want= yes])
105
- AS_IF([test " $with_hwloc " = " internal" ],
106
- [opal_hwloc_external_want= no],
107
- [opal_hwloc_external_want= yes])
108
-
109
- # If we still want external support, try it
110
- AS_IF([test " $opal_hwloc_external_want " = " yes" ],
101
+ opal_hwloc_summary_msg=" internal"
102
+ # Try external support if needed
103
+ AS_IF([test " $with_hwloc " != " internal" ],
111
104
[OPAL_CHECK_WITHDIR([hwloc-libdir], [$with_hwloc_libdir ],
112
105
[libhwloc.* ])
113
106
@@ -141,10 +134,9 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
141
134
LDFLAGS= " $LDFLAGS $opal_hwloc_external_LDFLAGS "
142
135
LIBS= " $LIBS $opal_hwloc_external_LIBS "
143
136
AC_CHECK_DECLS([HWLOC_OBJ_OSDEV_COPROC], [], [], [# include <hwloc.h>])
144
- AC_CHECK_FUNCS([hwloc_topology_dup])])
137
+ AC_CHECK_FUNCS([hwloc_topology_dup])
145
138
146
- AS_IF([test " $opal_hwloc_external_support " = " yes" ],
147
- [AC_MSG_CHECKING([if external hwloc version is 1.5 or greater])
139
+ AC_MSG_CHECKING([if external hwloc version is 1.5 or greater])
148
140
AC_COMPILE_IFELSE(
149
141
[AC_LANG_PROGRAM([[# include <hwloc.h>]],
150
142
[[
@@ -156,6 +148,8 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
156
148
[AC_MSG_RESULT([no])
157
149
opal_hwloc_external_support= no])])
158
150
151
+ # If external hwloc is not explicitly requested, check external version
152
+ # is not lower than the internal one
159
153
AS_IF([test " $opal_hwloc_external_support " = " yes" &&
160
154
test -z " $with_hwloc " ],
161
155
[AC_MSG_CHECKING([if external hwloc version is 2.0 or greater])
@@ -168,53 +162,58 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
168
162
]])],
169
163
[AC_MSG_RESULT([yes])],
170
164
[AC_MSG_RESULT([no])
171
- AC_MSG_WARN([external hwloc version is less than internal version (2.0)])
165
+ opal_hwloc_summary_msg= " internal (external hlwoc version is less than internal version 2.0)"
166
+ AC_MSG_WARN([external hwloc version is less than internal version 2.0])
172
167
AC_MSG_WARN([using internal hwloc])
173
168
opal_hwloc_external_support= no])])
174
- CPPFLAGS= $opal_hwloc_external_CPPFLAGS_save
175
- CFLAGS= $opal_hwloc_external_CFLAGS_save
176
- LDFLAGS= $opal_hwloc_external_LDFLAGS_save
177
- LIBS= $opal_hwloc_external_LIBS_save
169
+
170
+ AS_IF([test " $opal_hwloc_external_support " = " yes" ],
171
+ [AC_DEFINE_UNQUOTED([HWLOC_EXTERNAL_HWLOC_VERSION],
172
+ [external],
173
+ [Version of hwloc])
174
+
175
+ # See if the external hwloc supports XML
176
+ AC_MSG_CHECKING([if external hwloc supports XML])
177
+ AS_IF([test " $opal_hwloc_dir " != " " ],
178
+ [opal_hwloc_external_lstopo= " $opal_hwloc_dir /bin/lstopo" ],
179
+ [OPAL_WHICH(lstopo, opal_hwloc_external_lstopo)])
180
+ opal_hwloc_external_tmp= ` $opal_hwloc_external_lstopo --help | $GREP " Supported output file formats" | grep xml`
181
+ AS_IF([test " $opal_hwloc_external_tmp " = " " ],
182
+ [opal_hwloc_external_enable_xml= 0
183
+ AC_MSG_RESULT([no])],
184
+ [opal_hwloc_external_enable_xml= 1
185
+ AC_MSG_RESULT([yes])])
186
+
187
+ AC_CHECK_HEADERS([infiniband/verbs.h])
188
+
189
+ # These flags need to get passed to the wrapper compilers
190
+ # (this is unnecessary for the internal/embedded hwloc)
191
+
192
+ # Finally, add some flags to the wrapper compiler if we're
193
+ # building with developer headers so that our headers can
194
+ # be found.
195
+ hwloc_external_WRAPPER_EXTRA_CPPFLAGS= $opal_hwloc_external_CPPFLAGS
196
+ hwloc_external_WRAPPER_EXTRA_LDFLAGS= $opal_hwloc_external_LDFLAGS
197
+ hwloc_external_WRAPPER_EXTRA_LIBS= $opal_hwloc_external_LIBS ])
198
+
199
+ CPPFLAGS= $opal_hwloc_external_CPPFLAGS_save
200
+ CFLAGS= $opal_hwloc_external_CFLAGS_save
201
+ LDFLAGS= $opal_hwloc_external_LDFLAGS_save
202
+ LIBS= $opal_hwloc_external_LIBS_save
178
203
])
179
204
180
205
# Done!
181
206
AS_IF([test " $opal_hwloc_external_support " = " yes" ],
182
- [AC_DEFINE_UNQUOTED([HWLOC_EXTERNAL_HWLOC_VERSION],
183
- [external],
184
- [Version of hwloc])
185
-
186
- # See if the external hwloc supports XML
187
- AC_MSG_CHECKING([if external hwloc supports XML])
188
- AS_IF([test " $opal_hwloc_dir " != " " ],
189
- [opal_hwloc_external_lstopo= " $opal_hwloc_dir /bin/lstopo" ],
190
- [OPAL_WHICH(lstopo, opal_hwloc_external_lstopo)])
191
- opal_hwloc_external_tmp= ` $opal_hwloc_external_lstopo --help | $GREP " Supported output file formats" | grep xml`
192
- AS_IF([test " $opal_hwloc_external_tmp " = " " ],
193
- [opal_hwloc_external_enable_xml= 0
194
- AC_MSG_RESULT([no])],
195
- [opal_hwloc_external_enable_xml= 1
196
- AC_MSG_RESULT([yes])])
197
-
198
- AC_CHECK_HEADERS([infiniband/verbs.h])
199
-
200
- AS_IF([test " $opal_hwloc_dir " != " " ],
201
- [opal_hwloc_external_CFLAGS_save= $CFLAGS
202
- CFLAGS= " -I$opal_hwloc_dir /include $opal_hwloc_external_CFLAGS_save " ])
203
- AS_IF([test " $opal_hwloc_dir " != " " ],
204
- [CFLAGS= $opal_hwloc_external_CFLAGS_save ])
205
-
206
- # These flags need to get passed to the wrapper compilers
207
- # (this is unnecessary for the internal/embedded hwloc)
208
-
209
- # Finally, add some flags to the wrapper compiler if we're
210
- # building with developer headers so that our headers can
211
- # be found.
212
- hwloc_external_WRAPPER_EXTRA_CPPFLAGS= $opal_hwloc_external_CPPFLAGS
213
- hwloc_external_WRAPPER_EXTRA_LDFLAGS= $opal_hwloc_external_LDFLAGS
214
- hwloc_external_WRAPPER_EXTRA_LIBS= $opal_hwloc_external_LIBS
215
-
207
+ [opal_hwloc_summary_msg= " external"
216
208
$1 ],
217
- [$2 ])
209
+ [# Abort is external hwloc was explicitly requested but cannot be built
210
+ AS_IF([test " $with_hwloc " != internal &&
211
+ test -n " $with_hwloc " ],
212
+ [AC_MSG_WARN([external hwloc cannot be built])
213
+ AC_MSG_ERROR([Cannot continue.])])
214
+ $2 ])
215
+
216
+ OPAL_SUMMARY_ADD([[Miscellaneous]],[[HWLOC support]], [], [$opal_hwloc_summary_msg ])
218
217
219
218
AC_SUBST(opal_hwloc_external_LDFLAGS)
220
219
AC_SUBST(opal_hwloc_external_LIBS)
0 commit comments