14
14
# Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights
15
15
# reserved.
16
16
# Copyright (c) 2014-2017 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,30 @@ 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 /include] )
44
+ AS_IF ( [ test -f $1 /include/$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 /include"] ,
52
47
[ AC_MSG_RESULT ( [ not found] )
53
- opal_check_$3 _hdr_happy=no] ) ] )
48
+ AC_MSG_CHECKING ( [ for $3 .h in $1 /include/slurm] )
49
+ AS_IF ( [ test -f $1 /include/slurm/$3 .h] ,
50
+ [ AC_MSG_RESULT ( [ found] )
51
+ opal_check_$3 _mycppflags="-I$1 /include/slurm"
52
+ $5 ] ,
53
+ [ AC_MSG_RESULT ( [ not found] )
54
+ opal_check_$3 _hdr_happy=no] ) ] ) ] ,
55
+ [ AC_MSG_CHECKING ( [ for $3 .h in /usr/include] )
56
+ AS_IF ( [ test -f /usr/include/$3 .h] ,
57
+ [ AC_MSG_RESULT ( [ found] ) ] ,
58
+ [ AC_MSG_RESULT ( [ not found] )
59
+ AC_MSG_CHECKING ( [ for $3 .h in /usr/include/slurm] )
60
+ AS_IF ( [ test -f /usr/include/slurm/$3 .h] ,
61
+ [ AC_MSG_RESULT ( [ found] )
62
+ opal_check_$3 _mycppflags="-I/usr/include/slurm"
63
+ $5 ] ,
64
+ [ AC_MSG_RESULT ( [ not found] )
65
+ opal_check_$3 _hdr_happy=no] ) ] ) ] )
54
66
55
67
AS_IF ( [ test "$opal_check_$3 _hdr_happy" != "no"] ,
56
68
[ CPPFLAGS="$CPPFLAGS $opal_check_$3 _mycppflags"
@@ -65,51 +77,47 @@ AC_DEFUN([OPAL_CHECK_PMI_LIB],
65
77
66
78
# check for the library in the given location in case
67
79
# 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 ] ,
80
+ AS_IF ( [ test -z "$1 " && test -z "$2 "] ,
81
+ [ AC_CHECK_LIB ( [ $3 ] , [ $4 ] ,
82
+ [ opal_check_$3 _lib_happy=yes] ,
77
83
[ 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] ) ] ) ] )
84
+ [ AS_IF ( [ test -n "$2 "] ,
85
+ [ AC_MSG_CHECKING ( [ for lib$3 in $2 ] )
86
+ files=`ls $2 /lib$3 .* 2> /dev/null | wc -l`
87
+ AS_IF ( [ test "$files" -gt "0"] ,
88
+ [ AC_MSG_RESULT ( [ found] )
89
+ LDFLAGS="$LDFLAGS -L$2 "
90
+ AC_CHECK_LIB ( [ $3 ] , [ $4 ] ,
91
+ [ opal_check_$3 _lib_happy=yes
92
+ $3 _LDFLAGS=-L$2
93
+ $3 _rpath=$2 ] ,
94
+ [ opal_check_$3 _lib_happy=no] ) ] ,
95
+ [ opal_check_$3 _lib_happy=no
96
+ AC_MSG_RESULT ( [ not found] ) ] ) ] ,
97
+ [ AC_MSG_CHECKING ( [ for lib$3 in $1 /lib] )
98
+ files=`ls $1 /lib/lib$3 .* 2> /dev/null | wc -l`
99
+ AS_IF ( [ test "$files" -gt "0"] ,
100
+ [ AC_MSG_RESULT ( [ found] )
101
+ LDFLAGS="$LDFLAGS -L$1 /lib"
102
+ AC_CHECK_LIB ( [ $3 ] , [ $4 ] ,
103
+ [ opal_check_$3 _lib_happy=yes
104
+ $3 _LDFLAGS=-L$1 /lib
105
+ $3 _rpath=$1 /lib] ,
106
+ [ opal_check_$3 _lib_happy=no] ) ] ,
107
+ [ # check for presence of lib64 directory - if found, see if the
108
+ # desired library is present and matches our build requirements
109
+ AC_MSG_CHECKING ( [ for lib$3 in $1 /lib64] )
110
+ files=`ls $1 /lib64/lib$3 .* 2> /dev/null | wc -l`
111
+ AS_IF ( [ test "$files" -gt "0"] ,
112
+ [ AC_MSG_RESULT ( [ found] )
113
+ LDFLAGS="$LDFLAGS -L$1 /lib64"
114
+ AC_CHECK_LIB ( [ $3 ] , [ $4 ] ,
115
+ [ opal_check_$3 _lib_happy=yes
116
+ $3 _LDFLAGS=-L$1 /lib64
117
+ $3 _rpath=$1 /lib64] ,
118
+ [ opal_check_$3 _lib_happy=no] ) ] ,
119
+ [ opal_check_$3 _lib_happy=no
120
+ AC_MSG_RESULT ( [ not found] ) ] ) ] ) ] ) ] )
113
121
114
122
# restore flags
115
123
CPPFLAGS=$opal_check_$3 _save_CPPFLAGS
@@ -124,7 +132,7 @@ AC_DEFUN([OPAL_CHECK_PMI_LIB],
124
132
# OPAL_CHECK_PMI()
125
133
# --------------------------------------------------------
126
134
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] )
135
+ OPAL_VAR_SCOPE_PUSH([ check_pmi_install_dir check_pmi_lib_dir default_pmi_libloc slurm_pmi_found] )
128
136
129
137
AC_ARG_WITH ( [ pmi] ,
130
138
[ AC_HELP_STRING ([ --with-pmi(=DIR)] ,
@@ -137,7 +145,6 @@ AC_DEFUN([OPAL_CHECK_PMI],[
137
145
138
146
check_pmi_install_dir=
139
147
check_pmi_lib_dir=
140
- default_pmi_loc=
141
148
default_pmi_libloc=
142
149
slurm_pmi_found=
143
150
@@ -149,18 +156,10 @@ AC_DEFUN([OPAL_CHECK_PMI],[
149
156
# cannot use OPAL_CHECK_PACKAGE as its backend header
150
157
# support appends "include" to the path, which won't
151
158
# 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] ) ] )
159
+ AS_IF ( [ test -n "$with_pmi" && test "$with_pmi" != "yes"] ,
160
+ [ check_pmi_install_dir=$with_pmi] )
161
+ AS_IF ( [ test -n "$with_pmi_libdir"] ,
162
+ [ check_pmi_lib_dir=$with_pmi_libdir] )
164
163
165
164
# check for pmi-1 lib */
166
165
slurm_pmi_found=no
@@ -174,10 +173,10 @@ AC_DEFUN([OPAL_CHECK_PMI],[
174
173
[ opal_enable_pmi1=no] )
175
174
176
175
AS_IF ( [ test "$opal_enable_pmi1" = "yes"] ,
177
- [ AS_IF ( [ test "$default_pmi_loc" = "no" || test "$ slurm_pmi_found" = "yes"] ,
176
+ [ AS_IF ( [ test "$slurm_pmi_found" = "yes"] ,
178
177
[ opal_pmi1_CPPFLAGS="$pmi_CPPFLAGS"
179
178
AC_SUBST ( opal_pmi1_CPPFLAGS ) ] )
180
- AS_IF ( [ test "$default_pmi_libloc" = "no" || test "$ slurm_pmi_found" = "yes"] ,
179
+ AS_IF ( [ test "$slurm_pmi_found" = "yes"] ,
181
180
[ opal_pmi1_LDFLAGS="$pmi_LDFLAGS"
182
181
AC_SUBST ( opal_pmi1_LDFLAGS )
183
182
opal_pmi1_rpath="$pmi_rpath"
@@ -195,10 +194,10 @@ AC_DEFUN([OPAL_CHECK_PMI],[
195
194
[ opal_enable_pmi2=no] )
196
195
197
196
AS_IF ( [ test "$opal_enable_pmi2" = "yes"] ,
198
- [ AS_IF ( [ test "$default_pmi_loc" = "no" || test "$ slurm_pmi_found" = "yes"] ,
197
+ [ AS_IF ( [ test "$slurm_pmi_found" = "yes"] ,
199
198
[ opal_pmi2_CPPFLAGS="$pmi2_CPPFLAGS"
200
199
AC_SUBST ( opal_pmi2_CPPFLAGS ) ] )
201
- AS_IF ( [ test "$default_pmi_libloc" = "no" || test "$ slurm_pmi_found" = "yes"] ,
200
+ AS_IF ( [ test "$slurm_pmi_found" = "yes"] ,
202
201
[ opal_pmi2_LDFLAGS="$pmi2_LDFLAGS"
203
202
AC_SUBST ( opal_pmi2_LDFLAGS )
204
203
opal_pmi2_rpath="$pmi2_rpath"
0 commit comments