14
14
# Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights
15
15
# reserved.
16
16
# Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
17
- # Copyright (c) 2014-2017 Research Organization for Information Science
18
- # and Technology (RIST). All rights reserved.
17
+ # Copyright (c) 2014-2018 Research Organization for Information Science
18
+ # and Technology (RIST). All rights reserved.
19
19
# Copyright (c) 2016 IBM Corporation. All rights reserved.
20
20
# $COPYRIGHT$
21
21
#
@@ -39,18 +39,35 @@ AC_DEFUN([OPAL_CHECK_PMI_LIB],
39
39
opal_check_$3 _mycppflags=
40
40
41
41
# check for the header
42
- AC_MSG_CHECKING ( [ for $3 .h in $1 /include] )
43
- AS_IF ( [ test -f $1 /include/$3 .h] ,
44
- [ AC_MSG_RESULT ( [ found] )
45
- opal_check_$3 _mycppflags="-I$1 /include"] ,
46
- [ AC_MSG_RESULT ( [ not found] )
47
- AC_MSG_CHECKING ( [ for $3 .h in $1 /include/slurm] )
48
- AS_IF ( [ test -f $1 /include/slurm/$3 .h] ,
42
+ AS_IF ( [ test -n "$1 "] ,
43
+ [ AC_MSG_CHECKING ( [ for $3 .h in $1 ] )
44
+ AS_IF ( [ test -f $1 /$3 .h && test -r $1 /$3 .h] ,
49
45
[ AC_MSG_RESULT ( [ found] )
50
- opal_check_$3 _mycppflags="-I$1 /include/slurm"
51
- $5 ] ,
46
+ opal_check_$3 _mycppflags="-I$1 "] ,
52
47
[ AC_MSG_RESULT ( [ not found] )
53
- opal_check_$3 _hdr_happy=no] ) ] )
48
+ AC_MSG_CHECKING ( [ for $3 .h in $1 /include] )
49
+ AS_IF ( [ test -f $1 /include/$3 .h && test -r $1 /include/$3 .h] ,
50
+ [ AC_MSG_RESULT ( [ found] )
51
+ opal_check_$3 _mycppflags="-I$1 /include"] ,
52
+ [ AC_MSG_RESULT ( [ not found] )
53
+ AC_MSG_CHECKING ( [ for $3 .h in $1 /include/slurm] )
54
+ AS_IF ( [ test -f $1 /include/slurm/$3 .h && test -r $1 /include/slurm/$3 .h] ,
55
+ [ AC_MSG_RESULT ( [ found] )
56
+ opal_check_$3 _mycppflags="-I$1 /include/slurm"
57
+ $5 ] ,
58
+ [ AC_MSG_RESULT ( [ not found] )
59
+ opal_check_$3 _hdr_happy=no] ) ] ) ] ) ] ,
60
+ [ AC_MSG_CHECKING ( [ for $3 .h in /usr/include] )
61
+ AS_IF ( [ test -f /usr/include/$3 .h && test -r /usr/include/$3 .h] ,
62
+ [ AC_MSG_RESULT ( [ found] ) ] ,
63
+ [ AC_MSG_RESULT ( [ not found] )
64
+ AC_MSG_CHECKING ( [ for $3 .h in /usr/include/slurm] )
65
+ AS_IF ( [ test -f /usr/include/slurm/$3 .h && test -r /usr/include/slurm/$3 .h] ,
66
+ [ AC_MSG_RESULT ( [ found] )
67
+ opal_check_$3 _mycppflags="-I/usr/include/slurm"
68
+ $5 ] ,
69
+ [ AC_MSG_RESULT ( [ not found] )
70
+ opal_check_$3 _hdr_happy=no] ) ] ) ] )
54
71
55
72
AS_IF ( [ test "$opal_check_$3 _hdr_happy" != "no"] ,
56
73
[ CPPFLAGS="$CPPFLAGS $opal_check_$3 _mycppflags"
@@ -65,51 +82,47 @@ AC_DEFUN([OPAL_CHECK_PMI_LIB],
65
82
66
83
# check for the library in the given location in case
67
84
# an exact path was given
68
- AC_MSG_CHECKING ( [ for lib$3 in $2 ] )
69
- files=`ls $2 /lib$3 .* 2> /dev/null | wc -l`
70
- AS_IF ( [ test "$files" -gt "0"] ,
71
- [ AC_MSG_RESULT ( [ found] )
72
- LDFLAGS="$LDFLAGS -L$2 "
73
- AC_CHECK_LIB ( [ $3 ] , [ $4 ] ,
74
- [ opal_check_$3 _lib_happy=yes
75
- $3 _LDFLAGS=-L$2
76
- $3 _rpath=$2 ] ,
85
+ AS_IF ( [ test -z "$1 " && test -z "$2 "] ,
86
+ [ AC_CHECK_LIB ( [ $3 ] , [ $4 ] ,
87
+ [ opal_check_$3 _lib_happy=yes] ,
77
88
[ opal_check_$3 _lib_happy=no] ) ] ,
78
- [ opal_check_$3 _lib_happy=no
79
- AC_MSG_RESULT ( [ not found] ) ] )
80
-
81
- # check for presence of lib64 directory - if found, see if the
82
- # desired library is present and matches our build requirements
83
- files=`ls $2 /lib64/lib$3 .* 2> /dev/null | wc -l`
84
- AS_IF ( [ test "$opal_check_$3 _lib_happy" != "yes"] ,
85
- [ AC_MSG_CHECKING ( [ for lib$3 in $2 /lib64] )
86
- AS_IF ( [ test "$files" -gt "0"] ,
87
- [ AC_MSG_RESULT ( [ found] )
88
- LDFLAGS="$LDFLAGS -L$2 /lib64"
89
- AC_CHECK_LIB ( [ $3 ] , [ $4 ] ,
90
- [ opal_check_$3 _lib_happy=yes
91
- $3 _LDFLAGS=-L$2 /lib64
92
- $3 _rpath=$2 /lib64] ,
93
- [ opal_check_$3 _lib_happy=no] ) ] ,
94
- [ opal_check_$3 _lib_happy=no
95
- AC_MSG_RESULT ( [ not found] ) ] ) ] )
96
-
97
-
98
- # if we didn't find lib64, or the library wasn't present or correct,
99
- # then try a lib directory if present
100
- files=`ls $2 /lib/lib$3 .* 2> /dev/null | wc -l`
101
- AS_IF ( [ test "$opal_check_$3 _lib_happy" != "yes"] ,
102
- [ AC_MSG_CHECKING ( [ for lib$3 in $2 /lib] )
103
- AS_IF ( [ test "$files" -gt "0"] ,
104
- [ AC_MSG_RESULT ( [ found] )
105
- LDFLAGS="$LDFLAGS -L$2 /lib"
106
- AC_CHECK_LIB ( [ $3 ] , [ $4 ] ,
107
- [ opal_check_$3 _lib_happy=yes
108
- $3 _LDFLAGS=-L$2 /lib
109
- $3 _rpath=$2 /lib] ,
110
- [ opal_check_$3 _lib_happy=no] ) ] ,
111
- [ opal_check_$3 _lib_happy=no
112
- AC_MSG_RESULT ( [ not found] ) ] ) ] )
89
+ [ AS_IF ( [ test -n "$2 "] ,
90
+ [ AC_MSG_CHECKING ( [ for lib$3 in $2 ] )
91
+ files=`ls $2 /lib$3 .* 2> /dev/null | wc -l`
92
+ AS_IF ( [ test "$files" -gt "0"] ,
93
+ [ AC_MSG_RESULT ( [ found] )
94
+ LDFLAGS="$LDFLAGS -L$2 "
95
+ AC_CHECK_LIB ( [ $3 ] , [ $4 ] ,
96
+ [ opal_check_$3 _lib_happy=yes
97
+ $3 _LDFLAGS=-L$2
98
+ $3 _rpath=$2 ] ,
99
+ [ opal_check_$3 _lib_happy=no] ) ] ,
100
+ [ opal_check_$3 _lib_happy=no
101
+ AC_MSG_RESULT ( [ not found] ) ] ) ] ,
102
+ [ AC_MSG_CHECKING ( [ for lib$3 in $1 /lib] )
103
+ files=`ls $1 /lib/lib$3 .* 2> /dev/null | wc -l`
104
+ AS_IF ( [ test "$files" -gt "0"] ,
105
+ [ AC_MSG_RESULT ( [ found] )
106
+ LDFLAGS="$LDFLAGS -L$1 /lib"
107
+ AC_CHECK_LIB ( [ $3 ] , [ $4 ] ,
108
+ [ opal_check_$3 _lib_happy=yes
109
+ $3 _LDFLAGS=-L$1 /lib
110
+ $3 _rpath=$1 /lib] ,
111
+ [ opal_check_$3 _lib_happy=no] ) ] ,
112
+ [ # check for presence of lib64 directory - if found, see if the
113
+ # desired library is present and matches our build requirements
114
+ AC_MSG_CHECKING ( [ for lib$3 in $1 /lib64] )
115
+ files=`ls $1 /lib64/lib$3 .* 2> /dev/null | wc -l`
116
+ AS_IF ( [ test "$files" -gt "0"] ,
117
+ [ AC_MSG_RESULT ( [ found] )
118
+ LDFLAGS="$LDFLAGS -L$1 /lib64"
119
+ AC_CHECK_LIB ( [ $3 ] , [ $4 ] ,
120
+ [ opal_check_$3 _lib_happy=yes
121
+ $3 _LDFLAGS=-L$1 /lib64
122
+ $3 _rpath=$1 /lib64] ,
123
+ [ opal_check_$3 _lib_happy=no] ) ] ,
124
+ [ opal_check_$3 _lib_happy=no
125
+ AC_MSG_RESULT ( [ not found] ) ] ) ] ) ] ) ] )
113
126
114
127
# restore flags
115
128
CPPFLAGS=$opal_check_$3 _save_CPPFLAGS
@@ -124,7 +137,7 @@ AC_DEFUN([OPAL_CHECK_PMI_LIB],
124
137
# OPAL_CHECK_PMI()
125
138
# --------------------------------------------------------
126
139
AC_DEFUN ( [ OPAL_CHECK_PMI] ,[
127
- OPAL_VAR_SCOPE_PUSH([ check_pmi_install_dir check_pmi_lib_dir default_pmi_loc default_pmi_libloc slurm_pmi_found] )
140
+ OPAL_VAR_SCOPE_PUSH([ check_pmi_install_dir check_pmi_lib_dir default_pmi_libloc slurm_pmi_found] )
128
141
129
142
AC_ARG_WITH ( [ pmi] ,
130
143
[ AC_HELP_STRING ([ --with-pmi(=DIR)] ,
@@ -137,7 +150,6 @@ AC_DEFUN([OPAL_CHECK_PMI],[
137
150
138
151
check_pmi_install_dir=
139
152
check_pmi_lib_dir=
140
- default_pmi_loc=
141
153
default_pmi_libloc=
142
154
slurm_pmi_found=
143
155
@@ -149,18 +161,10 @@ AC_DEFUN([OPAL_CHECK_PMI],[
149
161
# cannot use OPAL_CHECK_PACKAGE as its backend header
150
162
# support appends "include" to the path, which won't
151
163
# work with slurm :-(
152
- AS_IF ( [ test ! -z "$with_pmi" && test "$with_pmi" != "yes"] ,
153
- [ check_pmi_install_dir=$with_pmi
154
- default_pmi_loc=no] ,
155
- [ check_pmi_install_dir=/usr
156
- default_pmi_loc=yes] )
157
- AS_IF ( [ test ! -z "$with_pmi_libdir"] ,
158
- [ check_pmi_lib_dir=$with_pmi_libdir
159
- default_pmi_libloc=no] ,
160
- [ check_pmi_lib_dir=$check_pmi_install_dir
161
- AS_IF ( [ test "$default_pmi_loc" = "no"] ,
162
- [ default_pmi_libloc=no] ,
163
- [ default_pmi_libloc=yes] ) ] )
164
+ AS_IF ( [ test -n "$with_pmi" && test "$with_pmi" != "yes"] ,
165
+ [ check_pmi_install_dir=$with_pmi] )
166
+ AS_IF ( [ test -n "$with_pmi_libdir"] ,
167
+ [ check_pmi_lib_dir=$with_pmi_libdir] )
164
168
165
169
# check for pmi-1 lib */
166
170
slurm_pmi_found=no
@@ -174,10 +178,10 @@ AC_DEFUN([OPAL_CHECK_PMI],[
174
178
[ opal_enable_pmi1=no] )
175
179
176
180
AS_IF ( [ test "$opal_enable_pmi1" = "yes"] ,
177
- [ AS_IF ( [ test "$default_pmi_loc" = "no" || test "$ slurm_pmi_found" = "yes"] ,
181
+ [ AS_IF ( [ test "$slurm_pmi_found" = "yes"] ,
178
182
[ opal_pmi1_CPPFLAGS="$pmi_CPPFLAGS"
179
183
AC_SUBST ( opal_pmi1_CPPFLAGS ) ] )
180
- AS_IF ( [ test "$default_pmi_libloc" = "no" || test "$ slurm_pmi_found" = "yes"] ,
184
+ AS_IF ( [ test "$slurm_pmi_found" = "yes"] ,
181
185
[ opal_pmi1_LDFLAGS="$pmi_LDFLAGS"
182
186
AC_SUBST ( opal_pmi1_LDFLAGS )
183
187
opal_pmi1_rpath="$pmi_rpath"
@@ -195,10 +199,10 @@ AC_DEFUN([OPAL_CHECK_PMI],[
195
199
[ opal_enable_pmi2=no] )
196
200
197
201
AS_IF ( [ test "$opal_enable_pmi2" = "yes"] ,
198
- [ AS_IF ( [ test "$default_pmi_loc" = "no" || test "$ slurm_pmi_found" = "yes"] ,
202
+ [ AS_IF ( [ test "$slurm_pmi_found" = "yes"] ,
199
203
[ opal_pmi2_CPPFLAGS="$pmi2_CPPFLAGS"
200
204
AC_SUBST ( opal_pmi2_CPPFLAGS ) ] )
201
- AS_IF ( [ test "$default_pmi_libloc" = "no" || test "$ slurm_pmi_found" = "yes"] ,
205
+ AS_IF ( [ test "$slurm_pmi_found" = "yes"] ,
202
206
[ opal_pmi2_LDFLAGS="$pmi2_LDFLAGS"
203
207
AC_SUBST ( opal_pmi2_LDFLAGS )
204
208
opal_pmi2_rpath="$pmi2_rpath"
0 commit comments