786824f
%global git 1
786824f
%global commit 7a9ac7414721b40d7d4eaf286b5ae6c18e28f325
786824f
%global shortcommit %(c=%{commit}; echo ${c:0:7})
786824f
Thomas Spura 8afca25
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
Thomas Spura 8afca25
%global with_python3 1
Thomas Spura 8afca25
%else
Thomas Spura 8afca25
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
Thomas Spura 8afca25
%endif
Thomas Spura 8afca25
Thomas Spura 8afca25
### TESTSUITE ###
Thomas Spura 8afca25
# The testsuite currently fails only on the buildsystem, but works localy.
Thomas Spura 8afca25
# So to easy enable/disable the testsuite, I introduce the following
Thomas Spura 8afca25
#   variables:
Thomas Spura 8afca25
#
Deji Akingunola a46525b
# * MPICH:     if '1' enable mpich
Thomas Spura 8afca25
# * OPENMPI:   if '1' enable openmpi
Deji Akingunola a46525b
%global MPICH 0
Thomas Spura 8afca25
%global OPENMPI 0
Thomas Spura 8afca25
Thomas Spura 8afca25
Name:           espresso
786824f
Version:        4.0
786824f
Release:        0.1.20170220git%{shortcommit}%{?dist}
Thomas Spura 8afca25
Summary:        Extensible Simulation Package for Research on Soft matter
Thomas Spura 8afca25
Thomas Spura 8afca25
License:        GPLv3+
Thomas Spura 8afca25
URL:            http://espressomd.org
786824f
%if %{git}
786824f
Source0:	https://github.com/%{name}md/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz
786824f
%else
Thomas Spura 8afca25
Source0:        http://download.savannah.gnu.org/releases/espressomd/espresso-%{version}.tar.gz
786824f
%endif
786824f
# PATCH-FIX-UPSTREAM - 1042.patch -  allow user to override PYTHON_INSTDIR
786824f
Patch0:         https://patch-diff.githubusercontent.com/raw/espressomd/espresso/pull/1042.patch
786824f
Thomas Spura 8afca25
786824f
BuildRequires:  cmake
Thomas Spura 7edaf03
BuildRequires:  Cython
Thomas Spura 7edaf03
BuildRequires:  fftw-devel
Thomas Spura 7edaf03
BuildRequires:  numpy
Thomas Spura eb3f530
BuildRequires:  python-devel
786824f
BuildRequires:  boost-devel
786824f
BuildRequires:  mpich-devel
786824f
BuildRequires:  boost-mpich-devel
786824f
BuildRequires:  openmpi-devel
786824f
BuildRequires:  boost-openmpi-devel
Thomas Spura 8afca25
Thomas Spura c8c0b84
Requires:       numpy
Thomas Spura 8afca25
Requires:       %{name}-common = %{version}-%{release}
Thomas Spura 8afca25
Thomas Spura 8afca25
%description
Thomas Spura 8afca25
ESPResSo can perform Molecular Dynamics simulations of bead-spring models
Thomas Spura 8afca25
in various ensembles ((N,V,E), (N,V,T), and (N,p,T)).
Thomas Spura 8afca25
ESPResSo contains a number of advanced algorithms, e.g.
Thomas Spura 8afca25
    * DPD thermostat (for hydrodynamics)
Thomas Spura 8afca25
    * P3M, MMM2D, MMM1D, ELC for electrostatic interactions
Thomas Spura d60f901
    * Lattice-Boltzmann for hydrodynamics
Thomas Spura 8afca25
Thomas Spura 8afca25
%package common
Thomas Spura 8afca25
Summary:        Common files for %{name} packages
Thomas Spura 8afca25
BuildArch:      noarch
Thomas Spura 8afca25
Requires:       %{name}-common = %{version}-%{release}
Thomas Spura 8afca25
%description common
Thomas Spura 8afca25
ESPResSo can perform Molecular Dynamics simulations of bead-spring models
Thomas Spura 8afca25
in various ensembles ((N,V,E), (N,V,T), and (N,p,T)).
Thomas Spura 8afca25
ESPResSo contains a number of advanced algorithms, e.g.
Thomas Spura 8afca25
    * DPD thermostat (for hydrodynamics)
Thomas Spura 8afca25
    * P3M, MMM2D, MMM1D, ELC for electrostatic interactions
Thomas Spura d60f901
    * Lattice-Boltzmann for hydrodynamics
786824f
This package contains the license file and data files shared between the
Thomas Spura 8afca25
subpackages of %{name}.
Thomas Spura 8afca25
786824f
%package devel
786824f
Summary:        Development package for  %{name} packages
786824f
Requires:       python2-%{name}-openmpi = %{version}-%{release}
786824f
Requires:       python2-%{name}-mpich = %{version}-%{release}
786824f
%description devel
786824f
ESPResSo can perform Molecular Dynamics simulations of bead-spring models
786824f
in various ensembles ((N,V,E), (N,V,T), and (N,p,T)).
786824f
ESPResSo contains a number of advanced algorithms, e.g.
786824f
    * DPD thermostat (for hydrodynamics)
786824f
    * P3M, MMM2D, MMM1D, ELC for electrostatic interactions
786824f
    * Lattice-Boltzmann for hydrodynamics
786824f
This package contains the development libraries of %{name}.
786824f
786824f
%package -n python2-%{name}-openmpi
Thomas Spura 8afca25
Requires:       %{name}-common = %{version}-%{release}
Thomas Spura 8afca25
Summary:        Extensible Simulation Package for Research on Soft matter
786824f
Provides:       %{name}-openmpi = %{version}-%{release}
786824f
Obsoletes:      %{name}-openmpi < 3.3.0-12
786824f
%description -n python2-%{name}-openmpi
Thomas Spura 8afca25
ESPResSo can perform Molecular Dynamics simulations of bead-spring models
Thomas Spura 8afca25
in various ensembles ((N,V,E), (N,V,T), and (N,p,T)).
Thomas Spura 8afca25
ESPResSo contains a number of advanced algorithms, e.g.
Thomas Spura 8afca25
    * DPD thermostat (for hydrodynamics)
Thomas Spura 8afca25
    * P3M, MMM2D, MMM1D, ELC for electrostatic interactions
Thomas Spura d60f901
    * Lattice-Boltzmann for hydrodynamics
Thomas Spura 8afca25
Thomas Spura 8afca25
This package contains %{name} compiled against Open MPI.
Thomas Spura 8afca25
Thomas Spura 8afca25
786824f
%package -n python2-%{name}-mpich
Thomas Spura 8afca25
Requires:       %{name}-common = %{version}-%{release}
Thomas Spura 8afca25
Summary:        Extensible Simulation Package for Research on Soft matter
Thomas Spura e0fad53
Provides:       %{name}-mpich2 = %{version}-%{release}
Thomas Spura e0fad53
Obsoletes:      %{name}-mpich2 < 3.1.1-3
786824f
Provides:       %{name}-mpich = %{version}-%{release}
786824f
Obsoletes:      %{name}-mpich < 3.3.0-12
786824f
%description -n python2-%{name}-mpich
Thomas Spura 8afca25
ESPResSo can perform Molecular Dynamics simulations of bead-spring models
Thomas Spura 8afca25
in various ensembles ((N,V,E), (N,V,T), and (N,p,T)).
Thomas Spura 8afca25
ESPResSo contains a number of advanced algorithms, e.g.
Thomas Spura 8afca25
    * DPD thermostat (for hydrodynamics)
Thomas Spura 8afca25
    * P3M, MMM2D, MMM1D, ELC for electrostatic interactions
Thomas Spura d60f901
    * Lattice-Boltzmann for hydrodynamics
Thomas Spura 8afca25
Thomas Spura 8afca25
This package contains %{name} compiled against MPICH2.
Thomas Spura 8afca25
Thomas Spura 8afca25
Thomas Spura 8afca25
%prep
786824f
%if %{git}
786824f
%setup -q -n espresso-%{commit}
786824f
%else
Thomas Spura 8afca25
%setup -q
786824f
%endif
Thomas Spura 8068826
%patch0 -p1
786824f
find . -name "*.[ch]pp" -exec chmod -x {} \;
786824f
chmod -x AUTHORS COPYING README NEWS ChangeLog 
786824f
mkdir openmpi_build mpich_build
Thomas Spura 8afca25
Thomas Spura 8afca25
%build
786824f
%global defopts \\\
786824f
 -DWITH_PYTHON=ON \\\
786824f
 -DWITH_TESTS=ON \\\
786824f
 -DWITH_SCAFACOS=ON \\\
786824f
 -DCMAKE_SKIP_RPATH:BOOL=ON \\\
786824f
 -DCMAKE_SKIP_BUILD_RPATH:BOOL=ON \\\
786824f
 -DINSTALL_PYPRESSO=OFF
Thomas Spura 8afca25
Thomas Spura 8afca25
# Build OpenMPI version
786824f
#see #756141 to understand why MPI_C_LIBRARIES needs to be set
Thomas Spura 8afca25
%{_openmpi_load}
Thomas Spura 8afca25
pushd openmpi_build
786824f
%{cmake} \
786824f
  %{defopts} \
786824f
  -DLIBDIR=${MPI_LIB} \
786824f
  -DPYTHON_INSTDIR=${MPI_PYTHON2_SITEARCH} \
786824f
  -DMPI_C_LIBRARIES=${MPI_LIB}/libmpi.so \
786824f
  ..
786824f
%make_build
Thomas Spura 8afca25
popd
Thomas Spura 8afca25
%{_openmpi_unload}
Thomas Spura 8afca25
Deji Akingunola a46525b
# Build mpich version
Deji Akingunola a46525b
%{_mpich_load}
Deji Akingunola a46525b
pushd mpich_build
786824f
%{cmake} \
786824f
  %{defopts} \
786824f
  -DLIBDIR=${MPI_LIB} \
786824f
  -DPYTHON_INSTDIR=${MPI_PYTHON2_SITEARCH} \
786824f
  -DMPI_C_LIBRARIES=${MPI_LIB}/libmpi.so \
786824f
  ..
786824f
%make_build
Thomas Spura 8afca25
popd
Deji Akingunola a46525b
%{_mpich_unload}
Thomas Spura 8afca25
Thomas Spura 8afca25
%install
Thomas Spura 8afca25
# first install mpi files and move around because MPI_SUFFIX above doesn't
Thomas Spura 8afca25
# work yet (will be fixed in a new version)
Thomas Spura 8afca25
%{_openmpi_load}
Thomas Spura 8afca25
pushd openmpi_build
786824f
%make_install
Thomas Spura 8afca25
popd
Thomas Spura 8afca25
%{_openmpi_unload}
Thomas Spura 8afca25
Deji Akingunola a46525b
%{_mpich_load}
Deji Akingunola a46525b
pushd mpich_build
786824f
%make_install
Thomas Spura 8afca25
popd
Deji Akingunola a46525b
%{_mpich_unload}
786824f
find %{buildroot}%{_prefix} -name "*.so" -exec chmod +x {} \;
786824f
find %{buildroot}%{_prefix} -name "gen_pxiconfig" -exec chmod +x {} \;
Thomas Spura 8afca25
Thomas Spura 8afca25
%check
Thomas Spura 8afca25
# test openmpi?
Thomas Spura 8afca25
%if 0%{?OPENMPI}
Thomas Spura 8afca25
%{_openmpi_load}
Thomas Spura 8afca25
pushd openmpi_build
Thomas Spura 136457d
make check || cat testsuite/runtest.log || :
Thomas Spura 8afca25
popd
Thomas Spura 8afca25
%{_openmpi_unload}
Thomas Spura 8afca25
%endif
Thomas Spura 8afca25
Deji Akingunola a46525b
# test mpich?
Deji Akingunola a46525b
%if 0%{?MPICH}
Deji Akingunola a46525b
%{_mpich_load}
Deji Akingunola a46525b
pushd mpich_build
Thomas Spura 136457d
make check || cat testsuite/runtest.log || :
Thomas Spura 8afca25
popd
Deji Akingunola a46525b
%{_mpich_unload}
Thomas Spura 8afca25
%endif
Thomas Spura 8afca25
Thomas Spura 8afca25
%files common
786824f
%doc AUTHORS README NEWS ChangeLog
786824f
%license COPYING
Thomas Spura 8afca25
786824f
%files devel
786824f
%{_libdir}/*/lib/lib*.so
Thomas Spura 8afca25
786824f
%files -n python2-%{name}-openmpi
786824f
%{_libdir}/openmpi/lib/lib*.so.*
786824f
%{python_sitearch}/openmpi/%{name}md
Thomas Spura 8afca25
786824f
%files -n python2-%{name}-mpich
786824f
%{_libdir}/mpich/lib/lib*.so.*
786824f
%{python_sitearch}/mpich/%{name}md
Thomas Spura 8afca25
Thomas Spura 8afca25
%changelog
786824f
* Thu Feb 16 2017 Christoph Junghans <junghans@votca.org> - 4.0-0.1.20170220git7a9ac74
786824f
- Bump to version 4.0 git version
786824f
- Drop cypthon patch, incl. upstream
786824f
- Add 1042.patch from upstream
786824f
cbe0465
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.0-11
cbe0465
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
cbe0465
Orion Poplawski 13b7c24
* Fri Oct 21 2016 Orion Poplawski <orion@cora.nwra.com> - 3.3.0-10
Orion Poplawski 13b7c24
- Rebuild for openmpi 2.0
Orion Poplawski 13b7c24
5efb3f9
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.0-9
5efb3f9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
5efb3f9
Orion Poplawski 5ad7b7f
* Tue Sep 15 2015 Orion Poplawski <orion@cora.nwra.com> - 3.3.0-8
Orion Poplawski 5ad7b7f
- Rebuild for openmpi 1.10.0
Orion Poplawski 5ad7b7f
77e013f
* Sat Aug 15 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.3.0-7
77e013f
- Rebuild for MPI provides
77e013f
647ba69
* Sun Jul 26 2015 Sandro Mani <manisandro@gmail.com> - 3.3.0-6
647ba69
- Rebuild for RPM MPI Requires Provides Change
647ba69
55d85b5
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.0-5
55d85b5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
55d85b5
fb34985
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 3.3.0-4
fb34985
- Rebuilt for GCC 5 C++11 ABI change
fb34985
Thomas Spura 808fcf2
* Thu Mar 12 2015 Thomas Spura <tomspur@fedoraproject.org> - 3.3.0-3
Thomas Spura 808fcf2
- Rebuild for changed mpich libraries
Thomas Spura 8068826
- Added patch for building with cython-0.22
Thomas Spura 481c1d4
- Remove group tag
Thomas Spura 808fcf2
41ef0bb
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.0-2
41ef0bb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
41ef0bb
Thomas Spura dd56092
* Mon Aug 11 2014 Thomas Spura <tomspur@fedoraproject.org> - 3.3.0-1
Thomas Spura dd56092
- update to 3.3.0
Thomas Spura dd56092
732f86d
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.0-4
732f86d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
732f86d
Thomas Spura 5fc8faf
* Wed May 28 2014 Thomas Spura <tomspur@fedoraproject.org> - 3.2.0-3
Thomas Spura 5fc8faf
- Rebuilt for https://fedoraproject.org/wiki/Changes/f21tcl86
Thomas Spura 5fc8faf
Thomas Spura 1ee6a4b
* Sun May 25 2014 Thomas Spura <tomspur@fedoraproject.org> - 3.2.0-2
Thomas Spura 1ee6a4b
- run autoreconf in %%build to support aarch64
Thomas Spura 1ee6a4b
Thomas Spura e0fad53
* Sat May 24 2014 Thomas Spura <tomspur@fedoraproject.org> - 3.2.0-1
Thomas Spura e0fad53
- update to 3.2.0
Thomas Spura e0fad53
b552013
* Wed May 21 2014 Jaroslav Å karvada <jskarvad@redhat.com> - 3.1.1-6
b552013
- Rebuilt for https://fedoraproject.org/wiki/Changes/f21tcl86
b552013
Deji Akingunola c33f149
* Sat Feb 22 2014 Deji Akingunola <dakingun@gmail.com> - 3.1.1-5
Deji Akingunola c33f149
- Rebuild for mpich-3.1
Deji Akingunola c33f149
79e3b4c
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.1-4
79e3b4c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
79e3b4c
Deji Akingunola a46525b
* Sat Jul 20 2013 Deji Akingunola <dakingun@gmail.com> - 3.1.1-3
Deji Akingunola a46525b
- Rename mpich2 sub-packages to mpich and rebuild for mpich-3.0
Deji Akingunola a46525b
be2624e
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.1-2
be2624e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
be2624e
Thomas Spura 136457d
* Wed Nov 14 2012 Thomas Spura <tomspur@fedoraproject.org> - 3.1.1-1
Thomas Spura 136457d
- rebuild for newer mpich2
Thomas Spura 136457d
- update to new version
Thomas Spura 136457d
- disable tk per upstream request
Thomas Spura 136457d
- drop patch
Thomas Spura 136457d
3ae5ab2
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.2-4
3ae5ab2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
3ae5ab2
3b2e841
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.2-3
3b2e841
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
3b2e841
Thomas Spura 8afca25
* Wed Oct 26 2011 Thomas Spura <tomspur@fedoraproject.org> - 3.0.2-2
Thomas Spura 8afca25
- add missing BR autoconf/automake
Thomas Spura 8afca25
- use _isa where possible
Thomas Spura 8afca25
- use general tclsh shebang
Thomas Spura 8afca25
- build --with-tk
Thomas Spura 8afca25
Thomas Spura 8afca25
* Thu Oct  6 2011 Thomas Spura <tomspur@fedoraproject.org> - 3.0.2-1
Thomas Spura 8afca25
- update to new version
Thomas Spura 8afca25
- introduce configure_mpi
Thomas Spura 8afca25
Thomas Spura 8afca25
* Sun Sep 25 2011 Thomas Spura <tomspur@fedoraproject.org> - 3.0.1-3
Thomas Spura 8afca25
- use correct MPI_SUFFIX
Thomas Spura 8afca25
- don't install library as upstream doesn't support it anymore
Thomas Spura 8afca25
Thomas Spura 8afca25
* Sun Sep 25 2011 Thomas Spura <tomspur@fedoraproject.org> - 3.0.1-2
Thomas Spura 8afca25
- correctly install into _libdir/openmpi and not _libdir/name-openmpi
Thomas Spura 8afca25
Thomas Spura 8afca25
* Fri Sep 16 2011 Thomas Spura <tomspur@fedoraproject.org> - 3.0.1-1
Thomas Spura 8afca25
- initial packaging