Pete Wyckoff wrote:
[EMAIL PROTECTED] wrote on Thu, 10 Jan 2008 11:54 -0700:
Pete Wyckoff wrote:
[EMAIL PROTECTED] 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 [EMAIL PROTECTED]@/lib,
but since the system is 64-bit, they are in [EMAIL PROTECTED]@/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,
I thought I sent the patch the following day. I got a response from
someone Scott Atchley who said that MX did not have the same issue.
Here is the patch again:
diff -urN orig/pvfs-2.7.0/Makefile.in tmp/pvfs-2.7.0/Makefile.in
--- orig/pvfs-2.7.0/Makefile.in 2007-11-13 22:41:52.000000000 +0000
+++ tmp/pvfs-2.7.0/Makefile.in 2008-01-10 19:14:35.200088576 +0000
@@ -299,16 +299,12 @@
# 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 += [EMAIL PROTECTED]@/lib
- SERVER_LDFLAGS += [EMAIL PROTECTED]@/lib
- LIBS += -lgm
- LIBS_THREADED += -lgm
- SERVERLIBS += -lgm
+ # other settings in bmi_gm/module.mk.in
+ CFLAGS += -D__STATIC_METHOD_BMI_GM__
+ GMLIBS := [EMAIL PROTECTED]@ -lgm
+ LIBS += $(GMLIBS)
+ LIBS_THREADED += $(GMLIBS)
+ SERVERLIBS += $(GMLIBS)
endif
################################################################
diff -urN orig/pvfs-2.7.0/configure tmp/pvfs-2.7.0/configure
--- orig/pvfs-2.7.0/configure 2007-11-13 22:41:52.000000000 +0000
+++ tmp/pvfs-2.7.0/configure 2008-01-10 20:52:46.749444942 +0000
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61.
#
@@ -712,9 +712,10 @@
TARGET_OS_DARWIN
TARGET_OS_LINUX
BUILD_BMI_TCP
-GM_HOME
BUILD_GM
MX_HOME
+GM_INCDIR
+GM_LIBDIR
BUILD_MX
BUILD_IB
IB_INCDIR
@@ -1355,7 +1356,9 @@
--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-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 installation (default no MX)
--with-ib=<dir> Location of the IB installation (default no IB)
--with-ib-includes=<dir> Location of the IB includes
@@ -14079,24 +14082,62 @@
-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
@@ -14230,9 +14271,18 @@
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
+
+
@@ -17358,12 +17408,12 @@
LTLIBOBJS=$ac_ltlibobjs
-
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;}
+touch $CONFIG_STATUS
cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
# Generated by $as_me.
@@ -18032,7 +18082,6 @@
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
-
ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
if test -n "$ac_eof"; then
ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
@@ -18063,8 +18112,9 @@
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
+GM_INCDIR!$GM_INCDIR$ac_delim
+GM_LIBDIR!$GM_LIBDIR$ac_delim
MX_HOME!$MX_HOME$ac_delim
BUILD_MX!$BUILD_MX$ac_delim
BUILD_IB!$BUILD_IB$ac_delim
@@ -18085,7 +18135,7 @@
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` = 23; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff -urN orig/pvfs-2.7.0/configure.in tmp/pvfs-2.7.0/configure.in
--- orig/pvfs-2.7.0/configure.in 2007-11-13 22:41:52.000000000 +0000
+++ tmp/pvfs-2.7.0/configure.in 2008-01-10 19:39:58.786487819 +0000
@@ -776,25 +776,10 @@
)
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=
diff -urN orig/pvfs-2.7.0/maint/config/gm.m4 tmp/pvfs-2.7.0/maint/config/gm.m4
--- orig/pvfs-2.7.0/maint/config/gm.m4 1970-01-01 00:00:00.000000000 +0000
+++ tmp/pvfs-2.7.0/maint/config/gm.m4 2008-01-10 19:45:12.696763274 +0000
@@ -0,0 +1,72 @@
+#
+# Configure rules for GM
+#
+# Copyright (C) 2008 Pete Wyckoff <[EMAIL PROTECTED]>
+#
+# 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 -urN orig/pvfs-2.7.0/src/apps/admin/pvfs2-config.in tmp/pvfs-2.7.0/src/apps/admin/pvfs2-config.in
--- orig/pvfs-2.7.0/src/apps/admin/pvfs2-config.in 2007-11-13 22:41:52.000000000 +0000
+++ tmp/pvfs-2.7.0/src/apps/admin/pvfs2-config.in 2008-01-10 19:41:33.829038374 +0000
@@ -47,7 +47,7 @@
--libs|--static-libs)
libflags="[EMAIL PROTECTED]@ -lpvfs2 @LIBS@ @THREAD_LIB@"
if [ x"@BUILD_GM@" = x"1" ]; then
- libflags="$libflags [EMAIL PROTECTED]@/lib -lgm"
+ libflags="$libflags [EMAIL PROTECTED]@ -lgm"
fi
if [ x"@BUILD_IB@" = x"1" ]; then
libflags="$libflags [EMAIL PROTECTED]@ -lvapi -lmtl_common -lmosal -lmpga -lpthread -ldl"
@@ -70,7 +70,7 @@
libflags="$libflags -lrt"
fi
if [ x"@BUILD_GM@" = x"1" ]; then
- libflags="$libflags [EMAIL PROTECTED]@/lib -lgm"
+ libflags="$libflags [EMAIL PROTECTED]@ -lgm"
fi
if [ x"@BUILD_IB@" = x"1" ]; then
libflags="$libflags [EMAIL PROTECTED]@ -lvapi -lmtl_common -lmosal -lmpga -lpthread -ldl"
Files orig/pvfs-2.7.0/src/apps/kernel/linux/pvfs2-client-core-threaded.o and tmp/pvfs-2.7.0/src/apps/kernel/linux/pvfs2-client-core-threaded.o differ
diff -urN orig/pvfs-2.7.0/src/io/bmi/bmi_gm/module.mk.in tmp/pvfs-2.7.0/src/io/bmi/bmi_gm/module.mk.in
--- orig/pvfs-2.7.0/src/io/bmi/bmi_gm/module.mk.in 2007-11-13 22:41:52.000000000 +0000
+++ tmp/pvfs-2.7.0/src/io/bmi/bmi_gm/module.mk.in 2008-01-10 21:02:43.681777533 +0000
@@ -1,14 +1,31 @@
-BUILD_GM = @BUILD_GM@
+#
+# Makefile stub for bmi_gm.
+#
+# Copyright (C) 2008 Pete Wyckoff <[EMAIL PROTECTED]>
+#
+# See COPYING in top-level directory.
+#
-# 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
+# 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) := [EMAIL PROTECTED]@ [EMAIL PROTECTED]@/gm -DENABLE_GM_BUFPOOL
+
+endif # BUILD_GM
_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users