aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Junghans <ottxor@gentoo.org>2012-03-03 18:14:05 -0700
committerChristoph Junghans <ottxor@gentoo.org>2012-03-03 18:14:05 -0700
commit40d68f6aa3078ab6f35aa06be400a4d6ecffabf7 (patch)
tree4b92bfe91ec7fb57109aac13f7f9c1358db56ef5 /sci-chemistry/gromacs/gromacs-4.6.9999.ebuild
parentMerge branch 'master' of git://git.overlays.gentoo.org/proj/sci (diff)
downloadsci-40d68f6aa3078ab6f35aa06be400a4d6ecffabf7.tar.gz
sci-40d68f6aa3078ab6f35aa06be400a4d6ecffabf7.tar.bz2
sci-40d68f6aa3078ab6f35aa06be400a4d6ecffabf7.zip
reworked fortran and openmp support
(Portage version: 2.2.0_alpha89/git/Linux i686, unsigned Manifest commit)
Diffstat (limited to 'sci-chemistry/gromacs/gromacs-4.6.9999.ebuild')
-rw-r--r--sci-chemistry/gromacs/gromacs-4.6.9999.ebuild36
1 files changed, 22 insertions, 14 deletions
diff --git a/sci-chemistry/gromacs/gromacs-4.6.9999.ebuild b/sci-chemistry/gromacs/gromacs-4.6.9999.ebuild
index 9ecb6396e..a036dca4e 100644
--- a/sci-chemistry/gromacs/gromacs-4.6.9999.ebuild
+++ b/sci-chemistry/gromacs/gromacs-4.6.9999.ebuild
@@ -31,7 +31,6 @@ SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="X altivec blas doc -double-precision +fftw fkernels gsl lapack
mpi openmp +single-precision sse2 test +threads xml zsh-completion"
-REQUIRED_USE="fkernels? ( !threads )"
CDEPEND="
X? (
@@ -41,7 +40,7 @@ CDEPEND="
)
blas? ( virtual/blas )
fftw? ( sci-libs/fftw:3.0 )
- fkernels? ( virtual/fortran )
+ fkernels? ( !threads? ( !altivec? ( !ia64? ( !sse2? ( virtual/fortran ) ) ) ) )
gsl? ( sci-libs/gsl )
lapack? ( virtual/lapack )
mpi? ( virtual/mpi )
@@ -55,10 +54,27 @@ RESTRICT="test"
pkg_pretend() {
[[ $(gcc-version) == "4.1" ]] && die "gcc 4.1 is not supported by gromacs"
+ use openmp && ! tc-has-openmp && \
+ die "Please switch to an openmp compatible compiler"
}
pkg_setup() {
- use fkernels && fortran-2_pkg_setup
+ #notes/todos
+ # -on apple: there is framework support
+ # -mkl support
+ # -there are power6 kernels
+ if use fkernels; then
+ if use altivec || use ia64 || use sse2; then
+ ewarn "Gromacs only supports one acceleration method, in your case"
+ ewarn "the fortran kernel will be overwritten by (altivec|ia64|sse2)"
+ ewarn "so it is save to disable fkernels use flag!"
+ elif use threads; then
+ ewarn "Fortran kernels and threads do not work together, disabling"
+ ewarn "fortran kernels"
+ else
+ fortran-2_pkg_setup
+ fi
+ fi
}
src_prepare() {
@@ -81,17 +97,9 @@ src_prepare() {
src_configure() {
local mycmakeargs_pre=( )
- #note for gentoo-PREFIX on apple: use --enable-apple-64bit
-
- #note for gentoo-PREFIX on aix, fortran (xlf) is still much faster
- if use fkernels; then
- ewarn "Fortran kernels are usually not faster than C kernels and assembly"
- ewarn "I hope, you know what are you doing..."
- fi
-
- #go from slowest to fasterest acceleration
+ #go from slowest to fastest acceleration
local acce="none"
- use fkernels && acce="fortran"
+ use fkernels && use !threads && acce="fortran"
use altivec && acce="altivec"
use ia64 && acce="ia64"
use sse2 && acce="sse"
@@ -158,7 +166,7 @@ src_install() {
cmake-utils_src_install
use mpi || continue
#cmake-utils_src_install does not support args
- #using cmake-utils_src_compile instead
+ #using cmake-utils_src_make instead
CMAKE_BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" \
cmake-utils_src_make install-mdrun DESTDIR="${D}"
done