[cp2k/f19] Rebuild against libint.

Susi Lehtola jussilehtola at fedoraproject.org
Mon Dec 23 23:07:01 UTC 2013


commit 6cbb1e41b798e53cd6ecf6a902786fc391faa669
Author: Susi Lehtola <jussilehtola at fedoraproject.org>
Date:   Tue Dec 24 01:06:52 2013 +0200

    Rebuild against libint.

 Linux-gfortran-openmpi.popt |   21 ---------------------
 Linux-i686-gfortran.sopt    |   21 ---------------------
 Linux-i686-gfortran.ssmp    |   21 ---------------------
 cp2k-rpm.patch              |   32 ++++++++++++++++----------------
 cp2k.spec                   |   24 +++++++++++++++++++++---
 5 files changed, 37 insertions(+), 82 deletions(-)
---
diff --git a/cp2k-rpm.patch b/cp2k-rpm.patch
index 4945c74..2381215 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-07-02 21:46:11.102063718 +0200
+--- 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 00:16:56.455644039 +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=8 -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-07-02 22:05:27.872818114 +0200
+--- 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 00:16:29.224367579 +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=8 -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-06-19 21:59:08.051612836 +0200
+--- 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 00:16:43.783980730 +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=8 -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-06-19 21:59:08.051612836 +0200
+--- 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 00:16:48.551854047 +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=8 -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-06-19 21:59:08.051612836 +0200
+--- cp2k-2.4/makefiles/Makefile.r	2013-05-27 14:12:21.000000000 +0300
++++ cp2k-2.4/makefiles/Makefile	2013-12-24 00:14:41.275235569 +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-06-19 21:59:08.051612836 +0200
+--- cp2k-2.4/tools/do_regtest.r	2012-08-21 11:25:41.000000000 +0300
++++ cp2k-2.4/tools/do_regtest	2013-12-24 00:14:41.275235569 +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 57f5360..f481281 100644
--- a/cp2k.spec
+++ b/cp2k.spec
@@ -3,7 +3,7 @@
 
 Name: cp2k
 Version: 2.4
-Release: 4.%{snapshot}svn12994%{?dist}
+Release: 5.%{snapshot}svn12994%{?dist}
 Group: Applications/Engineering
 Summary: A molecular dynamics engine capable of classical and Car-Parrinello simulations
 License: GPLv2+
@@ -31,11 +31,14 @@ BuildRequires: libint-devel >= 1.1.4
 BuildRequires: libxc-devel
 BuildRequires: makedepf90
 BuildRequires: /bin/hostname
-Requires: %{name}-common = %{version}-%{release}
 Obsoletes: %{name}-smp < 2.4-3
 Provides: %{name}-smp = %{version}-%{release}
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
+Requires: %{name}-common = %{version}-%{release}
+# Libint may break the API
+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,\
@@ -58,6 +61,8 @@ BuildRequires:  scalapack-openmpi-devel
 Requires: %{name}-common = %{version}-%{release}
 Requires: blacs-openmpi
 Requires: scalapack-openmpi
+# Libint may break the API
+Requires: libint = %{_libint_version}
 
 %description openmpi
 %{cp2k_desc_base}
@@ -76,6 +81,8 @@ Requires: blacs-mpich
 Requires: scalapack-mpich
 Provides: %{name}-mpich2 = %{version}-%{release}
 Obsoletes: %{name}-mpich2 < 2.4-3
+# Libint may break the API
+Requires: libint = %{_libint_version}
 
 %description mpich
 %{cp2k_desc_base}
@@ -108,9 +115,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
@@ -182,6 +197,9 @@ popd
 %{_libdir}/mpich%{?_opt_cc_suffix}/bin/cp2k.psmp_mpich
 
 %changelog
+* Tue Dec 24 2013 Susi Lehtola <jussilehtola at fedoraproject.org> - 2.4-5.20130620svn12994
+- Rebuild against libint.
+
 * Fri Nov 15 2013 Dominik Mierzejewski <rpm at greysector.net> - 2.4-4.20130620svn12994
 - update to latest 2.4 branch snapshot
 - use xz to compress SVN snapshot tarball


More information about the scm-commits mailing list