11# -*- shell-script -*-
22#
33# Copyright (C) 2015 Mellanox Technologies Ltd. ALL RIGHTS RESERVED.
4- # Copyright (c) 2015 Research Organization for Information Science
4+ # Copyright (c) 2015-2017 Research Organization for Information Science
55# and Technology (RIST). All rights reserved.
66# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
77# reserved.
@@ -34,21 +34,20 @@ AC_DEFUN([OMPI_CHECK_UCX],[
3434 ompi_check_ucx_$1 _save_LIBS=" $LIBS "
3535
3636 AS_IF([test " $with_ucx " != " no" ],
37- [AS_IF([test ! -z " $with_ucx " && test " $with_ucx " != " yes" ],
38- [
39- ompi_check_ucx_dir= " $with_ucx "
40- ompi_check_ucx_libdir= " $with_ucx /lib"
41- ])
42- AS_IF([test ! -z " $with_ucx_libdir " && test " $with_ucx_libdir " != " yes" ],
37+ [AS_IF([test -n " $with_ucx " && test " $with_ucx " != " yes" ],
38+ [ompi_check_ucx_dir= " $with_ucx "
39+ files= ` ls $ompi_check_ucx_dir /lib64/libucp.* 2> /dev/null | wc -l`
40+ AS_IF([test " $files " -gt 0],
41+ [ompi_check_ucx_libdir= $ompi_check_ucx_dir /lib64],
42+ [ompi_check_ucx_libdir= $ompi_check_ucx_dir /lib])])
43+ AS_IF([test -n " $with_ucx_libdir " && test " $with_ucx_libdir " != " yes" ],
4344 [ompi_check_ucx_libdir= " $with_ucx_libdir " ])
4445
45- ompi_check_ucx_extra_libs= " -L$ompi_check_ucx_libdir "
46-
4746 OPAL_CHECK_PACKAGE([ompi_check_ucx],
4847 [ucp/api/ucp.h],
4948 [ucp],
5049 [ucp_cleanup],
51- [$ompi_check_ucx_extra_libs ],
50+ [],
5251 [$ompi_check_ucx_dir ],
5352 [$ompi_check_ucx_libdir ],
5453 [ompi_check_ucx_happy= " yes" ],
@@ -64,7 +63,8 @@ AC_DEFUN([OMPI_CHECK_UCX],[
6463 AC_MSG_CHECKING(for UCX version compatibility)
6564 AC_REQUIRE_CPP
6665 old_CPPFLAGS=" $CPPFLAGS "
67- CPPFLAGS=" $CPPFLAGS -I$ompi_check_ucx_dir /include"
66+ AS_IF([test -n " $ompi_check_ucx_dir " ],
67+ [CPPFLAGS= " $CPPFLAGS -I$ompi_check_ucx_dir /include" ])
6868 AC_COMPILE_IFELSE(
6969 [AC_LANG_PROGRAM([[# include <uct/api/version.h>]],
7070 [[
0 commit comments