[cp2k/f18] fix crashes in fftw on i686 (patch by Michael Banck)
Dominik Mierzejewski
rathann at fedoraproject.org
Sat Apr 13 21:07:51 UTC 2013
commit 8c413e5f1561b362124b412c6e06516fb811eac6
Author: Dominik Mierzejewski <dominik at greysector.net>
Date: Sat Apr 13 22:58:06 2013 +0200
fix crashes in fftw on i686 (patch by Michael Banck)
cp2k-fftw3_unaligned.patch | 31 +++++++++++++++++++++++++++++++
cp2k.spec | 11 ++++++++++-
2 files changed, 41 insertions(+), 1 deletions(-)
---
diff --git a/cp2k-fftw3_unaligned.patch b/cp2k-fftw3_unaligned.patch
new file mode 100644
index 0000000..2b9f751
--- /dev/null
+++ b/cp2k-fftw3_unaligned.patch
@@ -0,0 +1,31 @@
+diff -up cp2k-2.3/src/fft_lib/fftw3_lib.F.fftw_unaligned cp2k-2.3/src/fft_lib/fftw3_lib.F
+--- cp2k-2.3/src/fft_lib/fftw3_lib.F.fftw_unaligned 2012-04-18 12:51:33.000000000 +0200
++++ cp2k-2.3/src/fft_lib/fftw3_lib.F 2013-04-13 22:52:25.663811899 +0200
+@@ -127,9 +127,13 @@ SUBROUTINE fftw3_create_plan_3d(plan, zi
+ STOP "fftw3_create_plan_3d"
+ END SELECT
+
++#if defined ( __FFTW3_UNALIGNED )
++ fftw_plan_type = fftw_plan_type + FFTW_UNALIGNED
++#else
+ IF ( .NOT. aligned ) THEN
+ fftw_plan_type = fftw_plan_type + FFTW_UNALIGNED
+ END IF
++#endif
+
+ n1 = plan%n_3d(1)
+ n2 = plan%n_3d(2)
+@@ -256,9 +260,13 @@ SUBROUTINE fftw3_create_plan_1dm(plan, z
+ STOP "fftw3_create_plan_1dm"
+ END SELECT
+
++#if defined ( __FFTW3_UNALIGNED )
++ fftw_plan_type = fftw_plan_type + FFTW_UNALIGNED
++#else
+ IF ( .NOT. aligned ) THEN
+ fftw_plan_type = fftw_plan_type + FFTW_UNALIGNED
+ END IF
++#endif
+
+ num_threads = 1
+ !$omp parallel default(none), &
diff --git a/cp2k.spec b/cp2k.spec
index 79c9540..3f3d627 100644
--- a/cp2k.spec
+++ b/cp2k.spec
@@ -3,7 +3,7 @@
Name: cp2k
Version: 2.3
-Release: 2.%{?snapshot}%{?dist}
+Release: 3.%{?snapshot}%{?dist}
Group: Applications/Engineering
Summary: A molecular dynamics engine capable of classical and Car-Parrinello simulations
License: GPLv2+
@@ -28,6 +28,8 @@ Source4: cp2k-snapshot.sh
# use external makedepf90
# skip compilation during regtests
Patch0: %{name}-rpm.patch
+# fix crashes in fftw on i686
+Patch1: %{name}-fftw_unaligned.patch
BuildRequires: atlas-devel
# for regtests
BuildRequires: bc
@@ -105,8 +107,12 @@ cp -p %{SOURCE2} arch/Linux-i686-gfortran.ssmp
cp -p %{SOURCE2} arch/Linux-x86-64-gfortran.ssmp
cp -p %{SOURCE3} arch/
%patch0 -p1 -b .r
+%patch1 -p1 -b .fftw_unaligned
rm -r tools/makedepf90
chmod -x src/harris_{functional,{env,energy}_types}.F
+%ifarch i686
+sed -i 's/-D__FFTW3/-D__FFTW3 -D__FFTW3_UNALIGNED/g' arch/Linux-i686-gfortran* arch/Linux-gfortran-{mpich2,openmpi}-popt
+%endif
%build
export FORT_C_NAME=gfortran
@@ -179,6 +185,9 @@ popd
%{_libdir}/mpich2%{?_opt_cc_suffix}/bin/cp2k.popt_mpich2
%changelog
+* Sat Apr 13 2013 Dominik Mierzejewski <rpm at greysector.net> - 2.3-3.20130220
+- fix crashes in fftw on i686 (patch by Michael Banck)
+
* Wed Feb 20 2013 Dominik Mierzejewski <rpm at greysector.net> - 2.3-2.20130220
- update to current SVN 2.3 stable branch
- re-enable regtests
More information about the scm-commits
mailing list