Skip to content

Commit 819b0ac

Browse files
committed
configury: cleanup the configury logic for ime, lustre and pvfs2
Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
1 parent 2bacf00 commit 819b0ac

File tree

3 files changed

+51
-101
lines changed

3 files changed

+51
-101
lines changed

config/ompi_check_ime.m4

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
dnl -*- shell-script -*-
22
dnl
33
dnl Copyright (c) 2018 DataDirect Networks. All rights reserved.
4+
dnl Copyright (c) 2021 Research Organization for Information Science
5+
dnl and Technology (RIST). All rights reserved.
46
dnl $COPYRIGHT$
57
dnl
68
dnl Additional copyrights may follow
@@ -15,13 +17,7 @@ dnl
1517
# support, otherwise executes action-if-not-found
1618
AC_DEFUN([OMPI_CHECK_IME],[
1719

18-
check_ime_CPPFLAGS=
19-
check_ime_LDFLAGS=
20-
check_ime_LIBS=
21-
22-
check_ime_configuration="none"
23-
ompi_check_ime_happy="yes"
24-
20+
OPAL_VAR_SCOPE_PUSH([ompi_check_ime_happy ompi_check_ime_dir])
2521

2622
# Get some configuration information
2723
AC_ARG_WITH([ime],
@@ -30,33 +26,21 @@ AC_DEFUN([OMPI_CHECK_IME],[
3026
OPAL_CHECK_WITHDIR([ime], [$with_ime], [include/ime_native.h])
3127

3228
AS_IF([test "$with_ime" = "no"],
33-
[ompi_check_ime_happy="no"],
34-
[AS_IF([test -z "$with_ime"],
35-
[ompi_check_ime_dir="/usr/local"],
36-
[ompi_check_ime_dir=$with_ime])
37-
38-
if test -e "$ompi_check_ime_dir/lib64" ; then
39-
ompi_check_ime_libdir="$ompi_check_ime_dir/lib64"
40-
else
41-
ompi_check_ime_libdir="$ompi_check_ime_dir/lib"
42-
fi
43-
44-
# Add correct -I and -L flags
45-
OPAL_CHECK_PACKAGE([$1], [ime_native.h], [im_client], [ime_client_native2_init], [],
46-
[$ompi_check_ime_dir], [$ompi_check_ime_libdir],
47-
[ompi_check_ime_happy="yes"],
48-
[OPAL_CHECK_PACKAGE([$1], [ime_native.h], [im_client], [ime_native_init], [],
49-
[$ompi_check_ime_dir], [$ompi_check_ime_libdir],
50-
[ompi_check_ime_happy="yes"],
51-
[ompi_check_ime_happy="no"])
52-
])
53-
])
29+
[ompi_check_ime_happy="no"],
30+
[AS_IF([test -n "$with_ime" && test "$with_ime" != "yes"],
31+
[ompi_check_ime_dir=$with_ime])
32+
33+
OPAL_CHECK_PACKAGE([$1], [ime_native.h], [im_client], [ime_client_native2_init],
34+
[], [$ompi_check_ime_dir], [],
35+
[ompi_check_ime_happy="yes"],
36+
[ompi_check_ime_happy="no"])])
5437

5538
AS_IF([test "$ompi_check_ime_happy" = "yes"],
56-
[$2],
57-
[AS_IF([test ! -z "$with_ime" && test "$with_ime" != "no"],
58-
[echo IME support not found])
59-
$3])
60-
61-
])
39+
[$2],
40+
[AS_IF([test ! -z "$with_ime" && test "$with_ime" != "no"],
41+
[AC_MSG_ERROR([IME support requested but not found. Aborting])])
42+
$3])
43+
44+
OPAL_VAR_SCOPE_POP
45+
])
6246

config/ompi_check_lustre.m4

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dnl Copyright (c) 2004-2006 The Regents of the University of California.
1212
dnl All rights reserved.
1313
dnl Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
1414
dnl Copyright (c) 2008-2018 University of Houston. All rights reserved.
15-
dnl Copyright (c) 2015-2018 Research Organization for Information Science
15+
dnl Copyright (c) 2015-2021 Research Organization for Information Science
1616
dnl and Technology (RIST). All rights reserved.
1717
dnl Copyright (c) 2020 Triad National Security, LLC. All rights
1818
dnl reserved.
@@ -30,15 +30,7 @@ dnl
3030
# support, otherwise executes action-if-not-found
3131
AC_DEFUN([OMPI_CHECK_LUSTRE],[
3232

33-
check_lustre_CPPFLAGS=
34-
check_lustre_LDFLAGS=
35-
check_lustre_LIBS=
36-
37-
check_lustre_save_LIBS="$LIBS"
38-
check_lustre_save_LDFLAGS="$LDFLAGS"
39-
check_lustre_save_CPPFLAGS="$CPPFLAGS"
40-
41-
ompi_check_lustre_happy="yes"
33+
OPAL_VAR_SCOPE_PUSH([ompi_check_lustre_happy ompi_check_lustre_dir])
4234

4335
# Get some configuration information
4436
AC_ARG_WITH([lustre],
@@ -47,25 +39,15 @@ AC_DEFUN([OMPI_CHECK_LUSTRE],[
4739
OPAL_CHECK_WITHDIR([lustre], [$with_lustre], [include/lustre/lustreapi.h])
4840

4941
AS_IF([test "$with_lustre" = "no"],
50-
[ompi_check_lustre_happy=no])
42+
[ompi_check_lustre_happy="no"],
43+
[AS_IF([test -n "$with_lustre" && test "$with_lustre" != "yes"],
44+
[ompi_check_lustre_dir=$with_lustre])
5145

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-
])
46+
OPAL_CHECK_PACKAGE([$1], [lustre/lustreapi.h], [lustreapi], [llapi_file_create],
47+
[], [$ompi_check_lustre_dir], [],
48+
[ompi_check_lustre_happy="yes"],
49+
[ompi_check_lustre_happy="no"])])
6250

63-
AS_IF([test "$ompi_check_lustre_happy" != "no" ],
64-
[OPAL_CHECK_PACKAGE([$1], [lustre/lustreapi.h], [lustreapi], [llapi_file_create],
65-
[], [$ompi_check_lustre_dir], [$ompi_check_lustre_libdir],
66-
[ompi_check_lustre_happy="yes"],
67-
[ompi_check_lustre_happy="no"])])
68-
6951
AS_IF([test "$ompi_check_lustre_happy" = "yes"],
7052
[AC_MSG_CHECKING([for required lustre data structures])
7153
cat > conftest.c <<EOF
@@ -81,18 +63,16 @@ void alloc_lum()
8163
EOF
8264

8365
# 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])])
66+
OPAL_LOG_COMMAND([$CC $CFLAGS $$1_CPPFLAGS -c conftest.c],
67+
[], [ompi_check_lustre_happy="no"])
68+
rm -f conftest.c conftest.o
69+
AC_MSG_RESULT([$ompi_check_lustre_happy])])
9270

9371
AS_IF([test "$ompi_check_lustre_happy" = "yes"],
9472
[$2],
9573
[AS_IF([test -n "$with_lustre" && test "$with_lustre" != "no"],
9674
[AC_MSG_ERROR([Lustre support requested but not found. Aborting])])
97-
$3])
75+
$3])
76+
77+
OPAL_VAR_SCOPE_POP
9878
])

config/ompi_check_pvfs2.m4

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ dnl Copyright (c) 2004-2006 The Regents of the University of California.
1212
dnl All rights reserved.
1313
dnl Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
1414
dnl Copyright (c) 2008-2018 University of Houston. All rights reserved.
15-
dnl Copyright (c) 2015 Research Organization for Information Science
16-
dnl and Technology (RIST). All rights reserved.
15+
dnl Copyright (c) 2015-2021 Research Organization for Information Science
16+
dnl and Technology (RIST). All rights reserved.
1717
dnl $COPYRIGHT$
1818
dnl
1919
dnl Additional copyrights may follow
@@ -28,13 +28,7 @@ dnl
2828
# support, otherwise executes action-if-not-found
2929
AC_DEFUN([OMPI_CHECK_PVFS2],[
3030

31-
check_pvfs2_CPPFLAGS=
32-
check_pvfs2_LDFLAGS=
33-
check_pvfs2_LIBS=
34-
35-
check_pvfs2_configuration="none"
36-
ompi_check_pvfs2_happy="yes"
37-
31+
OPAL_VAR_SCOPE_PUSH([ompi_check_pvfs2_happy ompi_check_pvfs2_dir])
3832

3933
# Get some configuration information
4034
AC_ARG_WITH([pvfs2],
@@ -43,29 +37,21 @@ AC_DEFUN([OMPI_CHECK_PVFS2],[
4337
OPAL_CHECK_WITHDIR([pvfs2], [$with_pvfs2], [include/pvfs2.h])
4438

4539
AS_IF([test "$with_pvfs2" = "no"],
46-
[ompi_check_pvfs2_happy="no"],
47-
[AS_IF([test -z "$with_pvfs2"],
48-
[ompi_check_pvfs2_dir="/usr/local"],
49-
[ompi_check_pvfs2_dir=$with_pvfs2])
50-
51-
if test -e "$ompi_check_pvfs2_dir/lib64" ; then
52-
ompi_check_pvfs2_libdir="$ompi_check_pvfs2_dir/lib64"
53-
else
54-
ompi_check_pvfs2_libdir="$ompi_check_pvfs2_dir/lib"
55-
fi
56-
57-
# Add correct -I and -L flags
58-
OPAL_CHECK_PACKAGE([$1], [pvfs2.h], [pvfs2], [PVFS_util_resolve], [],
59-
[$ompi_check_pvfs2_dir], [$ompi_check_pvfs2_libdir],
60-
[ompi_check_pvfs2_happy="yes"],
61-
[ompi_check_pvfs2_happy="no"])
40+
[ompi_check_pvfs2_happy="no"],
41+
[AS_IF([test -n "$with_pvfs2" && test "$with_pvfs2" != "yes"],
42+
[ompi_check_pvfs2_dir=$with_pvfs2])
43+
OPAL_CHECK_PACKAGE([$1], [pvfs2.h], [pvfs2], [PVFS_util_resolve],
44+
[], [$ompi_check_pvfs2_dir], [],
45+
[ompi_check_pvfs2_happy="yes"],
46+
[ompi_check_pvfs2_happy="no"])
6247
])
6348

6449
AS_IF([test "$ompi_check_pvfs2_happy" = "yes"],
65-
[$2],
66-
[AS_IF([test ! -z "$with_pvfs2" && test "$with_pvfs2" != "no"],
67-
[echo PVFS2 support not found])
68-
$3])
69-
70-
])
50+
[$2],
51+
[AS_IF([test ! -z "$with_pvfs2" && test "$with_pvfs2" != "no"],
52+
[AC_MSG_ERROR([PVFS2 support requested but not found. Aborting])])
53+
$3])
54+
55+
OPAL_VAR_SCOPE_POP
56+
])
7157

0 commit comments

Comments
 (0)