1414# Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights
1515# reserved.
1616# 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.
1919# Copyright (c) 2016 IBM Corporation. All rights reserved.
2020# $COPYRIGHT$
2121#
@@ -39,18 +39,35 @@ AC_DEFUN([OPAL_CHECK_PMI_LIB],
3939 opal_check_$3 _mycppflags=
4040
4141 # 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] ,
4945 [ AC_MSG_RESULT ( [ found] )
50- opal_check_$3 _mycppflags="-I$1 /include/slurm"
51- $5 ] ,
46+ opal_check_$3 _mycppflags="-I$1 "] ,
5247 [ 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] ) ] ) ] )
5471
5572 AS_IF ( [ test "$opal_check_$3 _hdr_happy" != "no"] ,
5673 [ CPPFLAGS="$CPPFLAGS $opal_check_$3 _mycppflags"
@@ -65,51 +82,47 @@ AC_DEFUN([OPAL_CHECK_PMI_LIB],
6582
6683 # check for the library in the given location in case
6784 # 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] ,
7788 [ 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] ) ] ) ] ) ] ) ] )
113126
114127 # restore flags
115128 CPPFLAGS=$opal_check_$3 _save_CPPFLAGS
@@ -124,7 +137,7 @@ AC_DEFUN([OPAL_CHECK_PMI_LIB],
124137# OPAL_CHECK_PMI()
125138# --------------------------------------------------------
126139AC_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] )
128141
129142 AC_ARG_WITH ( [ pmi] ,
130143 [ AC_HELP_STRING ([ --with-pmi(=DIR)] ,
@@ -137,7 +150,6 @@ AC_DEFUN([OPAL_CHECK_PMI],[
137150
138151 check_pmi_install_dir=
139152 check_pmi_lib_dir=
140- default_pmi_loc=
141153 default_pmi_libloc=
142154 slurm_pmi_found=
143155
@@ -149,23 +161,15 @@ AC_DEFUN([OPAL_CHECK_PMI],[
149161 # cannot use OPAL_CHECK_PACKAGE as its backend header
150162 # support appends "include" to the path, which won't
151163 # 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] )
164168
165169 # check for pmi-1 lib */
166170 slurm_pmi_found=no
167171 OPAL_CHECK_PMI_LIB([ $check_pmi_install_dir] ,
168- [ $check_pmi_lib_dir] ,
172+ [ $check_pmi_lib_dir] ,
169173 [ pmi] , [ PMI_Init] ,
170174 [ slurm_pmi_found=yes] ,
171175 [ opal_enable_pmi1=yes
@@ -174,11 +178,11 @@ AC_DEFUN([OPAL_CHECK_PMI],[
174178 [ opal_enable_pmi1=no] )
175179
176180 AS_IF ( [ test "$opal_enable_pmi1" = "yes"] ,
177- [ AS_IF ( [ test "$default_pmi_loc" = "no" || test "$ slurm_pmi_found" = "yes"] ,
178- [ opal_pmi1_CPPFLAGS="$pmi_CPPFLAGS"
181+ [ AS_IF ( [ test "$slurm_pmi_found" = "yes"] ,
182+ [ opal_pmi1_CPPFLAGS="$pmi_CPPFLAGS"
179183 AC_SUBST ( opal_pmi1_CPPFLAGS ) ] )
180- AS_IF ( [ test "$default_pmi_libloc" = "no" || test "$ slurm_pmi_found" = "yes"] ,
181- [ opal_pmi1_LDFLAGS="$pmi_LDFLAGS"
184+ AS_IF ( [ test "$slurm_pmi_found" = "yes"] ,
185+ [ opal_pmi1_LDFLAGS="$pmi_LDFLAGS"
182186 AC_SUBST ( opal_pmi1_LDFLAGS )
183187 opal_pmi1_rpath="$pmi_rpath"
184188 AC_SUBST ( opal_pmi1_rpath ) ] ) ] )
@@ -195,11 +199,11 @@ AC_DEFUN([OPAL_CHECK_PMI],[
195199 [ opal_enable_pmi2=no] )
196200
197201 AS_IF ( [ test "$opal_enable_pmi2" = "yes"] ,
198- [ AS_IF ( [ test "$default_pmi_loc" = "no" || test "$ slurm_pmi_found" = "yes"] ,
199- [ opal_pmi2_CPPFLAGS="$pmi2_CPPFLAGS"
202+ [ AS_IF ( [ test "$slurm_pmi_found" = "yes"] ,
203+ [ opal_pmi2_CPPFLAGS="$pmi2_CPPFLAGS"
200204 AC_SUBST ( opal_pmi2_CPPFLAGS ) ] )
201- AS_IF ( [ test "$default_pmi_libloc" = "no" || test "$ slurm_pmi_found" = "yes"] ,
202- [ opal_pmi2_LDFLAGS="$pmi2_LDFLAGS"
205+ AS_IF ( [ test "$slurm_pmi_found" = "yes"] ,
206+ [ opal_pmi2_LDFLAGS="$pmi2_LDFLAGS"
203207 AC_SUBST ( opal_pmi2_LDFLAGS )
204208 opal_pmi2_rpath="$pmi2_rpath"
205209 AC_SUBST ( opal_pmi2_rpath ) ] ) ] )
0 commit comments