[Pvfs2-users] Build issue with pvfs-2.7.0, GM, and x86_64

Scott Atchley atchley at myri.com
Mon Feb 11 11:23:55 EST 2008


On Feb 10, 2008, at 12:19 PM, Pete Wyckoff wrote:

> Craig.Tierney at noaa.gov wrote on Thu, 10 Jan 2008 11:54 -0700:
>> Pete Wyckoff wrote:
>>> Craig.Tierney at noaa.gov wrote on Thu, 10 Jan 2008 09:48 -0700:
>>>> I found a problem building pvfs-2.7.0, GM, on an
>>>> x86_64 platform.  The file Makefile.in assumes that
>>>> the libraries for GM are found in -L at GM_HOME@/lib,
>>>> but since the system is 64-bit, they are in -L at GM_HOME@/lib64.
>>>> I have never used MX, but I suspect it has the same problem.
>>>>
>>>> Changing the Makefile.in file allowed me to build the
>>>> code, but I suspect this should be automated.
>>>
>>> I don't use GM or MX, so can't really test this.  But I did the IB
>>> configure rules a while back and it is still fresh enough in my mind
>>> for me to do similar for these.  Here's a first stab at a patch.  If
>>> you are willing to test the GM part and make it work for you, we can
>>> check it in and cross fingers there are no typos.
>>
>> I will test it out and send it back for inclusion.
>
> Craig, did you get a chance to look at this?
>
> Scott, I think it's a worthwhile cleanup regardless.  Can you glance
> over the MX bits and see if I made any obvious mistakes?  Some
> differences:
>
>     -I @MX_HOME@/include only affects mx.c now, not entire tree.
>
>     Removed the "-g -O0" global CFLAGS, hoping mx will work for
>     whatever CFLAGS one might choose.
>
>     Addition of --with-mx-includes and --with-mx-libs with defaults
>     as @MX_HOME@/include; and @MX_HOME@/lib64 or @MX_HOME@/lib,
>     whichever exists, in that order.
>
>     Check for existence of libmyriexpress.so or .a in libdir.
>
> I think it will be more robust in case you run into vendor-installed
> RPMs or such where you don't have the handy lib soft link into the
> right place.  We must fix it on GM at least to address Craig's
> 64-bit machine config problem, but the MX bit is your call.
>
> 		-- Pete

Pete,

I do not see any problems.

In some applications that use MX, "--with-mx" is allowable (without a  
path). This assumes that MX is in /opt/mx which is the default  
install path.

Scott

>
>
> From 5951ebd35ee250bc762d20e644dbce93c8802383 Sun Feb 10 12:15:24  
> EST 2008
> From: Pete Wyckoff <pw at osc.edu>
> Date: Sun, 10 Feb 2008 12:03:17 -0500
> Subject: [PATCH] gm-mx-autoconf
>
> Convert GM and MX to use autoconf tests to find includes and libs.   
> Move
> these tests into new config files to keep the top-level Makefile  
> clean.
> This fixes a configuration problem with GM on x86_64 where libs are
> in lib64/, and generalizes both GM and MX to be a bit more clever at
> autodetection.
>
> Signed-off-by: Pete Wyckoff <pw at osc.edu>
> ---
>  Makefile.in                    |   32 +++-----
>  configure                      |  167 +++++++++++++++++++++++++++++ 
> +++--------
>  configure.in                   |   49 ++----------
>  maint/config/gm.m4             |   72 +++++++++++++++++
>  maint/config/mx.m4             |   73 +++++++++++++++++
>  src/apps/admin/pvfs2-config.in |    8 +-
>  src/io/bmi/bmi_gm/module.mk.in |   45 ++++++++----
>  src/io/bmi/bmi_mx/module.mk.in |   40 +++++++---
>  8 files changed, 363 insertions(+), 123 deletions(-)
>  create mode 100644 maint/config/gm.m4
>  create mode 100644 maint/config/mx.m4
>
> diff --git a/Makefile.in b/Makefile.in
> index f487bcf..e5b42a3 100644
> --- a/Makefile.in
> +++ b/Makefile.in
> @@ -299,32 +299,24 @@ endif
>  # enable GM if configure detected it
>
>  ifdef BUILD_GM
> -	CFLAGS += -I @GM_HOME@/include -I @GM_HOME@/include/gm
> -	CFLAGS += -D__STATIC_METHOD_BMI_GM__
> -	# TODO: later on we will want the ability to modify this at  
> configure
> -	# time
> -	CFLAGS += -DENABLE_GM_BUFPOOL
> -	LDFLAGS += -L at GM_HOME@/lib
> -	SERVER_LDFLAGS += -L at GM_HOME@/lib
> -	LIBS += -lgm
> -	LIBS_THREADED += -lgm
> -	SERVERLIBS += -lgm
> +    # other settings in bmi_gm/module.mk.in
> +    CFLAGS += -D__STATIC_METHOD_BMI_GM__
> +    GMLIBS := -L at GM_LIBDIR@ -lgm
> +    LIBS += $(GMLIBS)
> +    LIBS_THREADED += $(GMLIBS)
> +    SERVERLIBS += $(GMLIBS)
>  endif
>
>  ################################################################
>  # enable MX if configure detected it
>
>  ifdef BUILD_MX
> -	CFLAGS += -I @MX_HOME@/include
> -	CFLAGS += -D__STATIC_METHOD_BMI_MX__
> -	# TODO: later on we will want the ability to modify this at  
> configure
> -	# time
> -	CFLAGS += -g -O0
> -	LDFLAGS += -L at MX_HOME@/lib
> -	SERVER_LDFLAGS += -L at MX_HOME@/lib
> -	LIBS += -lmyriexpress -lpthread
> -	LIBS_THREADED += -lmyriexpress -lpthread
> -	SERVERLIBS += -lmyriexpress -lpthread
> +    # other settings in bmi_mx/module.mk.in
> +    CFLAGS += -D__STATIC_METHOD_BMI_MX__
> +    MXLIBS := -L at MX_LIBDIR@ -lmyriexpress -lpthread
> +    LIBS += $(MXLIBS)
> +    LIBS_THREADED += $(MXLIBS)
> +    SERVERLIBS += $(MXLIBS)
>  endif
>
>  #####################################
> diff --git a/configure b/configure
> index 59c4752..679baa2 100755
> --- a/configure
> +++ b/configure
> @@ -712,10 +712,12 @@ NEEDS_LIBRT
>  TARGET_OS_DARWIN
>  TARGET_OS_LINUX
>  BUILD_BMI_TCP
> -GM_HOME
>  BUILD_GM
> -MX_HOME
> +GM_INCDIR
> +GM_LIBDIR
>  BUILD_MX
> +MX_INCDIR
> +MX_LIBDIR
>  BUILD_IB
>  IB_INCDIR
>  IB_LIBDIR
> @@ -1355,8 +1357,12 @@ Optional Packages:
>    --with-valgrind=<path>  Use valgrind annotations for debugging.
>    --with-db=<dir>         Location of installed DB package  
> (default=/usr)
>    --without-bmi-tcp       Disable BMI TCP method
> -  --with-gm=<dir>         Location of the GM installation (default  
> no GM)
> -  --with-mx=<dir>         Location of the MX installation (default  
> no MX)
> +  --with-gm=<dir>     Location of the GM install (default no GM)
> +  --with-gm-includes=<dir>  Location of the GM includes
> +  --with-gm-libs=<dir>      Location of the GM libraries
> +  --with-mx=<dir>     Location of the MX install (default no MX)
> +  --with-mx-includes=<dir>  Location of the MX includes
> +  --with-mx-libs=<dir>      Location of the MX libraries
>    --with-ib=<dir>         Location of the IB installation (default  
> no IB)
>    --with-ib-includes=<dir>      Location of the IB includes
>    --with-ib-libs=<dir>          Location of the IB libraries
> @@ -14439,24 +14445,62 @@ fi
>
>
>
> -GM_HOME=
> +
> +                    gm_home=
>
>  # Check whether --with-gm was given.
>  if test "${with_gm+set}" = set; then
>    withval=$with_gm; if test -z "$withval" -o "$withval" = yes ; then
> -	{ { echo "$as_me:$LINENO: error: Option --with-gm requires the  
> path to your GM tree." >&5
> +	    { { echo "$as_me:$LINENO: error: Option --with-gm requires  
> the path to your GM tree." >&5
>  echo "$as_me: error: Option --with-gm requires the path to your GM  
> tree." >&2;}
>     { (exit 1); exit 1; }; }
> -    elif test "$withval" != no ; then
> -	GM_HOME="$withval"
> -    fi
> +	elif test "$withval" != no ; then
> +	    gm_home="$withval"
> +	fi
>
>  fi
>
> -if test -n "$GM_HOME" ; then
> -    save_cppflags="$CPPFLAGS"
> -    CPPFLAGS="$CPPFLAGS -I ${GM_HOME}/include -I ${GM_HOME}/ 
> include/gm"
> -    if test "${ac_cv_header_gm_h+set}" = set; then
> +
> +# Check whether --with-gm-includes was given.
> +if test "${with_gm_includes+set}" = set; then
> +  withval=$with_gm_includes; if test -z "$withval" -o "$withval" =  
> yes ; then
> +	    { { echo "$as_me:$LINENO: error: Option --with-gm-includes  
> requires path to GM headers." >&5
> +echo "$as_me: error: Option --with-gm-includes requires path to GM  
> headers." >&2;}
> +   { (exit 1); exit 1; }; }
> +	elif test "$withval" != no ; then
> +	    GM_INCDIR="$withval"
> +	fi
> +
> +fi
> +
> +
> +# Check whether --with-gm-libs was given.
> +if test "${with_gm_libs+set}" = set; then
> +  withval=$with_gm_libs; if test -z "$withval" -o "$withval" =  
> yes ; then
> +	    { { echo "$as_me:$LINENO: error: Option --with-gm-libs  
> requires path to GM libraries." >&5
> +echo "$as_me: error: Option --with-gm-libs requires path to GM  
> libraries." >&2;}
> +   { (exit 1); exit 1; }; }
> +	elif test "$withval" != no ; then
> +	    GM_LIBDIR="$withval"
> +	fi
> +
> +fi
> +
> +            if test -n "$gm_home" ; then
> +	if test -z "$GM_INCDIR"; then
> +	    GM_INCDIR=$gm_home/include
> +	fi
> +	if test -z "$GM_LIBDIR"; then
> +	    GM_LIBDIR=$gm_home/lib64
> +	    if test ! -d "$GM_LIBDIR" ; then
> +		GM_LIBDIR=$gm_home/lib
> +	    fi
> +	fi
> +    fi
> +        if test -n "$GM_INCDIR$GM_LIBDIR" ; then
> +	save_cppflags="$CPPFLAGS"
> +	CPPFLAGS="$CPPFLAGS -I$GM_INCDIR -I$GM_INCDIR/gm"
> +	if test "${ac_cv_header_gm_h+set}" = set; then
>    { echo "$as_me:$LINENO: checking for gm.h" >&5
>  echo $ECHO_N "checking for gm.h... $ECHO_C" >&6; }
>  if test "${ac_cv_header_gm_h+set}" = set; then
> @@ -14590,29 +14634,77 @@ echo "$as_me: error: Header gm.h not  
> found." >&2;}
>  fi
>
>
> -    BUILD_GM=1
> -    CPPFLAGS="$save_cppflags"
> -fi
> +			if test ! -f $GM_LIBDIR/libgm.so ; then
> +	    if test ! -f $GM_LIBDIR/libgm.a ; then
> +		{ { echo "$as_me:$LINENO: error: Neither GM library libgm.so or  
> libgm.a found." >&5
> +echo "$as_me: error: Neither GM library libgm.so or libgm.a  
> found." >&2;}
> +   { (exit 1); exit 1; }; }
> +	    fi
> +	fi
> +	BUILD_GM=1
> +	CPPFLAGS="$save_cppflags"
> +    fi
> +
> +
>
>
>
> -MX_HOME=
> +
> +                    mx_home=
>
>  # Check whether --with-mx was given.
>  if test "${with_mx+set}" = set; then
>    withval=$with_mx; if test -z "$withval" -o "$withval" = yes ; then
> -	{ { echo "$as_me:$LINENO: error: Option --with-mx requires the  
> path to your MX tree." >&5
> +	    { { echo "$as_me:$LINENO: error: Option --with-mx requires  
> the path to your MX tree." >&5
>  echo "$as_me: error: Option --with-mx requires the path to your MX  
> tree." >&2;}
>     { (exit 1); exit 1; }; }
> -    elif test "$withval" != no ; then
> -	MX_HOME="$withval"
> -    fi
> +	elif test "$withval" != no ; then
> +	    mx_home="$withval"
> +	fi
> +
> +fi
> +
> +
> +# Check whether --with-mx-includes was given.
> +if test "${with_mx_includes+set}" = set; then
> +  withval=$with_mx_includes; if test -z "$withval" -o "$withval" =  
> yes ; then
> +	    { { echo "$as_me:$LINENO: error: Option --with-mx-includes  
> requires path to MX headers." >&5
> +echo "$as_me: error: Option --with-mx-includes requires path to MX  
> headers." >&2;}
> +   { (exit 1); exit 1; }; }
> +	elif test "$withval" != no ; then
> +	    MX_INCDIR="$withval"
> +	fi
>
>  fi
>
> -if test -n "$MX_HOME" ; then
> -    CPPFLAGS="$CPPFLAGS -I ${MX_HOME}/include"
> -    if test "${ac_cv_header_myriexpress_h+set}" = set; then
> +
> +# Check whether --with-mx-libs was given.
> +if test "${with_mx_libs+set}" = set; then
> +  withval=$with_mx_libs; if test -z "$withval" -o "$withval" =  
> yes ; then
> +	    { { echo "$as_me:$LINENO: error: Option --with-mx-libs  
> requires path to MX libraries." >&5
> +echo "$as_me: error: Option --with-mx-libs requires path to MX  
> libraries." >&2;}
> +   { (exit 1); exit 1; }; }
> +	elif test "$withval" != no ; then
> +	    MX_LIBDIR="$withval"
> +	fi
> +
> +fi
> +
> +            if test -n "$mx_home" ; then
> +	if test -z "$MX_INCDIR"; then
> +	    MX_INCDIR=$mx_home/include
> +	fi
> +	if test -z "$MX_LIBDIR"; then
> +	    MX_LIBDIR=$mx_home/lib64
> +	    if test ! -d "$MX_LIBDIR" ; then
> +		MX_LIBDIR=$mx_home/lib
> +	    fi
> +	fi
> +    fi
> +        if test -n "$MX_INCDIR$MX_LIBDIR" ; then
> +	save_cppflags="$CPPFLAGS"
> +	CPPFLAGS="$CPPFLAGS -I$MX_INCDIR -I$MX_INCDIR/mx"
> +	if test "${ac_cv_header_myriexpress_h+set}" = set; then
>    { echo "$as_me:$LINENO: checking for myriexpress.h" >&5
>  echo $ECHO_N "checking for myriexpress.h... $ECHO_C" >&6; }
>  if test "${ac_cv_header_myriexpress_h+set}" = set; then
> @@ -14746,13 +14838,18 @@ echo "$as_me: error: Header myriexpress.h  
> not found." >&2;}
>  fi
>
>
> -    BUILD_MX=1
> -    CPPFLAGS="$CPPFLAGS_OLD"
> -    CFLAGS="${CFLAGS} -I${MX_HOME}/include"
> -    LDFLAGS="$LDFLAGS -L${MX_HOME}/lib"
> -    SERVER_LDFLAGS="$SERVER_LDFLAGS -L${MX_HOME}/lib"
> -    LIBS="$LIBS -lmyriexpress"
> -fi
> +			if test ! -f $MX_LIBDIR/libmyriexpress.so ; then
> +	    if test ! -f $MX_LIBDIR/libmyriexpress.a ; then
> +		{ { echo "$as_me:$LINENO: error: Neither MX library  
> libmyriexpress.so or libmyriexpress.a found." >&5
> +echo "$as_me: error: Neither MX library libmyriexpress.so or  
> libmyriexpress.a found." >&2;}
> +   { (exit 1); exit 1; }; }
> +	    fi
> +	fi
> +	BUILD_MX=1
> +	CPPFLAGS="$save_cppflags"
> +    fi
> +
> +
>
>
>
> @@ -18423,10 +18520,12 @@ for ac_last_try in false false false  
> false false :; do
>    cat >conf$$subs.sed <<_ACEOF
>  TARGET_OS_LINUX!$TARGET_OS_LINUX$ac_delim
>  BUILD_BMI_TCP!$BUILD_BMI_TCP$ac_delim
> -GM_HOME!$GM_HOME$ac_delim
>  BUILD_GM!$BUILD_GM$ac_delim
> -MX_HOME!$MX_HOME$ac_delim
> +GM_INCDIR!$GM_INCDIR$ac_delim
> +GM_LIBDIR!$GM_LIBDIR$ac_delim
>  BUILD_MX!$BUILD_MX$ac_delim
> +MX_INCDIR!$MX_INCDIR$ac_delim
> +MX_LIBDIR!$MX_LIBDIR$ac_delim
>  BUILD_IB!$BUILD_IB$ac_delim
>  IB_INCDIR!$IB_INCDIR$ac_delim
>  IB_LIBDIR!$IB_LIBDIR$ac_delim
> @@ -18445,7 +18544,7 @@ LIBOBJS!$LIBOBJS$ac_delim
>  LTLIBOBJS!$LTLIBOBJS$ac_delim
>  _ACEOF
>
> -  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c  
> X` = 22; then
> +  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c  
> X` = 24; then
>      break
>    elif $ac_last_try; then
>      { { echo "$as_me:$LINENO: error: could not make  
> $CONFIG_STATUS" >&5
> diff --git a/configure.in b/configure.in
> index 526cc26..d08f845 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -789,48 +789,15 @@ AC_ARG_WITH(bmi-tcp,
>  )
>  AC_SUBST(BUILD_BMI_TCP)
>
> -dnl configure options for GM install path
> -GM_HOME=
> -AC_ARG_WITH(gm,
> -[  --with-gm=<dir>         Location of the GM installation  
> (default no GM)],
> -    if test -z "$withval" -o "$withval" = yes ; then
> -	AC_MSG_ERROR([Option --with-gm requires the path to your GM tree.])
> -    elif test "$withval" != no ; then
> -	GM_HOME="$withval"
> -    fi
> -)
> -if test -n "$GM_HOME" ; then
> -    save_cppflags="$CPPFLAGS"
> -    CPPFLAGS="$CPPFLAGS -I ${GM_HOME}/include -I ${GM_HOME}/ 
> include/gm"
> -    AC_CHECK_HEADER(gm.h,, AC_MSG_ERROR([Header gm.h not found.]))
> -    BUILD_GM=1
> -    CPPFLAGS="$save_cppflags"
> -fi
> -AC_SUBST(GM_HOME)
> -AC_SUBST(BUILD_GM)
> +dnl
> +dnl Configure bmi_gm, if --with-gm or a variant given.
> +dnl
> +AX_GM
>
> -dnl configure options for MX install path
> -MX_HOME=
> -AC_ARG_WITH(mx,
> -[  --with-mx=<dir>         Location of the MX installation  
> (default no MX)],
> -    if test -z "$withval" -o "$withval" = yes ; then
> -	AC_MSG_ERROR([Option --with-mx requires the path to your MX tree.])
> -    elif test "$withval" != no ; then
> -	MX_HOME="$withval"
> -    fi
> -)
> -if test -n "$MX_HOME" ; then
> -    CPPFLAGS="$CPPFLAGS -I ${MX_HOME}/include"
> -    AC_CHECK_HEADER(myriexpress.h,, AC_MSG_ERROR([Header  
> myriexpress.h not found.]))
> -    BUILD_MX=1
> -    CPPFLAGS="$CPPFLAGS_OLD"
> -    CFLAGS="${CFLAGS} -I${MX_HOME}/include"
> -    LDFLAGS="$LDFLAGS -L${MX_HOME}/lib"
> -    SERVER_LDFLAGS="$SERVER_LDFLAGS -L${MX_HOME}/lib"
> -    LIBS="$LIBS -lmyriexpress"
> -fi
> -AC_SUBST(MX_HOME)
> -AC_SUBST(BUILD_MX)
> +dnl
> +dnl Configure bmi_mx, if --with-mx or a variant given.
> +dnl
> +AX_MX
>
>  dnl
>  dnl Configure bmi_ib, if --with-ib or a variant given.
> diff --git a/maint/config/gm.m4 b/maint/config/gm.m4
> new file mode 100644
> index 0000000..06fb152
> --- /dev/null
> +++ b/maint/config/gm.m4
> @@ -0,0 +1,72 @@
> +#
> +# Configure rules for GM
> +#
> +# Copyright (C) 2008 Pete Wyckoff <pw at osc.edu>
> +#
> +# See COPYING in top-level directory.
> +#
> +AC_DEFUN([AX_GM],
> +[
> +    dnl Configure options for GM install path.
> +    dnl --with-gm=<dir> is shorthand for
> +    dnl    --with-gm-includes=<dir>/include
> +    dnl    --with-gm-libs=<dir>/lib  (or lib64 if that exists)
> +    gm_home=
> +    AC_ARG_WITH(gm,
> +    [  --with-gm=<dir>     Location of the GM install (default no  
> GM)],
> +	if test -z "$withval" -o "$withval" = yes ; then
> +	    AC_MSG_ERROR([Option --with-gm requires the path to your GM  
> tree.])
> +	elif test "$withval" != no ; then
> +	    gm_home="$withval"
> +	fi
> +    )
> +    AC_ARG_WITH(gm-includes,
> +    [  --with-gm-includes=<dir>  Location of the GM includes],
> +	if test -z "$withval" -o "$withval" = yes ; then
> +	    AC_MSG_ERROR([Option --with-gm-includes requires path to GM  
> headers.])
> +	elif test "$withval" != no ; then
> +	    GM_INCDIR="$withval"
> +	fi
> +    )
> +    AC_ARG_WITH(gm-libs,
> +    [  --with-gm-libs=<dir>      Location of the GM libraries],
> +	if test -z "$withval" -o "$withval" = yes ; then
> +	    AC_MSG_ERROR([Option --with-gm-libs requires path to GM  
> libraries.])
> +	elif test "$withval" != no ; then
> +	    GM_LIBDIR="$withval"
> +	fi
> +    )
> +    dnl If supplied the incls and libs explicitly, use them, else  
> populate them
> +    dnl using guesses from the --with-gm dir.
> +    if test -n "$gm_home" ; then
> +	if test -z "$GM_INCDIR"; then
> +	    GM_INCDIR=$gm_home/include
> +	fi
> +	if test -z "$GM_LIBDIR"; then
> +	    GM_LIBDIR=$gm_home/lib64
> +	    if test ! -d "$GM_LIBDIR" ; then
> +		GM_LIBDIR=$gm_home/lib
> +	    fi
> +	fi
> +    fi
> +    dnl If anything GM-ish was set, go look for header.
> +    if test -n "$GM_INCDIR$GM_LIBDIR" ; then
> +	save_cppflags="$CPPFLAGS"
> +	CPPFLAGS="$CPPFLAGS -I$GM_INCDIR -I$GM_INCDIR/gm"
> +	AC_CHECK_HEADER(gm.h,, AC_MSG_ERROR([Header gm.h not found.]))
> +	dnl Run test is not possible on a machine that does not have a GM  
> NIC.
> +	dnl Link test would work, but just check for existence.
> +	if test ! -f $GM_LIBDIR/libgm.so ; then
> +	    if test ! -f $GM_LIBDIR/libgm.a ; then
> +		AC_MSG_ERROR([Neither GM library libgm.so or libgm.a found.])
> +	    fi
> +	fi
> +	BUILD_GM=1
> +	CPPFLAGS="$save_cppflags"
> +    fi
> +    AC_SUBST(BUILD_GM)
> +    AC_SUBST(GM_INCDIR)
> +    AC_SUBST(GM_LIBDIR)
> +])
> +
> +dnl vim: set ft=config :
> diff --git a/maint/config/mx.m4 b/maint/config/mx.m4
> new file mode 100644
> index 0000000..ab5d151
> --- /dev/null
> +++ b/maint/config/mx.m4
> @@ -0,0 +1,73 @@
> +#
> +# Configure rules for MX
> +#
> +# Copyright (C) 2008 Pete Wyckoff <pw at osc.edu>
> +#
> +# See COPYING in top-level directory.
> +#
> +AC_DEFUN([AX_MX],
> +[
> +    dnl Configure options for MX install path.
> +    dnl --with-mx=<dir> is shorthand for
> +    dnl    --with-mx-includes=<dir>/include
> +    dnl    --with-mx-libs=<dir>/lib  (or lib64 if that exists)
> +    mx_home=
> +    AC_ARG_WITH(mx,
> +    [  --with-mx=<dir>     Location of the MX install (default no  
> MX)],
> +	if test -z "$withval" -o "$withval" = yes ; then
> +	    AC_MSG_ERROR([Option --with-mx requires the path to your MX  
> tree.])
> +	elif test "$withval" != no ; then
> +	    mx_home="$withval"
> +	fi
> +    )
> +    AC_ARG_WITH(mx-includes,
> +    [  --with-mx-includes=<dir>  Location of the MX includes],
> +	if test -z "$withval" -o "$withval" = yes ; then
> +	    AC_MSG_ERROR([Option --with-mx-includes requires path to MX  
> headers.])
> +	elif test "$withval" != no ; then
> +	    MX_INCDIR="$withval"
> +	fi
> +    )
> +    AC_ARG_WITH(mx-libs,
> +    [  --with-mx-libs=<dir>      Location of the MX libraries],
> +	if test -z "$withval" -o "$withval" = yes ; then
> +	    AC_MSG_ERROR([Option --with-mx-libs requires path to MX  
> libraries.])
> +	elif test "$withval" != no ; then
> +	    MX_LIBDIR="$withval"
> +	fi
> +    )
> +    dnl If supplied the incls and libs explicitly, use them, else  
> populate them
> +    dnl using guesses from the --with-mx dir.
> +    if test -n "$mx_home" ; then
> +	if test -z "$MX_INCDIR"; then
> +	    MX_INCDIR=$mx_home/include
> +	fi
> +	if test -z "$MX_LIBDIR"; then
> +	    MX_LIBDIR=$mx_home/lib64
> +	    if test ! -d "$MX_LIBDIR" ; then
> +		MX_LIBDIR=$mx_home/lib
> +	    fi
> +	fi
> +    fi
> +    dnl If anything MX-ish was set, go look for header.
> +    if test -n "$MX_INCDIR$MX_LIBDIR" ; then
> +	save_cppflags="$CPPFLAGS"
> +	CPPFLAGS="$CPPFLAGS -I$MX_INCDIR -I$MX_INCDIR/mx"
> +	AC_CHECK_HEADER(myriexpress.h,,
> +			AC_MSG_ERROR([Header myriexpress.h not found.]))
> +	dnl Run test is not possible on a machine that does not have a MX  
> NIC.
> +	dnl Link test would work, but just check for existence.
> +	if test ! -f $MX_LIBDIR/libmyriexpress.so ; then
> +	    if test ! -f $MX_LIBDIR/libmyriexpress.a ; then
> +		AC_MSG_ERROR([Neither MX library libmyriexpress.so or  
> libmyriexpress.a found.])
> +	    fi
> +	fi
> +	BUILD_MX=1
> +	CPPFLAGS="$save_cppflags"
> +    fi
> +    AC_SUBST(BUILD_MX)
> +    AC_SUBST(MX_INCDIR)
> +    AC_SUBST(MX_LIBDIR)
> +])
> +
> +dnl vim: set ft=config :
> diff --git a/src/apps/admin/pvfs2-config.in b/src/apps/admin/pvfs2- 
> config.in
> index 2fdacc9..4975347 100755
> --- a/src/apps/admin/pvfs2-config.in
> +++ b/src/apps/admin/pvfs2-config.in
> @@ -47,7 +47,7 @@ while test $# -gt 0; do
>      --libs|--static-libs)
>  	libflags="-L at libdir@ -lpvfs2 @LIBS@ @THREAD_LIB@"
>  	if [ x"@BUILD_GM@" = x"1" ]; then
> -		libflags="$libflags -L at GM_HOME@/lib -lgm"
> +		libflags="$libflags -L at GM_LIBDIR@ -lgm"
>  	fi
>  	if [ x"@BUILD_IB@" = x"1" ]; then
>  		libflags="$libflags -L at IB_LIBDIR@ -lvapi -lmtl_common -lmosal - 
> lmpga -lpthread -ldl"
> @@ -56,7 +56,7 @@ while test $# -gt 0; do
>  		libflags="$libflags -L at OPENIB_LIBDIR@ -libverbs"
>  	fi
>  	if [ x"@BUILD_MX@" = x"1" ]; then
> -		libflags="$libflags -L at MX_HOME@/lib -lmyriexpress"
> +		libflags="$libflags -L at MX_LIBDIR@ -lmyriexpress -lpthread"
>  	fi
>  	if [ x"@BUILD_PORTALS@" = x"1" ]; then
>  		libflags="$libflags @PORTALS_LIBS@"
> @@ -70,7 +70,7 @@ while test $# -gt 0; do
>  		libflags="$libflags -lrt"
>  	fi
>  	if [ x"@BUILD_GM@" = x"1" ]; then
> -		libflags="$libflags -L at GM_HOME@/lib -lgm"
> +		libflags="$libflags -L at GM_LIBDIR@ -lgm"
>  	fi
>  	if [ x"@BUILD_IB@" = x"1" ]; then
>  		libflags="$libflags -L at IB_LIBDIR@ -lvapi -lmtl_common -lmosal - 
> lmpga -lpthread -ldl"
> @@ -79,7 +79,7 @@ while test $# -gt 0; do
>  		libflags="$libflags -L at OPENIB_LIBDIR@ -libverbs"
>  	fi
>  	if [ x"@BUILD_MX@" = x"1" ]; then
> -		libflags="$libflags -L at MX_HOME@/lib -lmyriexpress"
> +		libflags="$libflags -L at MX_LIBDIR@ -lmyriexpress -lpthread"
>  	fi
>  	if [ x"@BUILD_PORTALS@" = x"1" ]; then
>  		libflags="$libflags @PORTALS_LIBS@"
> diff --git a/src/io/bmi/bmi_gm/module.mk.in b/src/io/bmi/bmi_gm/ 
> module.mk.in
> index fd8fb3f..2706976 100644
> --- a/src/io/bmi/bmi_gm/module.mk.in
> +++ b/src/io/bmi/bmi_gm/module.mk.in
> @@ -1,14 +1,31 @@
> -BUILD_GM = @BUILD_GM@
> -
> -# only build GM module if configure detected GM
> -ifdef BUILD_GM
> -	DIR := src/io/bmi/bmi_gm
> -	LIBSRC += \
> -		$(DIR)/bmi-gm-addr-list.c \
> -		$(DIR)/bmi-gm-bufferpool.c \
> -		$(DIR)/bmi-gm.c
> -	SERVERSRC += \
> -		$(DIR)/bmi-gm-addr-list.c \
> -		$(DIR)/bmi-gm-bufferpool.c \
> -		$(DIR)/bmi-gm.c
> -endif
> +#
> +# Makefile stub for bmi_gm.
> +#
> +# Copyright (C) 2008 Pete Wyckoff <pw at osc.edu>
> +#
> +# See COPYING in top-level directory.
> +#
> +
> +# only do any of this if configure decided to use GM
> +ifneq (,$(BUILD_GM))
> +
> +#
> +# Local definitions.
> +#
> +DIR := src/io/bmi/bmi_gm
> +cfiles := bmi-gm-addr-list.c bmi-gm-bufferpool.c bmi-gm.c
> +
> +#
> +# Export these to the top Makefile to tell it what to build.
> +#
> +src := $(patsubst %,$(DIR)/%,$(cfiles))
> +LIBSRC    += $(src)
> +SERVERSRC += $(src)
> +
> +#
> +# Extra cflags for files in this directory.
> +# TODO: later on we will want the ability to modify this at  
> configure time
> +#
> +MODCFLAGS_$(DIR) := -I at GM_INCLUDES@ -I at GM_INCLUDES@/gm - 
> DENABLE_GM_BUFPOOL
> +
> +endif  # BUILD_GM
> diff --git a/src/io/bmi/bmi_mx/module.mk.in b/src/io/bmi/bmi_mx/ 
> module.mk.in
> index 4f77838..6b7fd2d 100644
> --- a/src/io/bmi/bmi_mx/module.mk.in
> +++ b/src/io/bmi/bmi_mx/module.mk.in
> @@ -1,10 +1,30 @@
> -BUILD_MX = @BUILD_MX@
> -
> -# only build MX module if configure detected MX
> -ifdef BUILD_MX
> -	DIR := src/io/bmi/bmi_mx
> -	LIBSRC += \
> -		$(DIR)/mx.c
> -	SERVERSRC += \
> -		$(DIR)/mx.c
> -endif
> +#
> +# Makefile stub for bmi_mx.
> +#
> +# Copyright (C) 2008 Pete Wyckoff <pw at osc.edu>
> +#
> +# See COPYING in top-level directory.
> +#
> +
> +# only do any of this if configure decided to use MX
> +ifneq (,$(BUILD_MX))
> +
> +#
> +# Local definitions.
> +#
> +DIR := src/io/bmi/bmi_mx
> +cfiles := mx.c
> +
> +#
> +# Export these to the top Makefile to tell it what to build.
> +#
> +src := $(patsubst %,$(DIR)/%,$(cfiles))
> +LIBSRC    += $(src)
> +SERVERSRC += $(src)
> +
> +#
> +# Extra cflags for files in this directory.
> +#
> +MODCFLAGS_$(DIR) := -I at MX_INCLUDES@
> +
> +endif  # BUILD_MX
> -- 
> 1.5.3.8
>



More information about the Pvfs2-users mailing list