@@ -148,21 +148,42 @@ AC_DEFUN([OPAL_CHECK_OPENFABRICS],[
148148 AC_CHECK_MEMBERS([struct ibv_device.transport_type], [], [],
149149 [# include <infiniband/verbs.h>])
150150
151+ # We have to check functions both exits *and* are declared
152+ # since some distro ship broken ibverbs devel headers
153+ # IBV_DEVICE_XRC is common to all OFED versions
151154 # ibv_create_xrc_rcv_qp was added in OFED 1.3
152155 # ibv_cmd_open_xrcd (aka XRC Domains) was added in OFED 3.12
153156 if test " $enable_connectx_xrc " = " yes" ; then
154- $1 _have_xrc=1
155- AC_CHECK_FUNCS([ibv_create_xrc_rcv_qp ibv_cmd_open_xrcd],
156- [], [$1 _have_xrc= 0])
157- AC_CHECK_DECLS([IBV_SRQT_XRC],
158- [], [$1 _have_xrc= 0],
157+ AC_CHECK_DECLS([IBV_DEVICE_XRC],
158+ [$1 _have_xrc= 1
159+ $1 _have_xrc_domains= 1],
160+ [],
159161 [# include <infiniband/verbs.h>])
160162 fi
161163 if test " $enable_connectx_xrc " = " yes" \
162164 && test $$ 1_have_xrc -eq 1; then
163- AC_CHECK_FUNCS([ibv_cmd_open_xrcd], [$1 _have_xrc_domains= 1])
165+ AC_CHECK_DECLS([ibv_create_xrc_rcv_qp],
166+ [AC_CHECK_FUNCS([ibv_create_xrc_rcv_qp],
167+ [], [$1 _have_xrc= 0])],
168+ [$1 _have_xrc= 0],
169+ [# include <infiniband/driver.h>])
170+ fi
171+ if test " $enable_connectx_xrc " = " yes" \
172+ && test $$ 1_have_xrc_domains -eq 1; then
173+ AC_CHECK_DECLS([ibv_cmd_open_xrcd],
174+ [AC_CHECK_DECLS([IBV_SRQT_XRC],
175+ [AC_CHECK_FUNCS([ibv_cmd_open_xrcd],
176+ [], [$1 _have_xrc_domains= 0])],
177+ [$1 _have_xrc_domains= 0],
178+ [# include <infiniband/verbs.h>])],
179+ [$1 _have_xrc_domains= 0],
180+ [# include <infiniband/driver.h>])
181+ # XRC and XRC Domains should be considered as exclusive
182+ if test " $$ 1_have_xrc" -eq 1 && \
183+ test " $$ 1_have_xrc_domains" -eq 1; then
184+ $1 _have_xrc=0
185+ fi
164186 fi
165-
166187
167188 if test " no" ! = " $enable_openib_dynamic_sl " ; then
168189 # We need ib_types.h file, which is installed with opensm-devel
0 commit comments