[cp2k] Build openmpi/mpich2 subpackages with some minor fixes

tomspur tomspur at fedoraproject.org
Tue Jul 24 12:17:54 UTC 2012


commit 185913ddb69ae4022049f23a5dd2d11b8e4c0acf
Author: Thomas Spura <thomas.spura at gmail.com>
Date:   Tue Jul 24 14:12:23 2012 +0200

    Build openmpi/mpich2 subpackages with some minor fixes
    
    - don't run testsuite as it is only usefull when comparing to old outputs
      (which we don't have at buildtime)
    - define common description macro
    - also build with openmpi/mpich2
    - new url

 cp2k.spec |   99 ++++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 76 insertions(+), 23 deletions(-)
---
diff --git a/cp2k.spec b/cp2k.spec
index 66f417c..8fa40ec 100644
--- a/cp2k.spec
+++ b/cp2k.spec
@@ -2,12 +2,16 @@
 
 Name: cp2k
 Version: 2.1
-Release: 5.%{snapshot}%{?dist}
+Release: 6.%{snapshot}%{?dist}
 Group: Applications/Engineering
 Summary: A molecular dynamics engine capable of classical and Car-Parrinello simulations
 License: GPLv2+
-URL: http://cp2k.berlios.de/
+URL: http://cp2k.org/
 Source0: ftp://ftp.berlios.de/pub/cp2k/cp2k-2_1-branch.tar.gz
+# custom openmpi arch file
+# also works for mpich2 and possibly others
+# only assumption for mpi library: fortran compiler is named mpif90
+Source1: Linux-gfortran-openmpi.popt
 # patch to:
 # use rpm optflags
 # link with atlas instead of vanilla blas/lapack
@@ -23,47 +27,66 @@ BuildRequires: makedepf90
 Requires: %{name}-common = %{version}-%{release}
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-%description
-CP2K is a freely available (GPL) program, written in Fortran 95, to
-perform atomistic and molecular simulations of solid state, liquid,
-molecular and biological systems. It provides a general framework for
-different methods such as e.g. density functional theory (DFT) using a
-mixed Gaussian and plane waves approach (GPW), and classical pair and
+%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,\
+molecular and biological systems. It provides a general framework for\
+different methods such as e.g. density functional theory (DFT) using a\
+mixed Gaussian and plane waves approach (GPW), and classical pair and\
 many-body potentials.
 
+%description
+%{cp2k_desc_base}
+
 This package contains the single process version.
 
 %package smp
 Group: Applications/Engineering
-Summary: Molecular simulations software - multi-threaded version
+Summary: Molecular simulations software - OpenMP version
 Requires: %{name}-common = %{version}-%{release}
 
 %description smp
-CP2K is a freely available (GPL) program, written in Fortran 95, to
-perform atomistic and molecular simulations of solid state, liquid,
-molecular and biological systems. It provides a general framework for
-different methods such as e.g. density functional theory (DFT) using a
-mixed Gaussian and plane waves approach (GPW), and classical pair and
-many-body potentials.
+%{cp2k_desc_base}
 
 This package contains the multi-threaded version (using OpenMP).
 
+%package openmpi
+Group: Applications/Engineering
+Summary: Molecular simulations software - openmpi version
+BuildRequires:  blacs-openmpi-devel
+BuildRequires:  scalapack-openmpi-devel
+Requires: %{name}-common = %{version}-%{release}
+
+%description openmpi
+%{cp2k_desc_base}
+
+This package contains the multi-threaded version (using OpenMPI).
+
+%package mpich2
+Group: Applications/Engineering
+Summary: Molecular simulations software - mpich2 version
+BuildRequires:  blacs-mpich2-devel
+BuildRequires:  scalapack-mpich2-devel
+Requires: %{name}-common = %{version}-%{release}
+
+%description mpich2
+%{cp2k_desc_base}
+
+This package contains the multi-threaded version (using mpich2).
+
 %package common
 Group: Applications/Engineering
 Summary: Molecular simulations software - common files
 
 %description common
-CP2K is a freely available (GPL) program, written in Fortran 95, to
-perform atomistic and molecular simulations of solid state, liquid,
-molecular and biological systems. It provides a general framework for
-different methods such as e.g. density functional theory (DFT) using a
-mixed Gaussian and plane waves approach (GPW), and classical pair and
-many-body potentials.
+%{cp2k_desc_base}
 
 This package contains the documentation and the manual.
 
 %prep
 %setup -q -n %{name}
+cp %{SOURCE1} arch/
+cp %{SOURCE1} arch/Linux-gfortran-mpich2.popt
 %patch0 -p1 -b .r
 rm -r tools/makedepf90
 chmod -x src/harris_{functional,{env,energy}_types}.F
@@ -71,20 +94,35 @@ chmod -x src/harris_{functional,{env,energy}_types}.F
 %build
 export FORT_C_NAME=gfortran
 pushd makefiles
-make OPTFLAGS="%{optflags} -L%{_libdir}/atlas" %{?_smp_mflags} sopt ssmp
+    %{_openmpi_load}
+        make OPTFLAGS="%{optflags} -L%{_libdir}/atlas" %{?_smp_mflags} ARCH="Linux-gfortran-openmpi" VERSION=popt
+    %{_openmpi_unload}
+    %{_mpich2_load}
+        make OPTFLAGS="%{optflags} -L%{_libdir}/atlas" %{?_smp_mflags} ARCH="Linux-gfortran-mpich2" VERSION=popt
+    %{_mpich2_unload}
+
+    make OPTFLAGS="%{optflags} -L%{_libdir}/atlas" %{?_smp_mflags} sopt ssmp
 popd
 
 %install
 rm -rf %{buildroot}
 export FORT_C_NAME=gfortran
 install -d %{buildroot}%{_bindir}
+%{_openmpi_load}
+    mkdir -p %{buildroot}%{_libdir}/openmpi%{?_opt_cc_suffix}/bin/
+    install -pm755 exe/Linux-gfortran-openmpi/cp2k.popt %{buildroot}%{_libdir}/openmpi%{?_opt_cc_suffix}/bin/cp2k.popt_openmpi
+%{_openmpi_unload}
+%{_mpich2_load}
+    mkdir -p %{buildroot}%{_libdir}/mpich2%{?_opt_cc_suffix}/bin/
+    install -pm755 exe/Linux-gfortran-mpich2/cp2k.popt %{buildroot}%{_libdir}/mpich2%{?_opt_cc_suffix}/bin/cp2k.popt_mpich2
+%{_mpich2_unload}
 install -pm755 exe/`tools/get_arch_code`/cp2k.sopt %{buildroot}%{_bindir}
 install -pm755 exe/`tools/get_arch_code`/cp2k.ssmp %{buildroot}%{_bindir}
 
 %clean
 rm -rf %{buildroot}
 
-%if 1
+%if 0
 %check
 export FORT_C_NAME=gfortran
 cat > tests/fedora.config << __EOF__
@@ -115,7 +153,22 @@ popd
 %defattr(-,root,root,-)
 %{_bindir}/cp2k.ssmp
 
+%files openmpi
+%defattr(-,root,root,-)
+%{_libdir}/openmpi%{?_opt_cc_suffix}/bin/cp2k.popt_openmpi
+
+%files mpich2
+%defattr(-,root,root,-)
+%{_libdir}/mpich2%{?_opt_cc_suffix}/bin/cp2k.popt_mpich2
+
 %changelog
+* Tue Jul 24 2012 Thomas Spura <tomspur at fedoraproject.org> - 2.1-6.20101006
+- don't run testsuite as it is only usefull when comparing to old outputs
+  (which we don't have at buildtime)
+- define common description macro
+- also build with openmpi/mpich2
+- new url
+
 * Wed Jul 18 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.1-5.20101006
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list