9
9
# Copyright (c) 2015 Intel, Inc. All rights reserved.
10
10
# Copyright (c) 2019 Research Organization for Information Science
11
11
# and Technology (RIST). All rights reserved.
12
- # Copyright (c) 2020 Amazon.com, Inc. or its affiliates.
13
- # All Rights reserved.
12
+ # Copyright (c) 2020-2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
14
13
# Copyright (c) 2021 Google, LLC. All rights reserved.
15
14
# $COPYRIGHT$
16
15
#
20
19
#
21
20
22
21
AC_DEFUN ( [ OPAL_CONFIG_TREEMATCH] , [
23
- OPAL_VAR_SCOPE_PUSH(treematch_files_local )
22
+ OPAL_VAR_SCOPE_PUSH(treematch_builddir )
24
23
25
- OPAL_3RDPARTY_WITH([ treematch] , [ treematch] , [ package_treematch] )
26
-
27
- if test -z "$opal_config_treematch_happy" ; then
28
- AC_ARG_WITH ( [ treematch] ,
29
- [ AS_HELP_STRING ( [ --with-treematch(=DIR)] ,
30
- [ Build TreeMatch topology support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries] ) ] ,
24
+ AC_ARG_WITH ( [ treematch] ,
25
+ [ AS_HELP_STRING ( [ --with-treematch] ,
26
+ [ Build TreeMatch topology support. Building against an external TreeMatch is no longer supported, so valid values are "yes" or "no".] ) ] ,
31
27
[ ] , [ with_treematch=yes] )
32
- AC_ARG_WITH ( [ treematch-include] ,
33
- [ AS_HELP_STRING ( [ --with-treematch-include ( = DIR ) ] ,
34
- [ "Search for TreeMatch headers in DIR"] ) ] )
35
- AC_ARG_WITH ( [ treematch-libdir] ,
36
- [ AS_HELP_STRING ( [ --with-treematch-libdir(=DIR)] ,
37
- [ "Search for TreeMatch libraries in DIR"] ) ] )
38
-
39
- treematch_files_local=no
40
- opal_config_treematch_happy=0
41
28
42
- if test "$with_treematch" != no ; then
43
- # Argument sanity checks.
44
- if (test -z "$with_treematch_include" && test -n "$with_treematch_libdir") ||
45
- (test -n "$with_treematch_include" && test -z "$with_treematch_libdir") ; then
46
- AC_MSG_ERROR ( [ specified only one of --with-treematch-include or --with-treematch-libdir. Both (or neither) should be specified] )
47
- fi
48
- if test -n "$with_treematch_include" && test "$with_treematch" != yes ; then
49
- AC_MSG_ERROR ( [ specified both --with-treematch-include and either --with-treematch=path or --without-treematch] )
50
- fi
29
+ AS_IF ( [ test "$with_treematch" != "yes" -a "$with_treematch" != "no"] ,
30
+ [ AC_MSG_ERROR ( [ Valid values for --with-treematch are yes or no.] ) ] )
51
31
52
- AC_MSG_CHECKING ( [ TreeMatch source] )
53
- if test -n "$with_treematch_include" || test "$with_treematch" != yes ; then
54
- if test -z "$with_treematch_include" ; then
55
- with_treematch_include="$with_treematch/include"
56
- with_treematch_libdir="$with_treematch/lib"
57
- fi
58
- AC_MSG_RESULT ( [ user provided] )
59
- else
60
- treematch_files_local=yes
61
- with_treematch_include="$OMPI_TOP_SRCDIR/3rd-party/treematch"
62
- with_treematch_libdir="$OMPI_TOP_BUILDDIR/3rd-party/treematch"
63
- AC_MSG_RESULT ( [ in tree (3rd-party)] )
64
- fi
32
+ treematch_builddir="${OMPI_TOP_BUILDDIR}/3rd-party/treematch"
65
33
66
- OPAL_CHECK_WITHDIR([ treematch] ,
67
- [ $with_treematch_include] ,
68
- [ tm_tree.h] )
69
- if test $treematch_files_local == no ; then
70
- OPAL_CHECK_WITHDIR([ treematch-libdir] , [ $with_treematch_libdir] , [ libtreematch.*] )
71
- OPAL_CHECK_PACKAGE([ topo_treematch] ,
72
- [ treematch.h] ,
73
- [ treematch] ,
74
- [ tm_build_synthetic_topology] ,
75
- [ ] ,
76
- [ ${with_treematch_include%include}] ,
77
- [ $with_treematch_libdir] ,
78
- [ opal_config_treematch_happy=1] ,
79
- [ AC_MSG_ERROR ( [ TreeMatch support requested but not found. Aborting] ) ] )
80
- else
81
- opal_config_treematch_happy=1
82
- fi
83
- fi
34
+ AS_IF ( [ test "${opal_config_treematch_run_once}" != "yes"] ,
35
+ [ AS_IF ( [ ! test -d ${treematch_builddir}] ,
36
+ [ mkdir -p ${treematch_builddir}] )
84
37
85
- if test $opal_config_treematch_happy -eq 1 && test $treematch_files_local = yes ; then
86
- AS_IF ( [ ! test -d $OMPI_TOP_BUILDDIR/3rd-party/treematch] ,
87
- [ mkdir -p $OMPI_TOP_BUILDDIR/3rd-party/treematch] )
88
- AC_CONFIG_FILES ( [ 3rd-party/treematch/Makefile] )
89
- cat > $OMPI_TOP_BUILDDIR/3rd-party/treematch/config.h << EOF
38
+ cat > ${treematch_builddir}/config.h << EOF
90
39
/*
91
40
* This file is automatically generated by configure. Edits will be lost
92
41
*
@@ -96,25 +45,22 @@ AC_DEFUN([OPAL_CONFIG_TREEMATCH], [
96
45
* see https://github.com/open-mpi/ompi/pull/6185#issuecomment-458807930
97
46
*/
98
47
EOF
99
- opal_config_treematch_LIBS=$OMPI_TOP_BUILDDIR/3rd-party/treematch/libtreematch.la
100
- opal_config_treematch_LDFLAGS=
101
- else
102
- opal_config_treematch_LIBS="-ltreematch"
103
- opal_config_treematch_LDFLAGS="-L$with_treematch_libdir"
104
- fi
105
- fi
106
48
107
- if test $opal_config_treematch_happy -eq 1 ; then
108
- $1 _CPPFLAGS="[ $] $1 _CPPFLAGS -I$with_treematch_include"
109
- $1 _LDFLAGS="[ $] $1 _LDFLAGS $opal_config_treematch_LDFLAGS"
110
- $1 _LIBS="[ $] $1 _LIBS $opal_config_treematch_LIBS"
111
- fi
49
+ AC_CONFIG_FILES ( [ 3rd-party/treematch/Makefile] )
50
+ OPAL_3RDPARTY_DIST_SUBDIRS="$OPAL_3RDPARTY_DIST_SUBDIRS treematch"
51
+
52
+ AS_IF ( [ test "${with_treematch}" = "yes"] ,
53
+ [ OPAL_3RDPARTY_SUBDIRS="$OPAL_3RDPARTY_SUBDIRS treematch"] )
54
+
55
+ opal_config_treematch_run_once=yes] )
56
+
57
+ $1 _CPPFLAGS="-I$OMPI_TOP_SRCDIR/3rd-party/treematch"
58
+ $1 _LIBS="${OMPI_TOP_BUILDDIR}/3rd-party/treematch/libtreematch.la"
59
+
60
+ AS_IF ( [ test "${with_treematch}" = "yes"] ,
61
+ [ $2 ] ,
62
+ [ AC_MSG_NOTICE ( [ Treematch explicitly disabled via --with-treematch=no] )
63
+ $3 ] )
112
64
113
- OPAL_3RDPARTY_SUBDIRS="$OPAL_3RDPARTY_SUBDIRS treematch"
114
- OPAL_3RDPARTY_DIST_SUBDIRS="$OPAL_3RDPARTY_DIST_SUBDIRS treematch"
115
-
116
- AS_IF ( [ test $opal_config_treematch_happy -eq 1] , [ $2 ] , [ $3 ] )
117
65
OPAL_VAR_SCOPE_POP
118
66
] )
119
-
120
-
0 commit comments