[cp2k/el6] Rebuild against libint.
Susi Lehtola
jussilehtola at fedoraproject.org
Mon Dec 23 23:11:24 UTC 2013
commit 3f7e10f16819cbca3a46fb90e922de3f28f376a5
Author: Susi Lehtola <jussilehtola at fedoraproject.org>
Date: Tue Dec 24 01:11:14 2013 +0200
Rebuild against libint.
cp2k-rpm.patch | 32 ++++++++++++++++----------------
cp2k.spec | 25 ++++++++++++++++++++++---
2 files changed, 38 insertions(+), 19 deletions(-)
---
diff --git a/cp2k-rpm.patch b/cp2k-rpm.patch
index 2c0258a..b929a5f 100644
--- a/cp2k-rpm.patch
+++ b/cp2k-rpm.patch
@@ -1,6 +1,6 @@
diff -up cp2k-2.4/arch/Linux-x86-64-gfortran.popt.r cp2k-2.4/arch/Linux-x86-64-gfortran.popt
---- cp2k-2.4/arch/Linux-x86-64-gfortran.popt.r 2013-04-17 11:28:09.000000000 +0200
-+++ cp2k-2.4/arch/Linux-x86-64-gfortran.popt 2013-11-15 15:29:21.298230262 +0100
+--- cp2k-2.4/arch/Linux-x86-64-gfortran.popt.r 2013-04-17 12:28:09.000000000 +0300
++++ cp2k-2.4/arch/Linux-x86-64-gfortran.popt 2013-12-24 01:08:16.666916752 +0200
@@ -12,9 +12,10 @@ LD = mpif90
AR = ar -r
@@ -9,7 +9,7 @@ diff -up cp2k-2.4/arch/Linux-x86-64-gfortran.popt.r cp2k-2.4/arch/Linux-x86-64-g
-FCFLAGS = -O3 -march=native -ffast-math -funroll-loops -g -ffree-form $(DFLAGS)
-LDFLAGS = $(FCFLAGS) -L/data/vjoost/libint/install/lib/ -L/data/vjoost/libsmm/lib/ -L/opt/intel/composerxe-2011.3.174/mkl/lib/intel64 -L/data/vjoost/libxc-2.0.1/install/lib
-LIBS = -lsmm_dnn -lderiv -lint -lstdc++ -lfftw3 -lmkl_gf_lp64 -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64 -lmkl_sequential -lmkl_core -lxc
-+DFLAGS = -D__GFORTRAN -D__FFTSG -D__LIBINT -D__FFTW3 -D__parallel -D__SCALAPACK -D__BLACS -D__LIBXC2 -D__LIBINT_MAX_AM=7 -D__LIBDERIV_MAX_AM1=6
++DFLAGS = -D__GFORTRAN -D__FFTSG -D__LIBINT -D__FFTW3 -D__parallel -D__SCALAPACK -D__BLACS -D__LIBXC2 -D__LIBINT_MAX_AM=@LIBINT_MAX_AM@ -D__LIBDERIV_MAX_AM1=@LIBDERIV_MAX_AM@
+OPTFLAGS = -O3 -march=native -ffast-math -funroll-loops -g
+FCFLAGS = $(OPTFLAGS) -ffree-form -ffree-line-length-none $(DFLAGS)
+LDFLAGS = $(FCFLAGS)
@@ -17,8 +17,8 @@ diff -up cp2k-2.4/arch/Linux-x86-64-gfortran.popt.r cp2k-2.4/arch/Linux-x86-64-g
OBJECTS_ARCHITECTURE = machine_gfortran.o
diff -up cp2k-2.4/arch/Linux-x86-64-gfortran.psmp.r cp2k-2.4/arch/Linux-x86-64-gfortran.psmp
---- cp2k-2.4/arch/Linux-x86-64-gfortran.psmp.r 2013-04-17 11:28:09.000000000 +0200
-+++ cp2k-2.4/arch/Linux-x86-64-gfortran.psmp 2013-11-15 15:29:21.298230262 +0100
+--- cp2k-2.4/arch/Linux-x86-64-gfortran.psmp.r 2013-04-17 12:28:09.000000000 +0300
++++ cp2k-2.4/arch/Linux-x86-64-gfortran.psmp 2013-12-24 01:07:56.204460342 +0200
@@ -13,9 +13,10 @@ LD = mpif90
AR = ar -r
@@ -27,7 +27,7 @@ diff -up cp2k-2.4/arch/Linux-x86-64-gfortran.psmp.r cp2k-2.4/arch/Linux-x86-64-g
-FCFLAGS = -fopenmp -O3 -march=native -ffast-math -funroll-loops -g -ffree-form $(DFLAGS)
-LDFLAGS = $(FCFLAGS) -L/data/vjoost/libint/install/lib/ -L/data/vjoost/libsmm/lib/ -L/opt/intel/composerxe-2011.3.174/mkl/lib/intel64 -L/data/vjoost/libxc-2.0.1/install/lib
-LIBS = -lsmm_dnn -lderiv -lint -lstdc++ -lfftw3_threads -lfftw3 -lmkl_gf_lp64 -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64 -lmkl_sequential -lmkl_core -lxc
-+DFLAGS = -D__GFORTRAN -D__FFTSG -D__LIBINT -D__FFTW3 -D__parallel -D__SCALAPACK -D__BLACS -D__LIBXC2 -D__LIBINT_MAX_AM=7 -D__LIBDERIV_MAX_AM1=6
++DFLAGS = -D__GFORTRAN -D__FFTSG -D__LIBINT -D__FFTW3 -D__parallel -D__SCALAPACK -D__BLACS -D__LIBXC2 -D__LIBINT_MAX_AM=@LIBINT_MAX_AM@ -D__LIBDERIV_MAX_AM1=@LIBDERIV_MAX_AM@
+OPTFLAGS = -fopenmp -O3 -march=native -ffast-math -funroll-loops -g
+FCFLAGS = $(OPTFLAGS) -ffree-form -ffree-line-length-none $(DFLAGS)
+LDFLAGS = $(FCFLAGS)
@@ -35,8 +35,8 @@ diff -up cp2k-2.4/arch/Linux-x86-64-gfortran.psmp.r cp2k-2.4/arch/Linux-x86-64-g
OBJECTS_ARCHITECTURE = machine_gfortran.o
diff -up cp2k-2.4/arch/Linux-x86-64-gfortran.sopt.r cp2k-2.4/arch/Linux-x86-64-gfortran.sopt
---- cp2k-2.4/arch/Linux-x86-64-gfortran.sopt.r 2013-04-17 11:28:09.000000000 +0200
-+++ cp2k-2.4/arch/Linux-x86-64-gfortran.sopt 2013-11-15 15:29:21.298230262 +0100
+--- cp2k-2.4/arch/Linux-x86-64-gfortran.sopt.r 2013-04-17 12:28:09.000000000 +0300
++++ cp2k-2.4/arch/Linux-x86-64-gfortran.sopt 2013-12-24 01:08:10.651076566 +0200
@@ -12,9 +12,10 @@ LD = gfortran
AR = ar -r
@@ -45,7 +45,7 @@ diff -up cp2k-2.4/arch/Linux-x86-64-gfortran.sopt.r cp2k-2.4/arch/Linux-x86-64-g
-FCFLAGS = -O3 -march=native -ffast-math -g -ffree-form $(DFLAGS)
-LDFLAGS = $(FCFLAGS) -L/data/vjoost/libint/install/lib/ -L/data/vjoost/libsmm/lib/ -L/opt/intel/composerxe-2011.3.174/mkl/lib/intel64 -L/data/vjoost/libxc-2.0.1/install/lib
-LIBS = -lsmm_dnn -lderiv -lint -lstdc++ -lfftw3 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lxc
-+DFLAGS = -D__GFORTRAN -D__FFTSG -D__LIBINT -D__FFTW3 -D__LIBXC2 -D__LIBINT_MAX_AM=7 -D__LIBDERIV_MAX_AM1=6
++DFLAGS = -D__GFORTRAN -D__FFTSG -D__LIBINT -D__FFTW3 -D__LIBXC2 -D__LIBINT_MAX_AM=@LIBINT_MAX_AM@ -D__LIBDERIV_MAX_AM1=@LIBDERIV_MAX_AM@
+OPTFLAGS = -O3 -march=native -ffast-math -g -ffree-form
+FCFLAGS = $(OPTFLAGS) -ffree-form -ffree-line-length-none $(DFLAGS)
+LDFLAGS = $(FCFLAGS)
@@ -53,8 +53,8 @@ diff -up cp2k-2.4/arch/Linux-x86-64-gfortran.sopt.r cp2k-2.4/arch/Linux-x86-64-g
OBJECTS_ARCHITECTURE = machine_gfortran.o
diff -up cp2k-2.4/arch/Linux-x86-64-gfortran.ssmp.r cp2k-2.4/arch/Linux-x86-64-gfortran.ssmp
---- cp2k-2.4/arch/Linux-x86-64-gfortran.ssmp.r 2013-04-17 11:28:09.000000000 +0200
-+++ cp2k-2.4/arch/Linux-x86-64-gfortran.ssmp 2013-11-15 15:29:21.298230262 +0100
+--- cp2k-2.4/arch/Linux-x86-64-gfortran.ssmp.r 2013-04-17 12:28:09.000000000 +0300
++++ cp2k-2.4/arch/Linux-x86-64-gfortran.ssmp 2013-12-24 01:08:02.203300983 +0200
@@ -12,9 +12,10 @@ LD = gfortran
AR = ar -r
@@ -63,7 +63,7 @@ diff -up cp2k-2.4/arch/Linux-x86-64-gfortran.ssmp.r cp2k-2.4/arch/Linux-x86-64-g
-FCFLAGS = -fopenmp -O3 -march=native -ffast-math -g -ffree-form $(DFLAGS)
-LDFLAGS = $(FCFLAGS) -L/data/vjoost/libint/install/lib/ -L/data/vjoost/libsmm/lib/ -L/opt/intel/composerxe-2011.3.174/mkl/lib/intel64 -L/data/vjoost/libxc-2.0.1/install/lib
-LIBS = -lsmm_dnn -lderiv -lint -lstdc++ -lfftw3 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lxc
-+DFLAGS = -D__GFORTRAN -D__FFTSG -D__LIBINT -D__FFTW3 -D__LIBXC2 -D__LIBINT_MAX_AM=7 -D__LIBDERIV_MAX_AM1=6
++DFLAGS = -D__GFORTRAN -D__FFTSG -D__LIBINT -D__FFTW3 -D__LIBXC2 -D__LIBINT_MAX_AM=@LIBINT_MAX_AM@ -D__LIBDERIV_MAX_AM1=@LIBDERIV_MAX_AM@
+OPTFLAGS = -O3 -march=native -ffast-math -g
+FCFLAGS = $(OPTFLAGS) -ffree-form -ffree-line-length-none -fopenmp $(DFLAGS)
+LDFLAGS = $(FCFLAGS)
@@ -71,8 +71,8 @@ diff -up cp2k-2.4/arch/Linux-x86-64-gfortran.ssmp.r cp2k-2.4/arch/Linux-x86-64-g
OBJECTS_ARCHITECTURE = machine_gfortran.o
diff -up cp2k-2.4/makefiles/Makefile.r cp2k-2.4/makefiles/Makefile
---- cp2k-2.4/makefiles/Makefile.r 2013-05-27 13:12:21.000000000 +0200
-+++ cp2k-2.4/makefiles/Makefile 2013-11-15 15:29:21.298230262 +0100
+--- cp2k-2.4/makefiles/Makefile.r 2013-05-27 14:12:21.000000000 +0300
++++ cp2k-2.4/makefiles/Makefile 2013-12-24 01:07:02.845877743 +0200
@@ -96,17 +96,17 @@ CLEAN_TARGETS = $(addsuffix /clean ,$(VE
# lists the targets that are not files
#
@@ -149,8 +149,8 @@ diff -up cp2k-2.4/makefiles/Makefile.r cp2k-2.4/makefiles/Makefile
#
# the rule how to generate the .o from the .F
diff -up cp2k-2.4/tools/do_regtest.r cp2k-2.4/tools/do_regtest
---- cp2k-2.4/tools/do_regtest.r 2012-08-21 10:25:41.000000000 +0200
-+++ cp2k-2.4/tools/do_regtest 2013-11-15 15:29:21.298230262 +0100
+--- cp2k-2.4/tools/do_regtest.r 2012-08-21 11:25:41.000000000 +0300
++++ cp2k-2.4/tools/do_regtest 2013-12-24 01:07:02.846877717 +0200
@@ -103,8 +103,8 @@ leakcheck="NO"
# *** how to execute an input file [ cp2k_prefix input cp2k_postfix ]
diff --git a/cp2k.spec b/cp2k.spec
index b2c23fa..97426e2 100644
--- a/cp2k.spec
+++ b/cp2k.spec
@@ -3,7 +3,7 @@
Name: cp2k
Version: 2.4
-Release: 1.%{snapshot}svn12994%{?dist}
+Release: 2.%{snapshot}svn12994%{?dist}
Group: Applications/Engineering
Summary: A molecular dynamics engine capable of classical and Car-Parrinello simulations
License: GPLv2+
@@ -32,11 +32,15 @@ BuildRequires: libint-devel >= 1.1.4
BuildRequires: libxc-devel
BuildRequires: makedepf90
BuildRequires: /bin/hostname
-Requires: %{name}-common = %{version}-%{release}
+
Obsoletes: %{name}-smp < 2.4-1
Provides: %{name}-smp = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires: %{name}-common = %{version}-%{release}
+# Libint may have API breakage
+Requires: libint = %{_libint_version}
+
%global cp2k_desc_base \
CP2K is a freely available (GPL) program, written in Fortran 95, to\
perform atomistic and molecular simulations of solid state, liquid,\
@@ -59,6 +63,8 @@ BuildRequires: scalapack-openmpi-devel
Requires: %{name}-common = %{version}-%{release}
Requires: blacs-openmpi
Requires: scalapack-openmpi
+# Libint may have API breakage
+Requires: libint = %{_libint_version}
%description openmpi
%{cp2k_desc_base}
@@ -77,6 +83,8 @@ BuildRequires: scalapack-mpich2-devel
Requires: %{name}-common = %{version}-%{release}
Requires: blacs-mpich2
Requires: scalapack-mpich2
+# Libint may have API breakage
+Requires: libint = %{_libint_version}
%description mpich2
%{cp2k_desc_base}
@@ -111,9 +119,17 @@ rm -r tools/makedepf90
chmod -x src/harris_{functional,{env,energy}_types}.F
# fix crashes in fftw on i686
%ifarch i686
-sed -i 's/-D__FFTW3/-D__FFTW3 -D__FFTW3_UNALIGNED/g' arch/Linux-i686-gfortran*
+sed -i 's/-D__FFTW3/-D__FFTW3 -D__FFTW3_UNALIGNED/g' arch/Linux-x86-64-gfortran*
%endif
+# Get libint and libderiv limits
+maxam=`grep LIBINT_MAX_AM %{_includedir}/libint/libint.h | awk '{print $3}'`
+maxderiv=`grep "LIBDERIV_MAX_AM1 " %{_includedir}/libderiv/libderiv.h | awk '{print $3}'`
+# Plug them in the configuration
+for f in arch/Linux-x86-64-gfortran.{popt,psmp,sopt,ssmp}; do
+ sed -i "s|@LIBINT_MAX_AM@|$maxam|g;s|@LIBDERIV_MAX_AM@|$maxderiv|g" $f
+done
+
%build
TARGET=$(tools/get_arch_code)
pushd makefiles
@@ -192,6 +208,9 @@ popd
%endif
%changelog
+* Tue Dec 24 2013 Susi Lehtola <jussilehtola at fedoraproject.org> - 2.4-2.20130620svn12994
+- Rebuild against libint.
+
* Fri Nov 15 2013 Dominik Mierzejewski <rpm at greysector.net> - 2.4-1.20130620svn12994
- update to latest 2.4 branch snapshot
- drop mpich2 subpackage on ppc(64) and s390(x)
More information about the scm-commits
mailing list