Skip to content

Commit ee9baf0

Browse files
authored
Merge pull request #7656 from hppritcha/topic/fix_issue_7580
rework check lustre config to avoid rpath lib64
2 parents 2e22a24 + ea690d0 commit ee9baf0

File tree

1 file changed

+32
-30
lines changed

1 file changed

+32
-30
lines changed

config/ompi_check_lustre.m4

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ dnl Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
1414
dnl Copyright (c) 2008-2018 University of Houston. All rights reserved.
1515
dnl Copyright (c) 2015-2018 Research Organization for Information Science
1616
dnl and Technology (RIST). All rights reserved.
17+
dnl Copyright (c) 2020 Triad National Security, LLC. All rights
18+
dnl reserved.
1719
dnl $COPYRIGHT$
1820
dnl
1921
dnl Additional copyrights may follow
@@ -36,7 +38,6 @@ AC_DEFUN([OMPI_CHECK_LUSTRE],[
3638
check_lustre_save_LDFLAGS="$LDFLAGS"
3739
check_lustre_save_CPPFLAGS="$CPPFLAGS"
3840

39-
check_lustre_configuration="none"
4041
ompi_check_lustre_happy="yes"
4142

4243
# Get some configuration information
@@ -46,26 +47,28 @@ AC_DEFUN([OMPI_CHECK_LUSTRE],[
4647
OPAL_CHECK_WITHDIR([lustre], [$with_lustre], [include/lustre/lustreapi.h])
4748

4849
AS_IF([test "$with_lustre" = "no"],
49-
[ompi_check_lustre_happy="no"],
50-
[AS_IF([test -z "$with_lustre" || test "$with_lustre" = "yes"],
51-
[ompi_check_lustre_dir="/usr"],
52-
[ompi_check_lustre_dir=$with_lustre])
53-
54-
if test -e "$ompi_check_lustre_dir/lib64" ; then
55-
ompi_check_lustre_libdir="$ompi_check_lustre_dir/lib64"
56-
else
57-
ompi_check_lustre_libdir="$ompi_check_lustre_dir/lib"
58-
fi
59-
60-
# Add correct -I and -L flags
61-
OPAL_CHECK_PACKAGE([$1], [lustre/lustreapi.h], [lustreapi], [llapi_file_create],
50+
[ompi_check_lustre_happy=no])
51+
52+
AS_IF([test "$ompi_check_lustre_happy" != "no" ],
53+
[AC_MSG_CHECKING([looking for lustre libraries and header files in])
54+
AS_IF([test "$with_lustre" != "yes"],
55+
[ompi_check_lustre_dir=$with_lustre
56+
AC_MSG_RESULT([($ompi_check_lustre_dir)])],
57+
[AC_MSG_RESULT([(default search paths)])])
58+
AS_IF([test -n "$with_lustre_libdir" && \
59+
test "$with_lustre_libdir" != "yes"],
60+
[ompi_check_lustre_libdir=$with_lustre_libdir])
61+
])
62+
63+
AS_IF([test "$ompi_check_lustre_happy" != "no" ],
64+
[OPAL_CHECK_PACKAGE([$1], [lustre/lustreapi.h], [lustreapi], [llapi_file_create],
6265
[], [$ompi_check_lustre_dir], [$ompi_check_lustre_libdir],
6366
[ompi_check_lustre_happy="yes"],
64-
[ompi_check_lustre_happy="no"])
67+
[ompi_check_lustre_happy="no"])])
6568

66-
AS_IF([test "$ompi_check_lustre_happy" = "yes"],
67-
[AC_MSG_CHECKING([for required lustre data structures])
68-
cat > conftest.c <<EOF
69+
AS_IF([test "$ompi_check_lustre_happy" = "yes"],
70+
[AC_MSG_CHECKING([for required lustre data structures])
71+
cat > conftest.c <<EOF
6972
#include "lustre/lustreapi.h"
7073
void alloc_lum()
7174
{
@@ -77,20 +80,19 @@ void alloc_lum()
7780
}
7881
EOF
7982

80-
# Try the compile
81-
OPAL_LOG_COMMAND(
82-
[$CC $CFLAGS -I$ompi_check_lustre_dir/include -c conftest.c],
83-
[ompi_check_lustre_struct_happy="yes"],
84-
[ompi_check_lustre_struct_happy="no"
85-
ompi_check_lustre_happy="no"]
86-
)
87-
rm -f conftest.c conftest.o
88-
AC_MSG_RESULT([$ompi_check_lustre_struct_happy])])
89-
])
83+
# Try the compile
84+
OPAL_LOG_COMMAND(
85+
[$CC $CFLAGS -I$ompi_check_lustre_dir/include -c conftest.c],
86+
[ompi_check_lustre_struct_happy="yes"],
87+
[ompi_check_lustre_struct_happy="no"
88+
ompi_check_lustre_happy="no"]
89+
)
90+
rm -f conftest.c conftest.o
91+
AC_MSG_RESULT([$ompi_check_lustre_struct_happy])])
9092

9193
AS_IF([test "$ompi_check_lustre_happy" = "yes"],
9294
[$2],
93-
[AS_IF([test ! -z "$with_lustre" && test "$with_lustre" != "no"],
95+
[AS_IF([test -n "$with_lustre" && test "$with_lustre" != "no"],
9496
[AC_MSG_ERROR([Lustre support requested but not found. Aborting])])
95-
$3])
97+
$3])
9698
])

0 commit comments

Comments
 (0)