Open MPI logo

Network Locality Devel Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Network Locality Devel mailing list

Subject: Re: [netloc-devel] PATCH: check for minimum hwloc version
From: Jeff Squyres (jsquyres) (jsquyres_at_[hidden])
Date: 2013-12-06 08:12:01


Slightly amended to be compatible with the commits I just pushed:

diff --git a/configure.ac b/configure.ac
index 74ddbcb..80833bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -213,6 +213,19 @@ AC_CHECK_HEADER([hwloc.h], [:],
        AC_MSG_WARN([Perhaps you need to specify --with-hwloc, or some CPPFLAGS?]
        AC_MSG_ERROR([Cannot continue])])
 
+AC_MSG_CHECKING([for hwloc version >= 1.4.2])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <hwloc.h>]],
+ [[
+#if HWLOC_API_VERSION <= 0x00010400
+#error "HWLOC_API_VERSION is less than 0x00010400"
+#endif
+ ]])],
+ [AC_MSG_RESULT([good])],
+ [AC_MSG_RESULT([bad])
+ AC_MSG_WARN([Version of hwloc is too old.])
+ AC_MSG_WARN([We require version 1.4.2 or later.])
+ AC_MSG_ERROR([Cannot continue])])
+
 AC_CHECK_LIB([hwloc], [hwloc_topology_init], [:],
       [AC_MSG_WARN([Cannot find libhwloc])
        AC_MSG_WARN([Perhaps you need to specify --with-hwloc, or some LDFLAGS?])

On Dec 6, 2013, at 7:49 AM, "Jeff Squyres (jsquyres)" <jsquyres_at_[hidden]>
 wrote:

> What do you guys think of this? It just checks for a minimum version number for hwloc (the display of the patch got cutoff in the AC_MSG_WARN... the rest of the message is actually there in the real code):
>
> diff --git a/configure.ac b/configure.ac
> index 898f682..8ba08b3 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -220,6 +220,22 @@ AS_IF([test "$hwloc_happy" = "0"],
> AC_MSG_ERROR([Cannot continue])])
>
> hwloc_happy=0
> +AC_MSG_CHECKING([for hwloc version >= 1.4.2])
> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <hwloc.h>]],
> + [[
> +#if HWLOC_API_VERSION <= 0x00010400
> +#error "HWLOC_API_VERSION is less than 0x00010400"
> +#endif
> + ]])],
> + [hwloc_happy=1
> + AC_MSG_RESULT([yes])],
> + [AC_MSG_RESULT([no])])
> +AS_IF([test $hwloc_happy -eq 0],
> + [AC_MSG_WARN([Your version of hwloc is too old])
> + AC_MSG_WARN([Please upgrade, and/or point to a newer version via --with-h
> + AC_MSG_ERROR([Cannot continue])])
> +
> +hwloc_happy=0
> AC_CHECK_LIB([hwloc], [hwloc_topology_init], [hwloc_happy=1])
> AS_IF([test "$hwloc_happy" = "0"],
> [AC_MSG_WARN([Cannot find libhwloc])
>
> --
> Jeff Squyres
> jsquyres_at_[hidden]
> For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/
>
> _______________________________________________
> netloc-devel mailing list
> netloc-devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/netloc-devel

-- 
Jeff Squyres
jsquyres_at_[hidden]
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/