[libxc] Fix bug with some mgga correlation functionals.
Susi Lehtola
jussilehtola at fedoraproject.org
Mon Feb 17 13:29:46 UTC 2014
commit c7aba58e714c897536a5704684e0453ba50749b0
Author: Susi Lehtola <jussilehtola at fedoraproject.org>
Date: Mon Feb 17 15:30:28 2014 +0200
Fix bug with some mgga correlation functionals.
libxc-2.0.2-mgga_c.patch | 22 ++++++++++++++++++++++
libxc.spec | 10 ++++++++--
2 files changed, 30 insertions(+), 2 deletions(-)
---
diff --git a/libxc-2.0.2-mgga_c.patch b/libxc-2.0.2-mgga_c.patch
new file mode 100644
index 0000000..6f0af40
--- /dev/null
+++ b/libxc-2.0.2-mgga_c.patch
@@ -0,0 +1,22 @@
+diff -up libxc-2.0.2/src/work_mgga_c.c.orig libxc-2.0.2/src/work_mgga_c.c
+--- libxc-2.0.2/src/work_mgga_c.c.orig 2013-07-10 09:53:52.000000000 +0300
++++ libxc-2.0.2/src/work_mgga_c.c 2014-02-17 15:21:02.084447501 +0200
+@@ -16,6 +16,8 @@
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#include <string.h>
++
+ static void
+ work_mgga_c(const XC(func_type) *p, int np, const FLOAT *rho, const FLOAT *sigma, const FLOAT *lapl, const FLOAT *tau,
+ FLOAT *zk, FLOAT *vrho, FLOAT *vsigma, FLOAT *vlapl, FLOAT *vtau,
+@@ -27,6 +29,9 @@ work_mgga_c(const XC(func_type) *p, int
+ FLOAT min_grad2 = p->info->min_grad*p->info->min_grad;
+ int ip;
+
++ /* Initialize memory */
++ memset(&r,0,sizeof(r));
++
+ r.order = -1;
+ if(zk != NULL) r.order = 0;
+ if(vrho != NULL) r.order = 1;
diff --git a/libxc.spec b/libxc.spec
index 781ab01..5b9951d 100644
--- a/libxc.spec
+++ b/libxc.spec
@@ -5,11 +5,13 @@
Name: libxc
Summary: Library of exchange and correlation functionals to be used in DFT codes
Version: 2.0.2
-Release: 2%{?dist}
+Release: 3%{?dist}
License: LGPLv3+
Group: Applications/Engineering
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
-Source: http://www.tddft.org/programs/octopus/down.php?file=libxc/libxc-%{version}.tar.gz
+Source0: http://www.tddft.org/programs/octopus/down.php?file=libxc/libxc-%{version}.tar.gz
+# Fix bugs with e.g. TPSS correlation (from upstream)
+Patch0: libxc-2.0.2-mgga_c.patch
URL: http://www.tddft.org/programs/octopus/wiki/index.php/Libxc
BuildRequires: gcc-gfortran
@@ -45,6 +47,7 @@ in order to compile programs against libxc.
%prep
%setup -q
+%patch0 -p1 -b .mggac
%build
# Don't insert C code during preprocessing
@@ -83,6 +86,9 @@ rm -rf %{buildroot}
%{_libdir}/pkgconfig/libxc.pc
%changelog
+* Mon Feb 17 2014 Susi Lehtola <jussilehtola at fedoraproject.org> - 2.0.2-3
+- Fix bug with some mgga correlation functionals.
+
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
More information about the scm-commits
mailing list