aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonnie Berkholz <dberkholz@gentoo.org>2009-03-15 00:43:19 -0700
committerDonnie Berkholz <dberkholz@gentoo.org>2009-03-15 00:43:19 -0700
commit7e6fd77719485c200c670a66c294bf1f41c0f0d9 (patch)
tree9ac267f9c61d81a34951bf2bde486af6d1fb04a8 /sci-libs/bigdft
parentAdd solve-resolve-bin license. (diff)
downloaddberkholz-7e6fd77719485c200c670a66c294bf1f41c0f0d9.tar.gz
dberkholz-7e6fd77719485c200c670a66c294bf1f41c0f0d9.tar.bz2
dberkholz-7e6fd77719485c200c670a66c294bf1f41c0f0d9.zip
Add some dependencies of abinit, split out from bundled plugins.
Diffstat (limited to 'sci-libs/bigdft')
-rw-r--r--sci-libs/bigdft/Manifest3
-rw-r--r--sci-libs/bigdft/bigdft-1.2.0.ebuild51
-rw-r--r--sci-libs/bigdft/files/bigdft-1.2.0-0001.patch151
3 files changed, 205 insertions, 0 deletions
diff --git a/sci-libs/bigdft/Manifest b/sci-libs/bigdft/Manifest
new file mode 100644
index 0000000..5d723f0
--- /dev/null
+++ b/sci-libs/bigdft/Manifest
@@ -0,0 +1,3 @@
+AUX bigdft-1.2.0-0001.patch 4760 RMD160 fb54d83e404c35d4384d797e4372e4b7b83e0afd SHA1 ef995c8c7671ba5df253c23ed14c91974a01f07f SHA256 b368327f7a55007da142b4f84f3b7e92cb0f787400747021143c70bed3231a67
+DIST bigdft-1.2.0.tar.gz 947932 RMD160 163d16cf8cdf438c483bc773957061e293ed5695 SHA1 5570c247ca378c8de81c74d1d55c8f9bb4bd54be SHA256 d28597a0e29bad3200270985374aba3d0c2adbb35cb6b33765c3c7183e7db77f
+EBUILD bigdft-1.2.0.ebuild 1218 RMD160 178ded0890c6566a647860aeab0404d6ddcb73c8 SHA1 d01318f40886a1db74748cbd4da728a618126710 SHA256 28e91e966f62fd255a73d4181a4d22f9673dc571d20030e2f9faae921038fcac
diff --git a/sci-libs/bigdft/bigdft-1.2.0.ebuild b/sci-libs/bigdft/bigdft-1.2.0.ebuild
new file mode 100644
index 0000000..fbb8336
--- /dev/null
+++ b/sci-libs/bigdft/bigdft-1.2.0.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=2
+
+inherit eutils fortran
+
+DESCRIPTION="DFT electronic structure code using a wavelet basis set"
+HOMEPAGE="http://inac.cea.fr/L_Sim/BigDFT"
+SRC_URI="${HOMEPAGE}/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="cuda mpi"
+RDEPEND="cuda? ( dev-util/nvidia-cuda-sdk )
+ mpi? ( virtual/mpi )
+ virtual/lapack
+ virtual/blas"
+DEPEND="${RDEPEND}
+ >=sys-devel/autoconf-2.59"
+
+FORTRAN="gfortran ifc mpif90"
+
+src_prepare() {
+ # Patch taken from sci-physics/abinit-5.7.3 bundled version
+ epatch "${FILESDIR}"/${P}-0001.patch
+}
+
+src_configure() {
+ if [[ -z ${FCFLAGS} ]]; then
+ einfo "Defaulting to ${FCFLAGS} for FCFLAGS"
+ : ${FCFLAGS:--O2}
+ fi
+
+ # Build this as a library for sci-physics/abinit
+ econf \
+ --disable-libabinit \
+ --with-moduledir=/usr/include \
+ --disable-binaries \
+ $(use_enable mpi) \
+ $(use_enable cuda cuda-gpu) \
+ $(use_with cuda cuda-path /opt/cuda) \
+ $(use_with cuda lib-cutils /opt/cuda/lib) \
+ FCFLAGS="${FCFLAGS}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ dodoc README NEWS AUTHORS INSTALL ChangeLog || die "dodoc failed"
+}
diff --git a/sci-libs/bigdft/files/bigdft-1.2.0-0001.patch b/sci-libs/bigdft/files/bigdft-1.2.0-0001.patch
new file mode 100644
index 0000000..3ef8bed
--- /dev/null
+++ b/sci-libs/bigdft/files/bigdft-1.2.0-0001.patch
@@ -0,0 +1,151 @@
+diff -urN bigdft-1.2.0.old/src/init/ionicpot.f90 bigdft-1.2.0.new/src/init/ionicpot.f90
+--- bigdft-1.2.0.old/src/init/ionicpot.f90 2009-03-08 07:28:32.000000000 +0100
++++ bigdft-1.2.0.new/src/init/ionicpot.f90 2009-03-08 07:29:03.000000000 +0100
+@@ -8,7 +8,7 @@
+ integer, intent(in) :: iproc,nproc,n1,n2,n3,n1i,n2i,n3i,i3s,n3pi
+ real(gp), intent(in) :: hxh,hyh,hzh
+ real(gp), dimension(3,at%nat), intent(in) :: rxyz
+- real(dp), dimension(*), intent(in) :: pkernel
++ real(gp), dimension(*), intent(in) :: pkernel
+ real(gp), intent(out) :: eion,psoffset
+ real(gp), dimension(3,at%nat), intent(out) :: fion
+ real(dp), dimension(*), intent(out) :: pot_ion
+@@ -757,7 +757,7 @@
+ !local variables
+ integer :: iat,ityp
+ real(wp) :: pi,charge
+- real(gp) :: r,sq2rl,rx,ry,rz
++ real(gp) :: r,sq2rl,rx,ry,rz,arg,derf_arg
+
+
+ pi=4.0_wp*atan(1.0_wp)
+@@ -779,7 +779,9 @@
+ if (r == 0.0_gp) then
+ potxyz = potxyz - charge*2.0_wp/(sqrt(pi)*real(sq2rl,wp))
+ else
+- potxyz = potxyz - charge*real(erf(r/sq2rl)/r,wp)
++ arg=r/sq2rl
++ call derf(derf_arg,arg)
++ potxyz = potxyz - charge*real(derf_arg/r,wp)
+ end if
+
+ end do
+@@ -799,3 +801,118 @@
+ nr=15
+ end if
+ end subroutine ext_buffers
++
++subroutine derf(derf_yy,yy)
++
++ use module_base
++ implicit none
++ real(gp),intent(in) :: yy
++ real(gp),intent(out) :: derf_yy
++ integer :: done,ii,isw
++ real(gp), parameter :: &
++ ! coefficients for 0.0 <= yy < .477
++ & pp(5)=(/ 113.8641541510502e0_gp, 377.4852376853020e0_gp, &
++ & 3209.377589138469e0_gp, .1857777061846032e0_gp, &
++ & 3.161123743870566e0_gp /)
++ real(gp), parameter :: &
++ & qq(4)=(/ 244.0246379344442e0_gp, 1282.616526077372e0_gp, &
++ & 2844.236833439171e0_gp, 23.60129095234412e0_gp/)
++ ! coefficients for .477 <= yy <= 4.0
++ real(gp), parameter :: &
++ & p1(9)=(/ 8.883149794388376e0_gp, 66.11919063714163e0_gp, &
++ & 298.6351381974001e0_gp, 881.9522212417691e0_gp, &
++ & 1712.047612634071e0_gp, 2051.078377826071e0_gp, &
++ & 1230.339354797997e0_gp, 2.153115354744038e-8_gp, &
++ & .5641884969886701e0_gp /)
++ real(gp), parameter :: &
++ & q1(8)=(/ 117.6939508913125e0_gp, 537.1811018620099e0_gp, &
++ & 1621.389574566690e0_gp, 3290.799235733460e0_gp, &
++ & 4362.619090143247e0_gp, 3439.367674143722e0_gp, &
++ & 1230.339354803749e0_gp, 15.74492611070983e0_gp/)
++ ! coefficients for 4.0 < y,
++ real(gp), parameter :: &
++ & p2(6)=(/ -3.603448999498044e-01_gp, -1.257817261112292e-01_gp, &
++ & -1.608378514874228e-02_gp, -6.587491615298378e-04_gp, &
++ & -1.631538713730210e-02_gp, -3.053266349612323e-01_gp/)
++ real(gp), parameter :: &
++ & q2(5)=(/ 1.872952849923460e0_gp , 5.279051029514284e-01_gp, &
++ & 6.051834131244132e-02_gp , 2.335204976268692e-03_gp, &
++ & 2.568520192289822e0_gp /)
++ real(gp), parameter :: &
++ & sqrpi=.5641895835477563e0_gp, xbig=13.3e0_gp, xlarge=6.375e0_gp, xmin=1.0e-10_gp
++ real(gp) :: res,xden,xi,xnum,xsq,xx
++
++ xx = yy
++ isw = 1
++!Here change the sign of xx, and keep track of it thanks to isw
++ if (xx<0.0e0_gp) then
++ isw = -1
++ xx = -xx
++ end if
++
++ done=0
++
++!Residual value, if yy < -6.375e0_gp
++ res=-1.0e0_gp
++
++!abs(yy) < .477, evaluate approximation for erfc
++ if (xx<0.477e0_gp) then
++! xmin is a very small number
++ if (xx<xmin) then
++ res = xx*pp(3)/qq(3)
++ else
++ xsq = xx*xx
++ xnum = pp(4)*xsq+pp(5)
++ xden = xsq+qq(4)
++ do ii = 1,3
++ xnum = xnum*xsq+pp(ii)
++ xden = xden*xsq+qq(ii)
++ end do
++ res = xx*xnum/xden
++ end if
++ if (isw==-1) res = -res
++ done=1
++ end if
++
++!.477 < abs(yy) < 4.0 , evaluate approximation for erfc
++ if (xx<=4.0e0_gp .and. done==0 ) then
++ xsq = xx*xx
++ xnum = p1(8)*xx+p1(9)
++ xden = xx+q1(8)
++ do ii=1,7
++ xnum = xnum*xx+p1(ii)
++ xden = xden*xx+q1(ii)
++ end do
++ res = xnum/xden
++ res = res* exp(-xsq)
++ if (isw.eq.-1) res = res-1.0e0_gp
++ done=1
++ end if
++
++!y > 13.3e0_gp
++ if (isw > 0 .and. xx > xbig .and. done==0 ) then
++ res = 1.0e0_gp
++ done=1
++ end if
++
++!4.0 < yy < 13.3e0_gp .or. -6.375e0_gp < yy < -4.0
++!evaluate minimax approximation for erfc
++ if ( ( isw > 0 .or. xx < xlarge ) .and. done==0 ) then
++ xsq = xx*xx
++ xi = 1.0e0_gp/xsq
++ xnum= p2(5)*xi+p2(6)
++ xden = xi+q2(5)
++ do ii = 1,4
++ xnum = xnum*xi+p2(ii)
++ xden = xden*xi+q2(ii)
++ end do
++ res = (sqrpi+xi*xnum/xden)/xx
++ res = res* exp(-xsq)
++ if (isw.eq.-1) res = res-1.0e0_gp
++ end if
++
++!All cases have been investigated
++ derf_yy = res
++
++end subroutine derf
++