update lustre configuration to use OMPI_CHECK_PACKAGE and only check for liblustreapi (not liblustre)
authorhjelmn
Wed Feb 06 17:22:58 2013 +0000 (4 months ago)
changeset 213750ed8e9051fb3
parent 21374 85978e2b8eb7
child 21376 81e57d5aecb5
update lustre configuration to use OMPI_CHECK_PACKAGE and only check for liblustreapi (not liblustre)
config/ompi_check_lustre.m4
     1.1 --- a/config/ompi_check_lustre.m4	Tue Feb 05 21:52:55 2013 +0000
     1.2 +++ b/config/ompi_check_lustre.m4	Wed Feb 06 17:22:58 2013 +0000
     1.3 @@ -44,67 +44,24 @@
     1.4               [Build Lustre support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])])
     1.5      OMPI_CHECK_WITHDIR([lustre], [$with_lustre], [include/lustre/liblustreapi.h])
     1.6  
     1.7 -    AC_ARG_WITH([lustre-libs], 
     1.8 -        [AC_HELP_STRING([--with-lustre-libs=LIBS],
     1.9 -                       [Libraries to link with for lustre])])
    1.10 +    AS_IF([test -z "$with_lustre"],
    1.11 +          [ompi_check_lustre_dir="/usr"],
    1.12 +          [ompi_check_lustre_dir="$with_lustre"])
    1.13  
    1.14 -    temp_with_lustre="$with_lustre"
    1.15 -    AS_IF([test -z "$with_lustre"],
    1.16 -          [with_lustre="/usr/"])
    1.17 +    if test -e "$ompi_check_lustre_dir/lib64" ; then
    1.18 +        ompi_check_lustre_libdir="$ompi_check_lustre_dir/lib64"
    1.19 +    else
    1.20 +        ompi_check_lustre_libdir="$ompi_check_lustre_dir/lib"
    1.21 +    fi
    1.22  
    1.23 -    temp_with_lustre_libs="$with_lustre_libs"
    1.24 -    AS_IF([test -z "$with_lustre_libs"],
    1.25 -	[with_lustre_libs="lustre lustreapi"])
    1.26 -    
    1.27      # Add correct -I and -L flags
    1.28 -    AS_IF([test -d "$with_lustre/include/lustre/"],
    1.29 -        [check_lustre_CPPFLAGS="-I$with_lustre/include/lustre -I$with_lustre/include"
    1.30 -            $1_CPPFLAGS="$check_lustre_CPPFLAGS"
    1.31 -            CPPFLAGS="$CPPFLAGS $check_lustre_CPPFLAGS"], 
    1.32 -	[ompi_check_lustre_happy="no"])
    1.33 -    
    1.34 -    AS_IF([test "$ompi_check_lustre_happy" = "yes"],
    1.35 -	[AS_IF([test -d "$with_lustre/lib64"],
    1.36 -		[check_lustre_LDFLAGS="-L$with_lustre/lib64"
    1.37 -		    $1_LDFLAGS="$check_lustre_LDFLAGS"
    1.38 -		    LDFLAGS="$LDFLAGS $check_lustre_LDFLAGS"],
    1.39 -		[ompi_check_lustre_happy="no"]) 
    1.40 -    ],[])
    1.41 -	    
    1.42 -    # Try to find all the lustre libraries
    1.43 -    AS_IF([test "$ompi_check_lustre_happy" = "yes"],
    1.44 -	[ AS_IF([test -n "$with_lustre_libs"]
    1.45 -		[for lib in $with_lustre_libs ; do
    1.46 -		    check_lustre_LIBS="$check_lustre_LIBS -l$lib"
    1.47 -		    done]) 
    1.48 -		
    1.49 -	    $1_LIBS="$check_lustre_LIBS"
    1.50 -	    LIBS="$LIBS $check_lustre_LIBS"
    1.51 -
    1.52 -            # check for lustre
    1.53 -	    AC_CHECK_HEADERS([liblustreapi.h],
    1.54 -		[AC_MSG_CHECKING([if possible to link LUSTRE])
    1.55 -		    AC_LINK_IFELSE([AC_LANG_PROGRAM(
    1.56 -				[[#include <stdio.h>
    1.57 -                                  #include <liblustreapi.h>]], 
    1.58 -				[[llapi_file_create(NULL,0,-1,0, 0);]])],
    1.59 -			[AC_MSG_RESULT([yes])
    1.60 -			    ompi_check_lustre_happy="yes"],
    1.61 -			[AC_MSG_RESULT([no])
    1.62 -			    ompi_check_lustre_happy="no"])],
    1.63 -		[ompi_check_lustre_happy="no"])
    1.64 -    ])
    1.65 -
    1.66 -    LDFLAGS="$check_lustre_save_LDFLAGS"
    1.67 -    CPPFLAGS="$check_lustre_save_CPPFLAGS"
    1.68 -    LIBS="$check_lustre_save_LIBS"
    1.69 +    OMPI_CHECK_PACKAGE([$1], [lustre/liblustreapi.h], [lustreapi], [llapi_file_create], [],
    1.70 +                       [$ompi_check_lustre_dir], [$ompi_check_lustre_libdir], [ompi_check_lustre_happy="yes"],
    1.71 +                       [ompi_check_lustre_happy="no"])
    1.72  
    1.73      AS_IF([test "$ompi_check_lustre_happy" = "yes"],
    1.74            [$2],
    1.75            [AS_IF([test ! -z "$with_lustre" -a "$with_lustre" != "no"],
    1.76                    [echo LUSTRE support not found])
    1.77                $3])
    1.78 -
    1.79 -    with_lustre="$temp_with_lustre"
    1.80 -    with_lustre_libs="$temp_with_lustre_libs"
    1.81  ])