summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Arnold <nerdboy@gentoo.org>2007-12-03 06:03:03 +0000
committerSteve Arnold <nerdboy@gentoo.org>2007-12-03 06:03:03 +0000
commitbc03dfe12805d88dee72207b3d71f7d84e13cfd8 (patch)
treebe6b8ec74c36a7d600c9e28bf7063f53a3aa4653 /sys-cluster
parentadded pvfs2 flag for mpich2 (diff)
downloadgentoo-2-bc03dfe12805d88dee72207b3d71f7d84e13cfd8.tar.gz
gentoo-2-bc03dfe12805d88dee72207b3d71f7d84e13cfd8.tar.bz2
gentoo-2-bc03dfe12805d88dee72207b3d71f7d84e13cfd8.zip
updated to latest upstream release with pvfs2 support and shared lib fixes
(Portage version: 2.1.4_rc1)
Diffstat (limited to 'sys-cluster')
-rw-r--r--sys-cluster/mpich2/ChangeLog13
-rw-r--r--sys-cluster/mpich2/files/digest-mpich2-1.0.63
-rw-r--r--sys-cluster/mpich2/files/mpich2-1.0.6-cxx.patch31
-rw-r--r--sys-cluster/mpich2/files/mpich2-1.0.6-fPIC.patch107
-rw-r--r--sys-cluster/mpich2/files/mpich2-1.0.6-makefile.patch24
-rw-r--r--sys-cluster/mpich2/files/mpich2-1.0.6-shlib.patch48
-rw-r--r--sys-cluster/mpich2/mpich2-1.0.5_p4.ebuild4
-rw-r--r--sys-cluster/mpich2/mpich2-1.0.6.ebuild371
8 files changed, 598 insertions, 3 deletions
diff --git a/sys-cluster/mpich2/ChangeLog b/sys-cluster/mpich2/ChangeLog
index 2b76374b9720..40abf0365d5d 100644
--- a/sys-cluster/mpich2/ChangeLog
+++ b/sys-cluster/mpich2/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for sys-cluster/mpich2
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/mpich2/ChangeLog,v 1.21 2007/07/10 04:57:34 nerdboy Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/mpich2/ChangeLog,v 1.22 2007/12/03 06:03:02 nerdboy Exp $
+
+*mpich2-1.0.6 (03 Dec 2007)
+
+ 03 Dec 2007; Steve Arnold <nerdboy@gentoo.org>
+ +files/mpich2-1.0.6-cxx.patch, +files/mpich2-1.0.6-fPIC.patch,
+ +files/mpich2-1.0.6-makefile.patch, +files/mpich2-1.0.6-shlib.patch,
+ mpich2-1.0.5_p4.ebuild, +mpich2-1.0.6.ebuild:
+ Updated to latest upstream release with pvfs2 support and shared lib fixes;
+ this version actually has proper shared libraries and support for pvfs2, so
+ feel free to test and report any problems. Tested successfully with hdf5-
+ parallel (but needs real cluster testing).
10 Jul 2007; Steve Arnold <nerdboy@gentoo.org> mpich2-1.0.5_p4.ebuild:
fixed a leftover development hack alertly noticed by Mr_Bones
diff --git a/sys-cluster/mpich2/files/digest-mpich2-1.0.6 b/sys-cluster/mpich2/files/digest-mpich2-1.0.6
new file mode 100644
index 000000000000..5e641d5f68ff
--- /dev/null
+++ b/sys-cluster/mpich2/files/digest-mpich2-1.0.6
@@ -0,0 +1,3 @@
+MD5 6373b7824a782e890ecf4bfb77cbc4cc mpich2-1.0.6p1.tar.gz 15437620
+RMD160 c3249bec1936bd9f3de9a8bb83f29bd32b06c191 mpich2-1.0.6p1.tar.gz 15437620
+SHA256 38808f96071965c79451a8d975fe4f28454f56f27a19ce13b2aec85012521fcc mpich2-1.0.6p1.tar.gz 15437620
diff --git a/sys-cluster/mpich2/files/mpich2-1.0.6-cxx.patch b/sys-cluster/mpich2/files/mpich2-1.0.6-cxx.patch
new file mode 100644
index 000000000000..4595d0623740
--- /dev/null
+++ b/sys-cluster/mpich2/files/mpich2-1.0.6-cxx.patch
@@ -0,0 +1,31 @@
+--- configure.orig 2007-10-14 13:47:58.000000000 -0700
++++ configure 2007-10-14 13:50:27.000000000 -0700
+@@ -655,6 +655,7 @@
+ NUMVERSION
+ VERSION
+ ABIVERSION
++CXXLIBPATH
+ CONFIGURE_ARGUMENTS
+ MPIFLIBNAME
+ PMPIFLIBNAME
+@@ -2199,6 +2200,10 @@
+ # libtool manual)
+ ABIVERSION="1:1"
+
++# This is needed for the C++ wrapper lib build (so we don't have unresolved
++# symbols). The value is replaced via sed in the ebuild.
++export CXXLIBPATH="nerdboy"
++
+ CONFIGURE_ARGUMENTS="$ac_configure_args"
+
+ if test -n "$ac_configure_args" ; then
+--- Makefile.in.orig 2007-10-14 14:51:03.000000000 -0700
++++ Makefile.in 2007-10-14 15:27:04.000000000 -0700
+@@ -27,6 +27,7 @@
+ MAKE = @MAKE@
+ MPILIBNAME = @MPILIBNAME@
+ PMPILIBNAME = @PMPILIBNAME@
++CXXLIBPATH = @CXXLIBPATH@
+
+
+ VPATH = .:@srcdir@
diff --git a/sys-cluster/mpich2/files/mpich2-1.0.6-fPIC.patch b/sys-cluster/mpich2/files/mpich2-1.0.6-fPIC.patch
new file mode 100644
index 000000000000..33fee9aa49c5
--- /dev/null
+++ b/sys-cluster/mpich2/files/mpich2-1.0.6-fPIC.patch
@@ -0,0 +1,107 @@
+--- configure.orig 2007-10-10 20:59:53.000000000 -0700
++++ configure 2007-10-10 21:04:17.000000000 -0700
+@@ -8783,24 +8783,24 @@
+ # if the compiler allows it (e.g., building with gcc but
+ # a different Fortran compiler. Another option is to
+ # *require* g77.
+- { echo "$as_me:$LINENO: checking whether $F77 allows -shared -fpic" >&5
+-echo $ECHO_N "checking whether $F77 allows -shared -fpic... $ECHO_C" >&6; }
++ { echo "$as_me:$LINENO: checking whether $F77 allows -shared -fPIC" >&5
++echo $ECHO_N "checking whether $F77 allows -shared -fPIC... $ECHO_C" >&6; }
+ rm -f conftest.f
+ cat > conftest.f <<EOF
+ program main
+ end
+ EOF
+- if $F77 -shared -fpic -o conftest conftest.f >/dev/null 2>&1 ; then
+- FC_SHL="$F77 -shared -fpic"
++ if $F77 -shared -fPIC -o conftest conftest.f >/dev/null 2>&1 ; then
++ FC_SHL="$F77 -shared -fPIC"
+ { echo "$as_me:$LINENO: result: yes" >&5
+ echo "${ECHO_T}yes" >&6; }
+ else
+ { echo "$as_me:$LINENO: result: no" >&5
+ echo "${ECHO_T}no" >&6; }
+- { echo "$as_me:$LINENO: checking whether $F77 allows -fpic" >&5
+-echo $ECHO_N "checking whether $F77 allows -fpic... $ECHO_C" >&6; }
+- if $F77 -fpic -o conftest conftest.f >/dev/null 2>&1 ; then
+- FC_SHL="$F77 -fpic"
++ { echo "$as_me:$LINENO: checking whether $F77 allows -fPIC" >&5
++echo $ECHO_N "checking whether $F77 allows -fPIC... $ECHO_C" >&6; }
++ if $F77 -fPIC -o conftest conftest.f >/dev/null 2>&1 ; then
++ FC_SHL="$F77 -fPIC"
+ { echo "$as_me:$LINENO: result: yes" >&5
+ echo "${ECHO_T}yes" >&6; }
+ else
+@@ -9837,7 +9837,7 @@
+ gcc)
+ if test "$pac_cv_f90_vendor" = gnu -o "$F90" = "g95" ; then
+ # If we have the GNU Fortran 95 compiler (untested)
+- F90_SHL="$F90 -shared -fpic"
++ F90_SHL="$F90 -shared -fPIC"
+ F90_LINKPATH_SHL="-Wl,-rpath -Wl,"
+ else
+ case "$pac_cv_f90_vendor" in
+@@ -9848,13 +9848,13 @@
+
+ intel)
+ # Intel implements the GNU options
+- F90_SHL="$F90 -shared -fpic"
++ F90_SHL="$F90 -shared -fPIC"
+ F90_LINKPATH_SHL="-Wl,-rpath -Wl,"
+ ;;
+
+ pgi)
+ # Portland Group implements the GNU options
+- F90_SHL="$F90 -shared -fpic"
++ F90_SHL="$F90 -shared -fPIC"
+ F90_LINKPATH_SHL="-Wl,-rpath -Wl,"
+ ;;
+
+@@ -10852,7 +10852,7 @@
+ ;;
+ gcc)
+ # Assume that the compiler is g++ if gcc style shared libraries chosen
+- CXX_SHL="$CXX -shared -fpic"
++ CXX_SHL="$CXX -shared -fPIC"
+ CXX_LINKPATH_SHL="-Wl,-rpath -Wl,"
+ ;;
+ cygwin|cygwin-gcc)
+@@ -12571,7 +12571,7 @@
+ # For example, include the libname as ${LIBNAME_SHL}
+ #C_LINK_SHL='${CC} -shared -Wl,-h,<finallibname>'
+ # May need -fPIC
+- CC_SHL='${CC} -fpic'
++ CC_SHL='${CC} -fPIC'
+ #C_LINKPATH_SHL="-Wl,-rpath -Wl,"
+ # More recent versions allow multiple args, separated by commas
+ C_LINKPATH_SHL="-Wl,-rpath,"
+@@ -12839,7 +12839,7 @@
+ gcc)
+ # For example, include the libname as ${LIBNAME_SHL}
+ #C_LINK_SHL='${CC} -shared -Wl,-h,<finallibname>'
+- pac_cc_sharedlibs='gcc -shared -fpic'
++ pac_cc_sharedlibs='gcc -shared -fPIC'
+ pac_clink_sharedlibs='gcc -shared'
+ ;;
+ libtool)
+--- confdb/aclocal_shl.m4.orig 2007-05-16 06:39:01.000000000 -0700
++++ confdb/aclocal_shl.m4 2007-10-10 21:05:15.000000000 -0700
+@@ -89,7 +89,7 @@
+ # For example, include the libname as ${LIBNAME_SHL}
+ #C_LINK_SHL='${CC} -shared -Wl,-h,<finallibname>'
+ # May need -fPIC
+- CC_SHL='${CC} -fpic'
++ CC_SHL='${CC} -fPIC'
+ #C_LINKPATH_SHL="-Wl,-rpath -Wl,"
+ # More recent versions allow multiple args, separated by commas
+ C_LINKPATH_SHL="-Wl,-rpath,"
+@@ -233,7 +233,7 @@
+ gcc)
+ # For example, include the libname as ${LIBNAME_SHL}
+ #C_LINK_SHL='${CC} -shared -Wl,-h,<finallibname>'
+- pac_cc_sharedlibs='gcc -shared -fpic'
++ pac_cc_sharedlibs='gcc -shared -fPIC'
+ pac_clink_sharedlibs='gcc -shared'
+ ;;
+ libtool)
diff --git a/sys-cluster/mpich2/files/mpich2-1.0.6-makefile.patch b/sys-cluster/mpich2/files/mpich2-1.0.6-makefile.patch
new file mode 100644
index 000000000000..167ab5053b62
--- /dev/null
+++ b/sys-cluster/mpich2/files/mpich2-1.0.6-makefile.patch
@@ -0,0 +1,24 @@
+--- Makefile.in.orig 2007-10-11 22:06:10.000000000 -0700
++++ Makefile.in 2007-10-11 22:18:48.000000000 -0700
+@@ -125,17 +125,17 @@
+ C_COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+ # Build the shared library from the shared object files
+ lib/lib${MPILIBNAME}.@SHLIB_EXT@: lib/lib${MPILIBNAME}.la
+- (cd lib && $(CREATESHLIB) --mode=link -version-info "@ABIVERSION@" -o lib${MPILIBNAME}.la -rpath $(libdir) )
++ (cd lib && $(CREATESHLIB) --mode=link -version-info "@ABIVERSION@" -o lib${MPILIBNAME}.la -rpath $(libdir) -L${libdir} -laio )
+ if [ -n "@NO_WEAK_SYM@" -a \
+ "${MPILIBNAME}" != "${PMPILIBNAME}" ] ; then \
+- (cd lib && $(CREATESHLIB) --mode=link -version-info "@ABIVERSION@" -o lib${PMPILIBNAME}.la -rpath $(libdir) );\
++ (cd lib && $(CREATESHLIB) --mode=link -version-info "@ABIVERSION@" -o lib${PMPILIBNAME}.la -rpath $(libdir) -L${libdir} -laio );\
+ fi
+ # Build the shared library from the shared object files
+ lib/libf${MPILIBNAME}.@SHLIB_EXT@: lib/libf${MPILIBNAME}.la
+- (cd lib && $(CREATESHLIB) --mode=link -version-info "@ABIVERSION@" -o libf${MPILIBNAME}.la -rpath $(libdir) -L. -l$(MPILIBNAME))
++ (cd lib && $(CREATESHLIB) --mode=link -version-info "@ABIVERSION@" -o libf${MPILIBNAME}.la -rpath $(libdir) -L. -l${MPILIBNAME} )
+ # Build the shared library from the shared object files
+ lib/lib${MPICXXLIBNAME}.@SHLIB_EXT@: lib/lib${MPICXXLIBNAME}.la
+- (cd lib && $(CREATESHLIB) --mode=link -version-info "@ABIVERSION@" -o lib${MPICXXLIBNAME}.la -rpath $(libdir) )
++ (cd lib && $(CREATESHLIB) --mode=link -version-info "@ABIVERSION@" -o lib${MPICXXLIBNAME}.la -rpath $(libdir) -L. -l${MPILIBNAME} -Lnerdboy -lstdc++ )
+
+ # --------------------------------------------------------------------------
+ .libstamp0:
diff --git a/sys-cluster/mpich2/files/mpich2-1.0.6-shlib.patch b/sys-cluster/mpich2/files/mpich2-1.0.6-shlib.patch
new file mode 100644
index 000000000000..42ca8f6569af
--- /dev/null
+++ b/sys-cluster/mpich2/files/mpich2-1.0.6-shlib.patch
@@ -0,0 +1,48 @@
+--- src/util/createshlib.in.orig 2007-09-12 07:39:20.000000000 -0700
++++ src/util/createshlib.in 2007-10-13 10:06:51.000000000 -0700
+@@ -207,12 +207,12 @@
+
+ *)
+ # Typical Unix default
+- soName=$srclibbase.$SHLIB_EXT.$dottedVersion
++ soName=$srclibbase.$SHLIB_EXT.$majorVersion
+ realName=$srclibbase.$SHLIB_EXT.$dottedVersion
+ altNames="$srclibbase.$SHLIB_EXT"
+- if [ -n "$majorVersion" ] ; then
+- altNames="$altNames $srclibbase.$SHLIB_EXT.$majorVersion"
+- fi
++# if [ -n "$majorVersion" ] ; then
++# altNames="$altNames $srclibbase.$SHLIB_EXT.$majorVersion"
++# fi
+ ;;
+ esac
+
+@@ -293,15 +293,16 @@
+ # Typically -Wl,-h,$soName
+ # FIXME: C_LINK_SHL knows the options for shared libraries,
+ # but not the args for setting the soname.
+- $Show ${C_LINK_SHL} -o $realName -Wl,-h,$soName .tmp/*.o
+- # Do we need to add $dependentLibs ?
++ $Show ${C_LINK_SHL} -Wl,-soname,$soName -o $realName .tmp/*.o $dependentLibs
++ # Do we need to add $dependentLibs ? Yes!
+ ;;
+ esac
+ if [ -n "$altNames" ] ; then
+ for alt in $altNames ; do
+ # Remove any alternate names before executing the ln step
+ rm -f $alt
+- $Show ln -s $realName $alt
++ $Show ln -s $realName $soName
++ $Show ln -s $soName $alt
+ done
+ fi
+
+@@ -345,7 +346,7 @@
+ fi
+ if [ -n "$altNames" ] ; then
+ for alt in $altNames ; do
+- ( cd $destdir && $Show rm -f $alt && $Show ln -s $realName $alt )
++ ( cd $destdir && $Show rm -f $alt && $Show ln -s $soName $alt )
+ done
+ fi
+ fi
diff --git a/sys-cluster/mpich2/mpich2-1.0.5_p4.ebuild b/sys-cluster/mpich2/mpich2-1.0.5_p4.ebuild
index 142d4836b099..a84df3190ca1 100644
--- a/sys-cluster/mpich2/mpich2-1.0.5_p4.ebuild
+++ b/sys-cluster/mpich2/mpich2-1.0.5_p4.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/mpich2/mpich2-1.0.5_p4.ebuild,v 1.2 2007/07/10 04:57:34 nerdboy Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/mpich2/mpich2-1.0.5_p4.ebuild,v 1.3 2007/12/03 06:03:02 nerdboy Exp $
inherit eutils fortran distutils autotools kde-functions toolchain-funcs java-pkg
@@ -11,7 +11,7 @@ SRC_URI="ftp://ftp.mcs.anl.gov/pub/mpi/${MY_P}.tar.gz"
LICENSE="as-is"
SLOT="0"
-KEYWORDS="~amd64 ~x86"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
IUSE="crypt cxx debug doc fast fortran mpe mpe-sdk romio threads"
DEPEND="virtual/libc
diff --git a/sys-cluster/mpich2/mpich2-1.0.6.ebuild b/sys-cluster/mpich2/mpich2-1.0.6.ebuild
new file mode 100644
index 000000000000..44248caf1832
--- /dev/null
+++ b/sys-cluster/mpich2/mpich2-1.0.6.ebuild
@@ -0,0 +1,371 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/mpich2/mpich2-1.0.6.ebuild,v 1.1 2007/12/03 06:03:02 nerdboy Exp $
+
+inherit autotools distutils eutils flag-o-matic fortran java-pkg-2
+
+#MY_P=${P/_/}
+MY_P=${P}p1
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="MPICH2 - A portable MPI implementation"
+HOMEPAGE="http://www-unix.mcs.anl.gov/mpi/mpich2"
+SRC_URI="http://www.mcs.anl.gov/research/projects/mpich2/downloads/${MY_P}.tar.gz"
+#SRC_URI="ftp://ftp.mcs.anl.gov/pub/mpi/${MY_P}.tar.gz"
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE="crypt cxx debug doc fast fortran mpe mpe-sdk pvfs2 romio threads"
+
+DEPEND="virtual/libc
+ sys-devel/libtool
+ dev-lang/perl
+ >=dev-lang/python-2.3
+ mpe-sdk? ( >=virtual/jdk-1.5
+ x11-proto/xproto )
+ romio? ( >=dev-libs/libaio-0.3.106
+ net-fs/nfs-utils )
+ pvfs2? ( >=sys-cluster/pvfs2-2.7.0 )
+ doc? ( virtual/tetex )"
+
+RDEPEND="${DEPEND}
+ mpe-sdk? ( x11-libs/libX11 )
+ crypt? ( net-misc/openssh )
+ !crypt? ( net-misc/netkit-rsh )
+ !sys-cluster/mpich
+ !sys-cluster/lam-mpi
+ !sys-cluster/openmpi
+ !media-sound/mpd
+ !media-sound/mpd-svn"
+
+WANT_AUTOCONF="2.5"
+AT_M4DIR="${S}/confdb"
+
+RESTRICT="test"
+# To-do: work on tests and add SCTP support for kernel and user tools
+# Initial test implementation doesn't work yet - feel free to fix it...
+
+pkg_setup() {
+ if [ -n "${MPICH_CONFIGURE_OPTS}" ]; then
+ elog "User-specified configure options are ${MPICH_CONFIGURE_OPTS}."
+ else
+ elog "User-specified configure options are not set."
+ elog "If needed, see the docs and set MPICH_CONFIGURE_OPTS."
+ fi
+
+ if use fortran ; then
+ if [ $(gcc-major-version) -ge 4 ] \
+ && built_with_use sys-devel/gcc fortran ; then
+ FORTRAN="gfortran"
+ MPI_FFLAGS="-ff2c"
+ fortran_pkg_setup
+ else
+ ewarn "You need gcc-4 built with fortran support in order to"
+ ewarn "build the f90 mpi interface, which is required for f90"
+ ewarn "and mpi support in hdf5 (for example)."
+ FORTRAN="g77 f2c"
+ fortran_pkg_setup
+ fi
+ else
+ ewarn "Unless you have another f90 compiler installed, we can only"
+ ewarn "build the C and C++ interfaces with gcc-3.x"
+ fi
+
+ if use mpe-sdk; then
+ java-pkg-2_pkg_setup
+ if use x86; then
+ jvmarch=i386
+ else
+ jvmarch="${ARCH}"
+ fi
+ fi
+}
+
+src_unpack() {
+ unpack "${A}"
+ cd "${S}"
+
+ ebegin "Reconfiguring"
+ find . -name configure -print | xargs rm
+ ./maint/updatefiles
+ use mpe-sdk && ./src/mpe2/maint/updatefiles
+ eend
+
+ # a few fixes for building the shared libs, PIC, etc
+ epatch "${FILESDIR}/${P}-cxx.patch" || die "cxx patch failed"
+ epatch "${FILESDIR}/${P}-fPIC.patch" || die "fPIC patch failed"
+ epatch "${FILESDIR}/${P}-shlib.patch" || die "createshlib patch failed"
+ epatch "${FILESDIR}/${P}-makefile.patch" || die "make patch failed"
+
+ if use pvfs2; then
+ sed -i -e "s:-laio:-lpvfs2 -laio:g" Makefile.in \
+ || die "sed pvfs2 failed"
+ fi
+
+ use mpe-sdk && setup-jvm-opts
+}
+
+src_compile() {
+ if use crypt ; then
+ RSHCOMMAND="ssh -x"
+ else
+ RSHCOMMAND="rsh"
+ fi
+ export RSHCOMMAND
+
+ local myconf="${MPICH_CONFIGURE_OPTS} --enable-sharedlibs=gcc"
+ local doc_conf=""
+ local mpe_conf=""
+
+ # update to using flag-o-matic
+ append-ldflags -Wl,-z,now
+ replace-flags -fpic -fPIC
+ filter-flags -fomit-frame-pointer
+
+ if ! use debug ; then
+ myconf="${myconf} --enable-g=none"
+ else
+ myconf="${myconf} --enable-g=dbg,mem,log --enable-debuginfo"
+ fi
+
+ if ! use mpe-sdk ; then
+ myconf="${myconf} --enable-rlog=no --enable-slog2=no"
+ fi
+
+ if use threads ; then
+ myconf="${myconf} --with-thread-package=pthreads"
+ else
+ myconf="${myconf} --with-thread-package=none"
+ fi
+
+ # enable f90 support for appropriate compilers
+ case "${FORTRANC}" in
+ gfortran|ifc|ifort|f95)
+ myconf="${myconf} --enable-f77 --enable-f90"
+ ;;
+ g77|f77|f2c)
+ myconf="${myconf} --enable-f77 --disable-f90"
+ ;;
+ esac
+
+ if use romio; then
+ myconf="${myconf} --enable-aio"
+ if use pvfs2; then
+ myconf="${myconf} --with-file-system=pvfs2+nfs+ufs \
+ --with-pvfs2=/usr"
+ else
+ myconf="${myconf} --with-file-system=nfs+ufs"
+ fi
+ use debug && myconf="${myconf} --enable-debug"
+ fi
+
+ use mpe && MPE_SRC_DIR="${S}"/src/mpe2
+
+ # I'm sure there's a better way to do this...
+ if use cxx; then
+ tc-export CPP CC CXX LD
+ CXXLIBPATH="/usr/$(get_libdir)/gcc/${CHOST}/$(gcc-fullversion)"
+ sed -i -e "s:nerdboy:${CXXLIBPATH}:g" Makefile.in \
+ || die "sed 3 failed"
+ fi
+
+ if use doc; then
+ doc_conf="--docdir=/usr/share/doc/${PF} \
+ --with-docdir=/usr/share/doc/${PF} \
+ --with-htmldir=/usr/share/doc/${PF}/html \
+ --with-pdfdir=/usr/share/doc/${PF} \
+ --with-psdir=/usr/share/doc/${PF}"
+ else
+ doc_conf="--with-docdir=/usr/share/doc/${PF} \
+ --with-htmldir=/usr/share/doc/${PF}/html"
+ fi
+
+ if use mpe-sdk; then
+ mpe_conf='--with-java=${JDK_TOPDIR} --with-java2=${JDK_TOPDIR} \
+ --enable-slog2=build \
+ --with-mpicc="${WORKDIR}"/build/bin/mpicc \
+ --with-mpif77="${WORKDIR}"/build/bin/mpif77 \
+ --enable-collchk --enable-graphics=yes --enable-wrappers \
+ --with-trace-libdir=/usr/$(get_libdir)/mpe/trace_rlog \
+ --with-flib_path_leader=-Wl,-L --enable-mpich \
+ --enable-misc --enable-callstack --enable-logging'
+ use debug && mpe_conf=" ${mpe_conf} --enable-g"
+
+ sed -i -e "s:fpic:fPIC:g" \
+ src/mpe2/src/slog2sdk/trace_sample/configure \
+ || die "sed 1 failed"
+ sed -i -e "s:fpic:fPIC:g" \
+ src/mpe2/src/slog2sdk/trace_rlog/configure \
+ || die "sed 2 failed"
+ fi
+
+ # trying the vpath build
+ mkdir ../build
+ cd ../build
+
+ "${S}"/configure \
+ --with-pm=mpd,gforker \
+ ${myconf} \
+ ${mpe_conf} \
+ ${doc_conf} \
+ $(use_enable fast) \
+ $(use_enable cxx) \
+ $(use_enable mpe) \
+ $(use_enable romio) \
+ $(use_enable threads) \
+ --libdir=/usr/$(get_libdir) \
+ --includedir=/usr/include \
+ --mandir=/usr/share/man \
+ --sysconfdir=/etc/"${PN}" \
+ --prefix=/usr --exec-prefix=/usr \
+ --datadir=/usr/share/${PN} || die "configure failed"
+
+ # no parallel make here
+ use fortran && export FFLAGS="-fPIC"
+ make dependencies || die "failed to make dependencies"
+ make || die "make failed"
+}
+
+src_test() {
+ ewarn "Tests can take a long time to complete, even on a fast box."
+ ewarn "Expected result on amd64 with gcc 4.1.1:"
+ ewarn " 6 tests failed out of 373"
+ elog ""
+ elog "Control-C now if you want to disable tests..."
+ epause
+
+ install -g portage -o portage -m 0600 "${FILESDIR}"/mpd.conf "${HOME}"/.mpd.conf
+ TEST="${WORKDIR}/build"
+
+ "${TEST}"/bin/mpd --daemon
+
+ cd "${TEST}"
+ mkdir t1
+ export MPIO_USER_PATH="${TEST}"/t1
+
+ sed -i -e "s:/usr/bin/mpiexec:${TEST}/bin/mpiexec:g" test/mpi/Makefile \
+ || die "sed 4 failed"
+ sed -i -e "s:/usr:${TEST}:g" test/commands/cmdtests \
+ || die "sed 5 failed"
+
+ cd test
+ make clean || die "make clean in test failed"
+
+ echo
+ elog "Using ./configure --prefix=${TEST} --with-mpi=${TEST} etc..."
+ echo
+
+ "${S}"/configure --with-mpi="${TEST}" \
+ --exec-prefix="${TEST}" \
+ --disable-f90 --with-mpich2="${TEST}" $(use_enable threads) \
+ || die "configure test failed"
+
+ export LD_LIBRARY_PATH="${TEST}/lib:$LD_LIBRARY_PATH"
+ nice --adjustment=3 make testing || die "make testing failed"
+
+ "${TEST}"/bin/mpdallexit
+}
+
+src_install() {
+ dodir /etc/"${PN}"
+
+ rm -f src/mpe2/etc/*.in
+
+ cd ../build
+ make DESTDIR="${D}" LIBDIR="${D}"usr/$(get_libdir) install \
+ || die "make install failed"
+
+ cd "${S}"
+
+ rm -f "${D}"usr/$(get_libdir)/*.jar
+ use mpe-sdk && java-pkg_dojar src/mpe2/src/slog2sdk/lib/*.jar
+
+ dodir /usr/share/doc/"${PF}"
+ if use doc; then
+ dodoc COPYRIGHT README README.romio README.testing CHANGES
+ dodoc README.developer RELEASE_NOTES
+ newdoc src/pm/mpd/README README.mpd
+
+ if use mpe-sdk; then
+ dodoc src/mpe2/src/slog2sdk/README.sdk \
+ src/mpe2/src/slog2sdk/README.rte
+ newdoc src/mpe2/src/slog2sdk/FAQ FAQ.sdk
+ fi
+ else
+ rm -rf "${D}"usr/share/doc/"${PF}"/{html,*.pdf}
+ dodoc README CHANGES COPYRIGHT RELEASE_NOTES
+ fi
+
+ # Tidy up a bit
+ use mpe-sdk && rm "${D}"usr/sbin/mpeuninstall
+}
+
+pkg_postinst() {
+ python_version
+ python_mod_optimize "${ROOT}"usr/bin
+
+ elog ""
+ elog "Several specific options are left set to default values; if"
+ elog "you wish to specify non-default values for things like the"
+ elog "timer type, timing level, devices, or communication channels,"
+ elog "please read the docs and rebuild with MPICH_CONFIGURE_OPTS"
+ elog "set to your desired options."
+ elog ""
+ elog "Note 1: enabling the MPE2 SDK requires both a JDK and the core"
+ elog "X11 library for the full set of log analysis and conversion"
+ elog "utilities. You probably don't want to enable the mpe-sdk USE"
+ elog "flag on a server, cluster node, etc."
+ elog ""
+ elog "Note 2: this package still needs testing with other Fortran90"
+ elog "compilers besides gfortran (gcc4). The tests also need some"
+ elog "magic to build properly within the portage build environment."
+ elog "(currently the tests only build and run manually)"
+ elog ""
+ elog "The gfortran support has been tested successfully with hdf5"
+ elog "(using gfortran and the mpif90 wrapper), however, the pvfs2"
+ elog "support is brand-spanking new."
+ elog ""
+}
+
+pkg_postrm() {
+ python_version
+ python_mod_cleanup
+}
+
+setup-jvm-opts() {
+ # Figure out correct boot classpath
+ # stolen from eclipse-sdk ebuild
+ local bp="$(java-config --jdk-home)/jre/lib"
+ local bootclasspath="$(java-config --runtime)"
+ if [[ ! -z "`java-config --java-version | grep IBM`" ]] ; then
+ # IBM JDK
+ JAVA_LIB_DIR="$(java-config --jdk-home)/jre/bin"
+ else
+ # Sun derived JDKs (Blackdown, Sun)
+ JAVA_LIB_DIR="$(java-config --jdk-home)/jre/lib/${jvmarch}"
+ fi
+
+ JDK_TOPDIR="$(java-config --jdk-home)"
+ JDK_INCDIR="$(java-config --jdk-home)/include"
+
+ elog ""
+ elog "Using bootclasspath ${bootclasspath}"
+ elog "Using JVM library path ${JAVA_LIB_DIR}"
+ elog "Using JDK Include dir ${JDK_INCDIR}"
+ elog "Using JDK Top-level dir ${JDK_TOPDIR}"
+ elog ""
+
+ if [[ ! -f "${JAVA_LIB_DIR}"/libawt.so ]] ; then
+ die "Could not find libawt.so native library"
+ fi
+
+ if [[ ! -f "${JDK_INCDIR}"/jni.h ]] ; then
+ die "Could not find jni.h header file"
+ fi
+
+ export AWT_LIB_PATH="${JAVA_LIB_DIR}"
+ export JDK_TOPDIR="${JDK_TOPDIR}"
+ export JDK_INCDIR="${JDK_INCDIR}"
+}
+