diff --git a/.gitignore b/.gitignore index 9a3b73e..8d0fee8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ /espresso-3.1.1.tar.gz /espresso-3.2.0.tar.gz /espresso-3.3.0.tar.gz +/espresso-7a9ac7414721b40d7d4eaf286b5ae6c18e28f325.tar.gz +/*.src.rpm diff --git a/1042.patch b/1042.patch new file mode 100644 index 0000000..ea0c067 --- /dev/null +++ b/1042.patch @@ -0,0 +1,26 @@ +From cf4a369485736b7a901fa02bbc911f8d5dddab6a Mon Sep 17 00:00:00 2001 +From: Christoph Junghans +Date: Tue, 21 Feb 2017 17:56:55 -0700 +Subject: [PATCH] cmake: allow user to override PYTHON_INSTDIR + +--- + CMakeLists.txt | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c6ba209..88de171 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -115,9 +115,11 @@ if (WITH_PYTHON) + -c "import distutils.sysconfig as cg; print(cg.get_python_inc())" + OUTPUT_VARIABLE PYTHON_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE) + find_package(NumPy REQUIRED) +- execute_process(COMMAND ${PYTHON_EXECUTABLE} ++ if(NOT PYTHON_INSTDIR) ++ execute_process(COMMAND ${PYTHON_EXECUTABLE} + -c "import distutils.sysconfig as cg; print(cg.get_python_lib(1,0,prefix='${CMAKE_INSTALL_EXEC_PREFIX}'))" + OUTPUT_VARIABLE PYTHON_INSTDIR OUTPUT_STRIP_TRAILING_WHITESPACE) ++ endif(NOT PYTHON_INSTDIR) + if(PYTHON_VERSION_MAJOR EQUAL 2) + set(CYTHON_FLAGS "-2" CACHE STRING "Flags used by the Cython compiler during all build types.") + else() diff --git a/espresso-cython-022.patch b/espresso-cython-022.patch deleted file mode 100644 index b362668..0000000 --- a/espresso-cython-022.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 9e6caa3294b0f5f377c16550a07429b73c871ac3 Mon Sep 17 00:00:00 2001 -From: Christoph Junghans -Date: Thu, 12 Mar 2015 08:55:51 -0600 -Subject: [PATCH] fix build with cython-0.22 - ---- - src/python/espressomd/particle_data.pxd | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/python/espressomd/particle_data.pxd b/src/python/espressomd/particle_data.pxd -index fff022b..4cc39e8 100644 ---- a/src/python/espressomd/particle_data.pxd -+++ b/src/python/espressomd/particle_data.pxd -@@ -185,5 +185,5 @@ cdef class ParticleHandle(object): - cdef public int id - cdef bint valid - cdef Particle particleData -- cdef int updateParticleData(self) -+ cdef int updateParticleData(self) except -1 - diff --git a/espresso-install-fix.patch b/espresso-install-fix.patch deleted file mode 100644 index 51560dd..0000000 --- a/espresso-install-fix.patch +++ /dev/null @@ -1,30 +0,0 @@ -commit cc30e3c19f92c93481e751ad1e669e342cacff22 -Author: Christoph Junghans -Date: Mon Sep 19 16:16:38 2011 +0200 - - fixed install issue related to name transformation - -diff --git a/Makefile.am b/Makefile.am -index 988481b..1e64a09 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -40,14 +40,16 @@ Espresso_install_CPPFLAGS = -D 'ESPRESSO_SCRIPTS_DEFAULT="$(scriptsdir)"' - Espresso_install_SOURCES = src/scriptsdir.c src/main.c - Espresso_install_LDADD = src/libEspresso.a - -+ESPRESSO = `echo Espresso | sed '$(transform)'`$(EXEEXT) -+ESPRESSO_INSTALL = `echo Espresso.install | sed '$(transform)'`$(EXEEXT) - # rename Espresso after installation - install-exec-hook: - $(am__mv) \ -- $(DESTDIR)$(bindir)/Espresso.install \ -- $(DESTDIR)$(bindir)/Espresso -+ $(DESTDIR)$(bindir)/$(ESPRESSO_INSTALL) \ -+ $(DESTDIR)$(bindir)/$(ESPRESSO) - - uninstall-local: -- -rm -f $(DESTDIR)$(bindir)/Espresso -+ -rm -f $(DESTDIR)$(bindir)/$(ESPRESSO) - - - ################################################################# diff --git a/espresso.spec b/espresso.spec index 3e3a768..e50b1f8 100644 --- a/espresso.spec +++ b/espresso.spec @@ -1,14 +1,13 @@ +%global git 1 +%global commit 7a9ac7414721b40d7d4eaf286b5ae6c18e28f325 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + %if 0%{?fedora} > 12 || 0%{?rhel} > 6 %global with_python3 1 %else %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %endif -# Define a macro for calling ../configure instead of ./configure -%global dconfigure %(printf %%s '%configure' | sed 's!\./configure!../configure!g') -# transform proper bindir -%global dconfigure_mpi %(printf %%s '%dconfigure' | sed 's!/usr/bin!$MPI_BIN!g') - ### TESTSUITE ### # The testsuite currently fails only on the buildsystem, but works localy. # So to easy enable/disable the testsuite, I introduce the following @@ -20,28 +19,33 @@ %global OPENMPI 0 Name: espresso -Version: 3.3.0 -Release: 11%{?dist} +Version: 4.0 +Release: 0.1.20170220git%{shortcommit}%{?dist} Summary: Extensible Simulation Package for Research on Soft matter License: GPLv3+ URL: http://espressomd.org +%if %{git} +Source0: https://github.com/%{name}md/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz +%else Source0: http://download.savannah.gnu.org/releases/espressomd/espresso-%{version}.tar.gz -# upstream commit from https://github.com/espressomd/espresso/pull/214 -Patch0: espresso-cython-022.patch -# run autoreconf for aarch64 support -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: libtool +%endif +# PATCH-FIX-UPSTREAM - 1042.patch - allow user to override PYTHON_INSTDIR +Patch0: https://patch-diff.githubusercontent.com/raw/espressomd/espresso/pull/1042.patch + +BuildRequires: cmake BuildRequires: Cython BuildRequires: fftw-devel BuildRequires: numpy BuildRequires: python-devel -BuildRequires: tcl-devel +BuildRequires: boost-devel +BuildRequires: mpich-devel +BuildRequires: boost-mpich-devel +BuildRequires: openmpi-devel +BuildRequires: boost-openmpi-devel Requires: numpy - Requires: %{name}-common = %{version}-%{release} %description @@ -63,14 +67,28 @@ ESPResSo contains a number of advanced algorithms, e.g. * DPD thermostat (for hydrodynamics) * P3M, MMM2D, MMM1D, ELC for electrostatic interactions * Lattice-Boltzmann for hydrodynamics -This package contains the license file and data files shard between the +This package contains the license file and data files shared between the subpackages of %{name}. -%package openmpi -BuildRequires: openmpi-devel +%package devel +Summary: Development package for %{name} packages +Requires: python2-%{name}-openmpi = %{version}-%{release} +Requires: python2-%{name}-mpich = %{version}-%{release} +%description devel +ESPResSo can perform Molecular Dynamics simulations of bead-spring models +in various ensembles ((N,V,E), (N,V,T), and (N,p,T)). +ESPResSo contains a number of advanced algorithms, e.g. + * DPD thermostat (for hydrodynamics) + * P3M, MMM2D, MMM1D, ELC for electrostatic interactions + * Lattice-Boltzmann for hydrodynamics +This package contains the development libraries of %{name}. + +%package -n python2-%{name}-openmpi Requires: %{name}-common = %{version}-%{release} Summary: Extensible Simulation Package for Research on Soft matter -%description openmpi +Provides: %{name}-openmpi = %{version}-%{release} +Obsoletes: %{name}-openmpi < 3.3.0-12 +%description -n python2-%{name}-openmpi ESPResSo can perform Molecular Dynamics simulations of bead-spring models in various ensembles ((N,V,E), (N,V,T), and (N,p,T)). ESPResSo contains a number of advanced algorithms, e.g. @@ -81,13 +99,14 @@ ESPResSo contains a number of advanced algorithms, e.g. This package contains %{name} compiled against Open MPI. -%package mpich -BuildRequires: mpich-devel +%package -n python2-%{name}-mpich Requires: %{name}-common = %{version}-%{release} Summary: Extensible Simulation Package for Research on Soft matter Provides: %{name}-mpich2 = %{version}-%{release} Obsoletes: %{name}-mpich2 < 3.1.1-3 -%description mpich +Provides: %{name}-mpich = %{version}-%{release} +Obsoletes: %{name}-mpich < 3.3.0-12 +%description -n python2-%{name}-mpich ESPResSo can perform Molecular Dynamics simulations of bead-spring models in various ensembles ((N,V,E), (N,V,T), and (N,p,T)). ESPResSo contains a number of advanced algorithms, e.g. @@ -99,76 +118,70 @@ This package contains %{name} compiled against MPICH2. %prep +%if %{git} +%setup -q -n espresso-%{commit} +%else %setup -q +%endif %patch0 -p1 - -#sed -i 's/tclsh8\.4/tclsh/' tools/trace_memory.tcl - -mkdir openmpi_build mpich_build no_mpi - +find . -name "*.[ch]pp" -exec chmod -x {} \; +chmod -x AUTHORS COPYING README NEWS ChangeLog +mkdir openmpi_build mpich_build %build -autoreconf -fi -pushd no_mpi -export CC=gcc -export CXX=g++ -%dconfigure --enable-shared -make V=1 %{?_smp_mflags} -popd - -# Build parallel versions: set compiler variables to MPI wrappers -export CC=mpicc -export CXX=mpicxx +%global defopts \\\ + -DWITH_PYTHON=ON \\\ + -DWITH_TESTS=ON \\\ + -DWITH_SCAFACOS=ON \\\ + -DCMAKE_SKIP_RPATH:BOOL=ON \\\ + -DCMAKE_SKIP_BUILD_RPATH:BOOL=ON \\\ + -DINSTALL_PYPRESSO=OFF # Build OpenMPI version +#see #756141 to understand why MPI_C_LIBRARIES needs to be set %{_openmpi_load} pushd openmpi_build -%dconfigure_mpi --enable-shared --program-suffix=$MPI_SUFFIX -make V=1 %{?_smp_mflags} +%{cmake} \ + %{defopts} \ + -DLIBDIR=${MPI_LIB} \ + -DPYTHON_INSTDIR=${MPI_PYTHON2_SITEARCH} \ + -DMPI_C_LIBRARIES=${MPI_LIB}/libmpi.so \ + .. +%make_build popd %{_openmpi_unload} # Build mpich version %{_mpich_load} pushd mpich_build -%dconfigure_mpi --enable-shared --program-suffix=$MPI_SUFFIX -make V=1 %{?_smp_mflags} +%{cmake} \ + %{defopts} \ + -DLIBDIR=${MPI_LIB} \ + -DPYTHON_INSTDIR=${MPI_PYTHON2_SITEARCH} \ + -DMPI_C_LIBRARIES=${MPI_LIB}/libmpi.so \ + .. +%make_build popd %{_mpich_unload} - %install # first install mpi files and move around because MPI_SUFFIX above doesn't # work yet (will be fixed in a new version) %{_openmpi_load} pushd openmpi_build -make install DESTDIR=%{buildroot} +%make_install popd %{_openmpi_unload} %{_mpich_load} pushd mpich_build -make install DESTDIR=%{buildroot} +%make_install popd %{_mpich_unload} - - -pushd no_mpi -make install DESTDIR=%{buildroot} -popd - -#rm %{buildroot}%{_libdir}/libespressobf.a - -chmod +x %{buildroot}/usr/share/espresso/tools/trace_memory.py -chmod +x %{buildroot}/usr/share/espresso/tools/trace_memory.tcl -chmod +x %{buildroot}/usr/share/espresso/tools/set_features - +find %{buildroot}%{_prefix} -name "*.so" -exec chmod +x {} \; +find %{buildroot}%{_prefix} -name "gen_pxiconfig" -exec chmod +x {} \; %check -pushd no_mpi -make check || cat testsuite/runtest.log || : -popd - # test openmpi? %if 0%{?OPENMPI} %{_openmpi_load} @@ -187,22 +200,27 @@ popd %{_mpich_unload} %endif - %files common -%doc AUTHORS COPYING README NEWS ChangeLog doc/ug/ug.pdf -%{_datadir}/espresso/ +%doc AUTHORS README NEWS ChangeLog +%license COPYING -%files -%{_bindir}/Espresso +%files devel +%{_libdir}/*/lib/lib*.so -%files openmpi -%{_libdir}/openmpi/bin/Espresso_openmpi - -%files mpich -%{_libdir}/mpich/bin/Espresso_mpich +%files -n python2-%{name}-openmpi +%{_libdir}/openmpi/lib/lib*.so.* +%{python_sitearch}/openmpi/%{name}md +%files -n python2-%{name}-mpich +%{_libdir}/mpich/lib/lib*.so.* +%{python_sitearch}/mpich/%{name}md %changelog +* Thu Feb 16 2017 Christoph Junghans - 4.0-0.1.20170220git7a9ac74 +- Bump to version 4.0 git version +- Drop cypthon patch, incl. upstream +- Add 1042.patch from upstream + * Fri Feb 10 2017 Fedora Release Engineering - 3.3.0-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/sources b/sources index 2eb470f..3613eed 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -bb9b669ec9e0e6093e5e9d41bdb8aa89 espresso-3.3.0.tar.gz +SHA512 (espresso-7a9ac7414721b40d7d4eaf286b5ae6c18e28f325.tar.gz) = 78312193aea6dd61d9c7e8351d0d66922851f86b914bf9522aa1be9ec22543b9a2dd6e4e285d886f914886c5f0ebba968b7d8f6822b1dda523522abd656cc15a