7e46d68
# Copyright (c) 2013, 2014, 2015 Dave Love, Liverpool University
55b18ca
# The licence for this file is as for the package itself.
55b18ca
cdc1de9
# fixme: look at shipping example/benchmark data (~ 40MB total)
55b18ca
cdc1de9
# Allow -march=native if you want to rebuild
55b18ca
%bcond_with native
55b18ca
8c10471
%if 0%{?el6}
8c10471
%ifarch ppc64
8c10471
%bcond_with mpich
8c10471
%else
8c10471
%bcond_without mpich
8c10471
%endif
8c10471
%else
8c10471
%bcond_without mpich
8c10471
%endif
8c10471
55b18ca
Name:		dl_poly
cdc1de9
Version:	1.10
f2a8b4a
Release:	2%{?dist}
55b18ca
Summary:	General purpose classical molecular dynamics (MD) simulation
55b18ca
License:	BSD
cdc1de9
URL:		http://www.ccp5.ac.uk/DL_POLY_C/
55b18ca
# NB, the numbers in this URL change when it's updated, but the version doesn't
cdc1de9
Source0:	http://ccpforge.cse.rl.ac.uk/gf/download/frsrelease/574/8924/dl_class_1.10.tar.gz
55b18ca
Source1:	dl_poly-makefile
55b18ca
Source2:	dl_poly.desktop
cdc1de9
# Change executable
55b18ca
Patch2:		dl_poly-javaexec.patch
b39e9ea
BuildRequires:	gcc-gfortran java-devel openmpi-devel desktop-file-utils
8c10471
%if %{with mpich}
8c10471
BuildRequires:	mpich-devel
8c10471
%endif
55b18ca
Requires:	%{name}-common = %{version}-%{release}
55b18ca
55b18ca
%global base_description \
55b18ca
DL_POLY Classic is a general purpose molecular dynamics simulation\
55b18ca
package developed at Daresbury Laboratory by W. Smith, T.R. Forester\
55b18ca
and I.T. Todorov.  It is based on the package DL_POLY_2, which was\
55b18ca
originally developed by the Computational Chemistry Group, (CCG) at\
55b18ca
Daresbury Laboratory under the auspices of the Engineering and\
55b18ca
Physical Sciences Research Council (EPSRC) for (CCP5), the EPSRC's\
55b18ca
Collaborative Computational Project for the Computer Simulation of\
55b18ca
Condensed Phases.\
55b18ca
\
cdc1de9
DL_POLY Classic achieves parallelisation using the Replicated Data strategy\
55b18ca
which is suitable for homogeneous, distributed-memory, parallel\
55b18ca
computers.  The code is useful for simulations of up to 30,000 atoms\
55b18ca
with good parallel performance on up to 100 processors, though in some\
55b18ca
circumstances it can exceed or fail to reach these limits.\
55b18ca
\
55b18ca
Reference: I.T. Todorov, W. Smith, K. Trachenko & M.T. Dove,\
55b18ca
Journal of Materials Chemistry, (2006) 16, 1911-1918
55b18ca
55b18ca
%description
55b18ca
%{base_description}
55b18ca
55b18ca
%package common
55b18ca
Summary: General purpose classical molecular dynamics (MD) simulation - common files
55b18ca
BuildArch: noarch
55b18ca
55b18ca
%description common
55b18ca
Common files for %name.
55b18ca
This package contains, principally the "utility" source and data files.
55b18ca
55b18ca
%package doc
55b18ca
Summary: Documentation for %name and %{name}-gui
55b18ca
BuildArch: noarch
55b18ca
55b18ca
%description doc
55b18ca
Documentation for %{name} and %{name}-gui.
55b18ca
55b18ca
%package openmpi
55b18ca
Summary: General purpose classical molecular dynamics (MD) simulation - openmpi version
55b18ca
Requires: openmpi%{_isa}, %{name}-common = %{version}-%{release}
55b18ca
55b18ca
%description openmpi
55b18ca
%{base_description}
55b18ca
55b18ca
This is a parallel version using openmpi.
55b18ca
8c10471
%if %{with mpich}
55b18ca
%package mpich
55b18ca
Summary: General purpose classical molecular dynamics (MD) simulation - mpich version
55b18ca
Requires: mpich%{_isa}, %{name}-common = %{version}-%{release}
55b18ca
55b18ca
%description mpich
55b18ca
%{base_description}
55b18ca
55b18ca
This is a parallel version using mpich.
8c10471
%endif
55b18ca
55b18ca
%package gui
55b18ca
Summary: GUI for %name
580adaf
Requires: java, jpackage-utils
55b18ca
BuildArch: noarch
55b18ca
55b18ca
%description gui
55b18ca
This package provides the Java-based graphical user interface for %name.
55b18ca
55b18ca
%prep
cdc1de9
%setup -q -n dl_class_1.10
55b18ca
rm java/GUI.jar
55b18ca
cp %{SOURCE1} source/Makefile
55b18ca
55b18ca
%patch2 -p1
55b18ca
55b18ca
%build
cdc1de9
# Serial version no longer builds.  Reported to Bill Smith, but no fix
cdc1de9
# forthcoming.
55b18ca
%if %{with native}
55b18ca
%global native NATIVE=-march=native
55b18ca
%else
55b18ca
%global native NATIVE=
55b18ca
%endif
cdc1de9
echo %{build_cflags}
cdc1de9
# Parallel make fails.  Extra opt flags are from the original.
55b18ca
%global dobuild \
55b18ca
mkdir $MPI_COMPILER;\
cdc1de9
%make_build -j1 build PAR=1 %native; \
55b18ca
mv ../execute/DLPOLY.X $MPI_COMPILER/%{name}$MPI_SUFFIX
55b18ca
55b18ca
cd source
55b18ca
55b18ca
%{_openmpi_load}
55b18ca
%{dobuild}
55b18ca
%{_openmpi_unload}
cdc1de9
rm  basic_comms.o merge_tools.o pass_tools.o
cdc1de9
make clean
8c10471
%if %{with mpich}
55b18ca
%{_mpich_load}
55b18ca
%{dobuild}
55b18ca
%{_mpich_unload}
8c10471
%endif
55b18ca
55b18ca
cd ../java
55b18ca
sh build
55b18ca
cat <<+ >%{name}_gui
55b18ca
#!/bin/sh
55b18ca
exec java -jar %{_javadir}/DL_POLY_GUI.jar
55b18ca
+
55b18ca
cd ..
55b18ca
cat <<+ >README.running
55b18ca
Use the environment modules command
55b18ca
  module load <mpi>-%{_arch}
55b18ca
to put the %{name}_<mpi> parallel executable on your path,
55b18ca
where <mpi> may be openmpi or mpich.  In a batch job You may
55b18ca
need to source /etc/profile.d/modules.sh or /etc/profile.d/modules.csh
55b18ca
first.
55b18ca
+
55b18ca
55b18ca
%install
55b18ca
mkdir -p $RPM_BUILD_ROOT%{_javadir} $RPM_BUILD_ROOT%_datadir/%name
55b18ca
mkdir -p $RPM_BUILD_ROOT%{_bindir}
55b18ca
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/openmpi/bin
55b18ca
install source/openmpi*/%{name}_* $RPM_BUILD_ROOT%{_libdir}/openmpi/bin
8c10471
%if %{with mpich}
8c10471
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/mpich/bin
55b18ca
install source/mpich*/%{name}_* $RPM_BUILD_ROOT%{_libdir}/mpich/bin
8c10471
%endif
55b18ca
cp data/README README.data
55b18ca
chmod 644 utility/dl2xyz
55b18ca
cp -a utility $RPM_BUILD_ROOT%{_datadir}/%{name}
7e46d68
install -m 644 java/GUI.jar $RPM_BUILD_ROOT%{_javadir}/DL_POLY_GUI.jar
55b18ca
install -m 755 java/%{name}_gui $RPM_BUILD_ROOT%{_bindir}
55b18ca
chmod 644 LICENCE.pdf manual/JavaGUI.pdf
55b18ca
desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE2}
55b18ca
cdc1de9
55b18ca
%check
cdc1de9
# Would depend on shipping at least some data files, per fixme above
55b18ca
55b18ca
55b18ca
%files common
cdc1de9
%license LICENCE.pdf
cdc1de9
%doc README.data README
55b18ca
%{_datadir}/%{name}
55b18ca
55b18ca
%files doc
cdc1de9
%license LICENCE.pdf
55b18ca
%doc manual/USRMAN.pdf manual/JavaGUI.pdf
55b18ca
55b18ca
%files gui
cdc1de9
%license LICENCE.pdf
55b18ca
%{_javadir}/DL_POLY_GUI.jar
55b18ca
%{_bindir}/%{name}_gui
cdc1de9
%doc README
55b18ca
%{_datadir}/applications/*
55b18ca
55b18ca
%files openmpi
55b18ca
%{_libdir}/openmpi/bin/*
55b18ca
8c10471
%if %{with mpich}
55b18ca
%files mpich
55b18ca
%{_libdir}/mpich/bin/*
8c10471
%endif
8c10471
55b18ca
55b18ca
%changelog
f2a8b4a
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-2
f2a8b4a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
f2a8b4a
cdc1de9
* Mon Oct 29 2018 Dave Love <loveshack@fedoraproject.org> - 1.10-1
cdc1de9
- New version
cdc1de9
- Drop serial version, which no longer builds
cdc1de9
- Fix homepaage
cdc1de9
- Drop java patch
cdc1de9
- Improve optimization flags
cdc1de9
4d0e8d6
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.20140324-22
4d0e8d6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
4d0e8d6
380e939
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.20140324-21
380e939
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
380e939
d412947
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.20140324-20
d412947
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
d412947
ac69ddd
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.20140324-19
ac69ddd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
ac69ddd
f64cdff
* Sun Feb 05 2017 Kalev Lember <klember@redhat.com> - 1.9.20140324-18
f64cdff
- Rebuilt for libgfortran soname bump
f64cdff
Orion Poplawski 65a9bab
* Fri Oct 21 2016 Orion Poplawski <orion@cora.nwra.com> - 1.9.20140324-17
Orion Poplawski 65a9bab
- Rebuild for openmpi 2.0
Orion Poplawski 65a9bab
315f4f1
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.20140324-16
315f4f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
315f4f1
Orion Poplawski ecafedc
* Tue Sep 15 2015 Orion Poplawski <orion@cora.nwra.com> - 1.9.20140324-15
Orion Poplawski ecafedc
- Rebuild for openmpi 1.10.0
Orion Poplawski ecafedc
e28a259
* Sat Aug 15 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.9.20140324-14
e28a259
- Rebuild for MPI provides
e28a259
d649be8
* Mon Jul 27 2015 Sandro Mani <manisandro@gmail.com> - 1.9.20140324-13
d649be8
- Rebuild for RPM MPI Requires Provides Change
d649be8
e26a6a9
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.20140324-12
e26a6a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
e26a6a9
Dave Love ac24b79
* Wed Mar 18 2015 Dave Love <d.love@liverpool.ac.uk> - 1.9.20140324-11
Dave Love ac24b79
- Rebuild for mpich change
Dave Love ac24b79
580adaf
* Sun Feb 22 2015 Dave Love <d.love@liverpool.ac.uk> - 1.9.20140324-10
580adaf
- Drop java minimum version (for ppc64 el6)
580adaf
7e46d68
* Fri Feb 20 2015 Dave Love <d.love@liverpool.ac.uk> - 1.9.20140324-9
7e46d68
- Specify permissions for installed .jar
7e46d68
8c10471
* Thu Feb 19 2015 Dave Love <d.love@liverpool.ac.uk> - 1.9.20140324-8
8c10471
- Conditionalize out mpich on ppc64 el6
8c10471
55b18ca
* Wed Feb 11 2015 Dave Love <d.love@liverpool.ac.uk> - 1.9.20140324-7
55b18ca
- Remove _isa on -common and java requires
55b18ca
55b18ca
* Tue Feb 10 2015 Dave Love <d.love@liverpool.ac.uk> - 1.9.20140324-6
55b18ca
- Add _isa suffix to requires
55b18ca
- Use %%global, not %%define
55b18ca
55b18ca
* Fri Feb  6 2015 Dave Love <d.love@liverpool.ac.uk> - 1.9.20140324-5
55b18ca
  From review:
55b18ca
- Remove bundled .jar
55b18ca
- Change buildroot to the preferred form
55b18ca
- Add desktop file
55b18ca
- Zap %%defattr
55b18ca
- Use %%optflags (sigh)
55b18ca
55b18ca
* Thu Dec 11 2014 Dave Love <d.love@liverpool.ac.uk> - 1.9.20140324-4
55b18ca
- Drop EPEL5 for now
55b18ca
55b18ca
* Fri Nov 21 2014 Dave Love <d.love@liverpool.ac.uk> - 1.9.20140324-3
55b18ca
- Adjust for mpich3 on EPEL6
55b18ca
55b18ca
* Sun Jul 27 2014 Dave Love <d.love@liverpool.ac.uk> - 1.9.20140324-2
55b18ca
- Add doc package
55b18ca
- Add jpackage-utils dependency for gui
55b18ca
- Remove Group tags
55b18ca
55b18ca
* Thu Jun  5 2014 Dave Love <d.love@liverpool.ac.uk> - 1.9.20140324-1
55b18ca
- Build serial and mpich packages as well as openmpi, for Fedora
55b18ca
- Make common and gui packages
55b18ca
- Use updated tarball (which has the same version number)
55b18ca
55b18ca
* Fri Oct 11 2013 Dave Love <d.love@liverpool.ac.uk> - 1.9-1
55b18ca
- Initial packaging