diff --git a/ompi/mca/topo/treematch/Makefile.am b/ompi/mca/topo/treematch/Makefile.am index 27d07bc64f..79cda83265 100644 --- a/ompi/mca/topo/treematch/Makefile.am +++ b/ompi/mca/topo/treematch/Makefile.am @@ -5,6 +5,8 @@ # Copyright (c) 2011-2015 INRIA. All rights reserved. # Copyright (c) 2011-2015 Université Bordeaux 1 # Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2019 Research Organization for Information Science +# and Technology (RIST). All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -67,3 +69,5 @@ noinst_LTLIBRARIES = $(lib) libmca_topo_treematch_la_SOURCES = $(lib_sources) libmca_topo_treematch_la_LDFLAGS = -module -avoid-version +distclean-local: + rm -f config.h diff --git a/ompi/mca/topo/treematch/configure.m4 b/ompi/mca/topo/treematch/configure.m4 index c937df3611..81a5ad56e4 100644 --- a/ompi/mca/topo/treematch/configure.m4 +++ b/ompi/mca/topo/treematch/configure.m4 @@ -6,7 +6,9 @@ # Copyright (c) 2011-2015 INRIA. All rights reserved. # Copyright (c) 2011-2015 Universite Bordeaux 1 # Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2015 Intel, Inc. All rights reserved. +# Copyright (c) 2015 Intel, Inc. All rights reserved. +# Copyright (c) 2019 Research Organization for Information Science +# and Technology (RIST). All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -77,7 +79,21 @@ AC_DEFUN([MCA_ompi_topo_treematch_CONFIG], [ [ompi_topo_treematch_happy=1])])]) AS_IF([test $ompi_topo_treematch_happy -eq 1], - [$1], + [AS_IF([test "x$treematch_files_local" = "xyes"], + [AS_IF([! test -d $OMPI_TOP_BUILDDIR/ompi/mca/topo/treematch], + [mkdir -p $OMPI_TOP_BUILDDIR/ompi/mca/topo/treematch]) + cat > $OMPI_TOP_BUILDDIR/ompi/mca/topo/treematch/config.h << EOF +/* + * This file is automatically generated by configure. Edits will be lost + * + * This is an dummy config.h in order to prevent the embedded treematch from using + * the config.h from the embedded hwloc + * + * see https://github.com/open-mpi/ompi/pull/6185#issuecomment-458807930 + */ +EOF + ]) + $1], [AS_IF([test ! -z "$with_treematch" && test "$with_treematch" != "no"], [AC_MSG_ERROR([TreeMatch support requested but not found. Aborting])]) $2])