aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Junghans <ottxor@gentoo.org>2011-06-19 22:27:52 +0200
committerChristoph Junghans <ottxor@gentoo.org>2011-06-19 22:27:52 +0200
commit8f34362af1c2708fe3d022c177fbbd275e2fe00a (patch)
tree1b506ed2252f050a940d1fcb1da98085329696e4 /sci-chemistry/gromacs/gromacs-4.5.9999.ebuild
parentmedia-gfx/librecad: version bump to 1.0.0rc1 (diff)
downloadsci-8f34362af1c2708fe3d022c177fbbd275e2fe00a.tar.gz
sci-8f34362af1c2708fe3d022c177fbbd275e2fe00a.tar.bz2
sci-8f34362af1c2708fe3d022c177fbbd275e2fe00a.zip
[sci-chemistry/gromacs] switch to cmake
(Portage version: 2.1.9.42/git/Linux i686, signed Manifest commit with key C2000586)
Diffstat (limited to 'sci-chemistry/gromacs/gromacs-4.5.9999.ebuild')
-rw-r--r--sci-chemistry/gromacs/gromacs-4.5.9999.ebuild111
1 files changed, 47 insertions, 64 deletions
diff --git a/sci-chemistry/gromacs/gromacs-4.5.9999.ebuild b/sci-chemistry/gromacs/gromacs-4.5.9999.ebuild
index 469f60402..f144a3f57 100644
--- a/sci-chemistry/gromacs/gromacs-4.5.9999.ebuild
+++ b/sci-chemistry/gromacs/gromacs-4.5.9999.ebuild
@@ -4,11 +4,10 @@
EAPI="4"
-LIBTOOLIZE="true"
TEST_PV="4.0.4"
MANUAL_PV="4.5.4"
-inherit autotools-utils bash-completion flag-o-matic multilib toolchain-funcs
+inherit bash-completion cmake-utils eutils multilib toolchain-funcs
SRC_URI="test? ( ftp://ftp.gromacs.org/pub/tests/gmxtest-${TEST_PV}.tgz )
doc? ( ftp://ftp.gromacs.org/pub/manual/manual-${MANUAL_PV}.pdf -> gromacs-manual-${MANUAL_PV}.pdf )"
@@ -27,8 +26,8 @@ HOMEPAGE="http://www.gromacs.org/"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
-IUSE="X altivec blas dmalloc doc -double-precision +fftw fkernels +gsl lapack
-mpi +single-precision sse2 static-libs test +threads +xml zsh-completion"
+IUSE="X altivec blas doc -double-precision +fftw fkernels gsl lapack
+mpi +single-precision sse2 test +threads xml zsh-completion"
REQUIRED_USE="fkernels? ( !threads )"
CDEPEND="
@@ -37,7 +36,6 @@ CDEPEND="
x11-libs/libSM
x11-libs/libICE
)
- dmalloc? ( dev-libs/dmalloc )
blas? ( virtual/blas )
fftw? ( sci-libs/fftw:3.0 )
gsl? ( sci-libs/gsl )
@@ -52,6 +50,9 @@ RDEPEND="${CDEPEND}
RESTRICT="test"
src_prepare() {
+ #add user patches from /etc/portage/patches/sci-chemistry/gromacs
+ epatch_user
+
if use mpi && use threads; then
elog "mdrun uses only threads OR mpi, and gromacs favours the"
elog "use of mpi over threads, so a mpi-version of mdrun will"
@@ -59,10 +60,6 @@ src_prepare() {
elog "machines only, you can safely disable mpi"
fi
- autotools-utils_src_prepare || die
-
- eautoreconf || die
-
GMX_DIRS=""
use single-precision && GMX_DIRS+=" float"
use double-precision && GMX_DIRS+=" double"
@@ -77,8 +74,12 @@ src_prepare() {
}
src_configure() {
+ local mycmakeargs_pre=( )
#from gromacs configure
- if ! use fftw; then
+ if use fftw; then
+ mycmakeargs_pre+=("-DGMX_FFT_LIBRARY=fftw3")
+ else
+ mycmakeargs_pre+=("-DGMX_FFT_LIBRARY=fftpack")
ewarn "WARNING: The built-in FFTPACK routines are slow."
ewarn "Are you sure you don\'t want to use FFTW?"
ewarn "It is free and much faster..."
@@ -119,65 +120,52 @@ src_configure() {
elog "libmd with and without mpi support."
fi
- # if we need external blas or lapack
- use blas && export LIBS+=" $(pkg-config blas --libs)"
- use lapack && export LIBS+=" $(pkg-config lapack --libs)"
- local sseflag="x86-64-sse"
- use x86 && sseflag="ia32-sse"
-
- #missing flag in autotools (bug #339837)
- use sse2 && append-flags -msse2
+ #go from slowest to fasterest acceleration
+ local acce="none"
+ use fkernels && acce="fortran"
+ use altivec && acce="altivec"
+ use ia64 && acce="ia64"
+ use sse2 && acce="sse"
+
+ mycmakeargs_pre+=(
+ $(cmake-utils_use X GMX_X11)
+ $(cmake-utils_use blas GMX_EXTERNAL_BLAS)
+ $(cmake-utils_use gsl GMX_GSL)
+ $(cmake-utils_use lapack GMX_EXTERNAL_LAPACK)
+ $(cmake-utils_use threads GMX_THREADS)
+ $(cmake-utils_use xml GMX_XML)
+ -DGMX_DEFAULT_SUFFIX=off
+ -DGMX_ACCELERATION="$acce"
+ )
for x in ${GMX_DIRS}; do
+ einfo "Configuring for ${x} precision"
local suffix=""
#if we build single and double - double is suffixed
use double-precision && use single-precision && \
[ "${x}" = "double" ] && suffix="_d"
- myeconfargs=(
- --bindir="${EPREFIX}"/usr/bin
- --docdir="${EPREFIX}"/usr/share/doc/"${PF}"
- --enable-"${x}"
- $(use_with dmalloc)
- $(use_with fftw fft fftw3)
- $(use_with gsl)
- $(use_with X x)
- $(use_with xml)
- $(use_enable threads)
- $(use_enable altivec ppc-altivec)
- $(use_enable ia64 ia64-asm)
- $(use_with lapack external-lapack)
- $(use_with blas external-blas)
- $(use_enable fkernels fortran)
- --disable-bluegene
- --disable-la-files
- --disable-power6
- --disable-ia32-sse
- --disable-x86-64-sse
- $(use_enable sse2 $sseflag)
- )
- #disable ia32-sse and x86-64-sse and enable what we really need in last line
-
- einfo "Configuring for ${x} precision"
- AUTOTOOLS_BUILD_DIR="${WORKDIR}/${P}_${x}"\
- autotools-utils_src_configure --disable-mpi --program-suffix="${suffix}" \
- CC="$(tc-getCC)" F77="$(tc-getFC)"
+ local p
+ [ "${x}" = "double" ] && p="-DGMX_DOUBLE=ON" || p="-DGMX_DOUBLE=OFF"
+ mycmakeargs=( ${mycmakeargs_pre[@]} ${p} -DGMX_MPI=OFF
+ -DGMX_BINARY_SUFFIX="${suffix}" -DGMX_LIBS_SUFFIX="${suffix}" )
+ CMAKE_BUILD_DIR="${WORKDIR}/${P}_${x}" cmake-utils_src_configure
use mpi || continue
einfo "Configuring for ${x} precision with mpi"
- AUTOTOOLS_BUILD_DIR="${WORKDIR}/${P}_${x}_mpi"\
- autotools-utils_src_configure --enable-mpi --program-suffix="_mpi${suffix}" \
- CC="$(tc-getCC)" F77="$(tc-getFC)"
+ mycmakeargs=( ${mycmakeargs_pre[@]} ${p} -DGMX_MPI=ON
+ -DGMX_BINARY_SUFFIX="_mpi${suffix}" -DGMX_LIBS_SUFFIX="_mpi${suffix}" )
+ CMAKE_BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" cmake-utils_src_configure
done
}
src_compile() {
for x in ${GMX_DIRS}; do
einfo "Compiling for ${x} precision"
- AUTOTOOLS_BUILD_DIR="${WORKDIR}/${P}_${x}"\
- autotools-utils_src_compile
+ CMAKE_BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_compile
use mpi || continue
einfo "Compiling for ${x} precision with mpi"
- AUTOTOOLS_BUILD_DIR="${WORKDIR}/${P}_${x}_mpi"\
- autotools-utils_src_compile mdrun
+ CMAKE_BUILD_DIR="${WORKDIR}/${P}_${x}_mpi"\
+ cmake-utils_src_compile mdrun
done
}
@@ -193,18 +181,13 @@ src_test() {
src_install() {
for x in ${GMX_DIRS}; do
- AUTOTOOLS_BUILD_DIR="${WORKDIR}/${P}_${x}" \
- autotools-utils_src_install
+ CMAKE_BUILD_DIR="${WORKDIR}/${P}_${x}" \
+ cmake-utils_src_install
use mpi || continue
- #autotools-utils_src_install does not support args
- #using autotools-utils_src_compile instead
- AUTOTOOLS_BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" \
- autotools-utils_src_compile install-mdrun DESTDIR="${D}"
-
- #stolen from autotools-utils_src_install see comment above
- local args
- has static-libs ${IUSE//+} && ! use static-libs || args='none'
- remove_libtool_files ${args}
+ #cmake-utils_src_install does not support args
+ #using cmake-utils_src_compile instead
+ CMAKE_BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" \
+ cmake-utils_src_make install-mdrun DESTDIR="${D}"
done
sed -n -e '/^GMXBIN/,/^GMXDATA/p' "${ED}"/usr/bin/GMXRC.bash > "${T}/80gromacs"