Maybe try this. It should disable the entire BGQ backend
cross-build-testing when Linux doesn't have enough pthread/cpuset support.

Brice



Le 21/07/2015 22:02, Paul Hargrove a écrit :
> I was, at Brice's request, trying out the hwloc-1.11.0 release on all
> sorts of x86 systems, with and without a patch for the inline asm for
> the cpuid instruction.
>
> I came across the following UNRELATED error during "make check" on a
> (very old) Red Hat 8 system (that would be something like "Fedora
> negative-3"):
>
> make[3]: Entering directory
> `/home/pcp1/phargrov/OMPI/hwloc-1.11.0-linux-x86-RH8/BLD/tests/ports'
>   CC       libhwloc_port_aix_la-topology-aix.lo
>   CCLD     libhwloc-port-aix.la <http://libhwloc-port-aix.la>
>   CC       libhwloc_port_bgq_la-topology-bgq.lo
> topology-bgq.c: In function `hwloc_bgq_get_thread_cpubind':
> topology-bgq.c:115: `cpu_set_t' undeclared (first use in this function)
> topology-bgq.c:115: (Each undeclared identifier is reported only once
> topology-bgq.c:115: for each function it appears in.)
> topology-bgq.c:115: parse error before "bg_set"
> topology-bgq.c:122: `bg_set' undeclared (first use in this function)
> topology-bgq.c: In function `hwloc_bgq_set_thread_cpubind':
> topology-bgq.c:151: `cpu_set_t' undeclared (first use in this function)
> topology-bgq.c:151: parse error before "bg_set"
> topology-bgq.c:168: `bg_set' undeclared (first use in this function)
> make[3]: *** [libhwloc_port_bgq_la-topology-bgq.lo] Error 1
>
> The following output from configure might be relevant:
>
> checking for sched_setaffinity... yes
> checking for sys/cpuset.h... no
> checking for cpuset_setaffinity... no
> checking for library containing pthread_getthrds_np... no
> checking for cpuset_setid... no
>
>
>
> -Paul
>
> -- 
> Paul H. Hargrove                          phhargr...@lbl.gov
> <mailto:phhargr...@lbl.gov>
> Computer Languages & Systems Software (CLaSS) Group
> Computer Science Department               Tel: +1-510-495-2352
> Lawrence Berkeley National Laboratory     Fax: +1-510-486-6900
>
>
> _______________________________________________
> hwloc-devel mailing list
> hwloc-de...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-devel
> Link to this post: 
> http://www.open-mpi.org/community/lists/hwloc-devel/2015/07/4508.php

diff --git a/src/topology-bgq.c b/src/topology-bgq.c
index 3998f31..4dfc2bf 100644
--- a/src/topology-bgq.c
+++ b/src/topology-bgq.c
@@ -15,6 +15,8 @@
 #include <spi/include/kernel/location.h>
 #include <spi/include/kernel/process.h>

+#ifndef HWLOC_DISABLE_BGQ_PORT_TEST
+
 static int
 hwloc_look_bgq(struct hwloc_backend *backend)
 {
@@ -244,3 +246,5 @@ const struct hwloc_component hwloc_bgq_component = {
   0,
   &hwloc_bgq_disc_component
 };
+
+#endif /* !HWLOC_DISABLE_BGQ_PORT_TEST */
diff --git a/tests/ports/include/bgq/spi/include/kernel/location.h b/tests/ports/include/bgq/spi/include/kernel/location.h
index 4b67abb..883bb51 100644
--- a/tests/ports/include/bgq/spi/include/kernel/location.h
+++ b/tests/ports/include/bgq/spi/include/kernel/location.h
@@ -11,4 +11,10 @@
 uint32_t Kernel_ProcessorID( void );
 uint32_t Kernel_MyTcoord( void );

+/* don't try to cross-build BGQ port on old Linux platforms */
+#if (!HAVE_DECL_PTHREAD_GETAFFINITY_NP) || (!HAVE_DECL_PTHREAD_SETAFFINITY_NP) || (!defined HWLOC_HAVE_CPU_SET)
+#warning Disabling BGQ port cross-build on old Linux platform
+#define HWLOC_DISABLE_BGQ_PORT_TEST
+#endif
+
 #endif /* HWLOC_PORT_BGQ_KERNEL_LOCATION_H */

Reply via email to