From 55b18caf54c97f7f97383f5cedb81dbcad49393b Mon Sep 17 00:00:00 2001 From: Dave Love Date: Feb 18 2015 21:11:57 +0000 Subject: Initial import (#1107800). --- diff --git a/.gitignore b/.gitignore index e69de29..aa25ada 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/dl_class_1.9.tar.gz diff --git a/dl_poly-java.patch b/dl_poly-java.patch new file mode 100644 index 0000000..387e367 --- /dev/null +++ b/dl_poly-java.patch @@ -0,0 +1,293 @@ +--- dl_class_1.9/java/DataArchiver.java 2012-04-23 11:43:54.000000000 +0100 ++++ dl_class_1.9.old/java/DataArchiver.java 2012-04-20 10:17:59.000000000 +0100 +@@ -18,7 +18,7 @@ + public static DataArchiver job; + private static JButton select,store,fetch,info,close; + private static JTextField dirold,dirnew; +- private static JComboBox test; ++ private static JComboBox test; + private static String dname="DEFAULT"; + private static WarningBox danger; + +@@ -62,7 +62,7 @@ + + // Test case choice + +- test = new JComboBox(); ++ test = new JComboBox(); + test.setBackground(art.scrn); + test.setForeground(art.scrf); + test.addItem("TEST1"); +Binary files dl_class_1.9/java/GUI.jar and dl_class_1.9.old/java/GUI.jar differ +--- dl_class_1.9/java/HyperDyn.java 2012-04-11 14:10:18.000000000 +0100 ++++ dl_class_1.9.old/java/HyperDyn.java 2012-04-10 14:54:38.000000000 +0100 +@@ -19,7 +19,7 @@ + private static JTextField tebias,tvmin,target,block,black,tdelt; + private static JTextField ttlow,track,tcatch,spring,opttol,nnebs; + private static JTextField basin1,basin2; +- private static JComboBox hypopt,tunits,optkey; ++ private static JComboBox hypopt,tunits,optkey; + private static JCheckBox tgoneb,tpath; + private static JButton close; + +@@ -58,7 +58,7 @@ + // Hyperdynamics options + + fix(new JLabel("Hyperdynamics options:",JLabel.LEFT),grd,gbc,0,n,2,1); +- hypopt = new JComboBox(); ++ hypopt = new JComboBox(); + hypopt.setForeground(art.scrf); + hypopt.setBackground(art.scrn); + hypopt.addItem("BPD"); +@@ -72,7 +72,7 @@ + // Energy units + + fix(new JLabel("Energy Units:",JLabel.LEFT),grd,gbc,0,n,2,1); +- tunits = new JComboBox(); ++ tunits = new JComboBox(); + tunits.setForeground(art.scrf); + tunits.setBackground(art.scrn); + tunits.addItem("DL_POLY"); +@@ -93,7 +93,7 @@ + // Minimisation control option + + fix(new JLabel("Minimise Option:",JLabel.LEFT),grd,gbc,0,n,2,1); +- optkey = new JComboBox(); ++ optkey = new JComboBox(); + optkey.setForeground(art.scrf); + optkey.setBackground(art.scrn); + optkey.addItem("Force"); +--- dl_class_1.9/java/MakeCeramField.java 2012-04-11 14:10:18.000000000 +0100 ++++ dl_class_1.9.old/java/MakeCeramField.java 2012-04-10 14:50:57.000000000 +0100 +@@ -17,7 +17,7 @@ + public static MakeCeramField job; + private static GUI home; + private static String ffield; +- private static JComboBox cpot; ++ private static JComboBox cpot; + private static JButton make,load,close; + private static JCheckBox display,tetra; + private static JLabel lab1,pad; +@@ -72,7 +72,7 @@ + + lab1 = new JLabel("Force field :",JLabel.LEFT); + fix(lab1,grd,gbc,0,2,1,1); +- cpot = new JComboBox(); ++ cpot = new JComboBox(); + cpot.setBackground(art.scrn); + cpot.setForeground(art.scrf); + cpot.addItem("LC_a"); +--- dl_class_1.9/java/MakeChain.java 2012-04-11 14:10:18.000000000 +0100 ++++ dl_class_1.9.old/java/MakeChain.java 2012-04-10 14:50:57.000000000 +0100 +@@ -22,7 +22,7 @@ + private static JLabel lab1,lab2,lab3,lab4,lab5,pass; + private static JTextField nc,area,eon,gapz; + private static JCheckBox chk1,chk2; +- private static JComboBox head; ++ private static JComboBox head; + private static boolean flip,twin; + private static String headgroup; + private static int keyhed,ncarbons,nethos; +@@ -108,7 +108,7 @@ + + // Head group choice + +- head = new JComboBox(); ++ head = new JComboBox(); + head.setBackground(art.scrn); + head.setForeground(art.scrf); + head.addItem("None"); +--- dl_class_1.9/java/MakeDreiField.java 2012-04-11 14:10:19.000000000 +0100 ++++ dl_class_1.9.old/java/MakeDreiField.java 2012-04-10 14:50:57.000000000 +0100 +@@ -16,7 +16,7 @@ + */ + public static MakeDreiField job; + private static GUI home; +- private static JComboBox bond,vdwt; ++ private static JComboBox bond,vdwt; + private static JButton make,load,close; + private static JCheckBox charges; + private static JLabel lab1,lab2,pad1,pad2,pad3; +@@ -79,7 +79,7 @@ + + lab1 = new JLabel("Bond type :",JLabel.LEFT); + fix(lab1,grd,gbc,0,2,1,1); +- bond = new JComboBox(); ++ bond = new JComboBox(); + bond.setBackground(art.scrn); + bond.setForeground(art.scrf); + bond.addItem("Harmonic"); +@@ -91,7 +91,7 @@ + + lab2 = new JLabel("VDW type :",JLabel.LEFT); + fix(lab2,grd,gbc,0,3,1,1); +- vdwt = new JComboBox(); ++ vdwt = new JComboBox(); + vdwt.setBackground(art.scrn); + vdwt.setForeground(art.scrf); + vdwt.addItem("Len-Jones"); +--- dl_class_1.9/java/MakeTable.java 2012-04-11 14:10:19.000000000 +0100 ++++ dl_class_1.9.old/java/MakeTable.java 2012-04-10 14:50:57.000000000 +0100 +@@ -22,7 +22,7 @@ + static int npnts,numtab,ngrid,keytab,keyfit,mxpnts; + static JTextField atom1,atom2,gridp,cutoff,xval,yval,points; + static JButton make,load,close,enter,clear; +- static JComboBox units,fitopt,special; ++ static JComboBox units,fitopt,special; + static String[] header; + + // Define the Graphical User Interface +@@ -147,7 +147,7 @@ + + // Energy units required + +- units = new JComboBox(); ++ units = new JComboBox(); + units.setBackground(art.scrn); + units.setForeground(art.scrf); + units.addItem("DL_POLY"); +@@ -164,7 +164,7 @@ + + // Energy units required + +- fitopt = new JComboBox(); ++ fitopt = new JComboBox(); + fitopt.setBackground(art.scrn); + fitopt.setForeground(art.scrf); + fitopt.addItem("SPLINE"); +@@ -178,7 +178,7 @@ + + // Special potential functions + +- special = new JComboBox(); ++ special = new JComboBox(); + special.setBackground(art.scrn); + special.setForeground(art.scrf); + special.addItem("None"); +--- dl_class_1.9/java/ProVar.java 2012-04-11 14:10:20.000000000 +0100 ++++ dl_class_1.9.old/java/ProVar.java 2012-04-10 14:54:38.000000000 +0100 +@@ -16,7 +16,7 @@ + */ + private static MakeControl home; + private static ProVar job; +- private static JComboBox restopt,algorithm; ++ private static JComboBox restopt,algorithm; + private static JTextField tnstrun,tnsteql,tmult,tnstbpo,tnstack,tintsta,tewltol,tshktol,tqtntol; + private static JTextField tjobtim,ttclose; + private static JButton close; +@@ -55,7 +55,7 @@ + // Restart option + + fix(new JLabel("Algorithm",JLabel.LEFT),grd,gbc,0,n,2,1); +- algorithm = new JComboBox(); ++ algorithm = new JComboBox(); + algorithm.setBackground(art.scrn); + algorithm.setForeground(art.scrf); + algorithm.addItem("Leapfrog Verlet"); +@@ -153,7 +153,7 @@ + // Restart option + + fix(new JLabel("Restart option",JLabel.LEFT),grd,gbc,0,n,2,1); +- restopt = new JComboBox(); ++ restopt = new JComboBox(); + restopt.setBackground(art.scrn); + restopt.setForeground(art.scrf); + restopt.addItem("NONE"); +--- dl_class_1.9/java/RadDam.java 2012-04-11 14:10:20.000000000 +0100 ++++ dl_class_1.9.old/java/RadDam.java 2012-04-10 14:54:38.000000000 +0100 +@@ -19,7 +19,7 @@ + private static JTextField tdstart,tdintval,tdefcut,tatom,timpstp,tenergy,tvect1; + private static JTextField tvect2,tvect3,tvarstp,tmindis,tmaxdis,tnstmsdtmp; + private static JTextField timsdtmp,tthick,tptemp; +- private static JComboBox pseudtyp; ++ private static JComboBox pseudtyp; + private static JButton close; + private static JCheckBox bldefects,blvarstp,blmsdtmp,blpseudo; + +@@ -158,7 +158,7 @@ + blpseudo.setForeground(art.fore); + blpseudo.setBackground(art.back); + fix(blpseudo,grd,gbc,0,n++,2,1); +- pseudtyp = new JComboBox(); ++ pseudtyp = new JComboBox(); + pseudtyp.setBackground(art.scrn); + pseudtyp.setForeground(art.scrf); + pseudtyp.addItem(" "); +--- dl_class_1.9/java/Solvat.java 2012-04-11 14:10:20.000000000 +0100 ++++ dl_class_1.9.old/java/Solvat.java 2012-04-10 14:54:38.000000000 +0100 +@@ -18,7 +18,7 @@ + private static JTextField tstart,tintvl,tlambda,tnonlin; + private static JTextField systema,systemb,tswtch; + private static JCheckBox remass; +- private static JComboBox solkey,mixkey; ++ private static JComboBox solkey,mixkey; + private static JButton close; + + +@@ -56,7 +56,7 @@ + // Select solvation option + + fix(new JLabel("Choose solvation option:",JLabel.LEFT),grd,gbc,0,n,2,1); +- solkey = new JComboBox(); ++ solkey = new JComboBox(); + solkey.setForeground(art.scrf); + solkey.setBackground(art.scrn); + solkey.addItem("Decompose"); +@@ -100,7 +100,7 @@ + // Mixing function selction + + fix(new JLabel("Free Energy Mixing Function:",JLabel.LEFT),grd,gbc,0,n,2,1); +- mixkey = new JComboBox(); ++ mixkey = new JComboBox(); + mixkey.setForeground(art.scrf); + mixkey.setBackground(art.scrn); + mixkey.addItem("Linear"); +--- dl_class_1.9/java/StatProp.java 2012-04-11 14:10:20.000000000 +0100 ++++ dl_class_1.9.old/java/StatProp.java 2012-04-10 14:50:57.000000000 +0100 +@@ -17,7 +17,7 @@ + public static StatProp job; + private static GUI home; + private static String prop; +- private static JComboBox property; ++ private static JComboBox property; + private static int npnts,keyprp,nstart; + private static JTextField statis,start,selection; + private static JButton run,close; +@@ -81,7 +81,7 @@ + // Choice of ensemble + + fix(new JLabel(" Property: ",JLabel.RIGHT),grd,gbc,0,n,1,1); +- property = new JComboBox(); ++ property = new JComboBox(); + property.setBackground(art.scrn); + property.setForeground(art.scrf); + property.addItem("E-TOT"); +--- dl_class_1.9/java/SysVar.java 2012-04-11 14:10:20.000000000 +0100 ++++ dl_class_1.9.old/java/SysVar.java 2012-04-10 14:54:38.000000000 +0100 +@@ -16,7 +16,7 @@ + */ + private static MakeControl home=null; + private static SysVar job=null; +- private static JComboBox ensemble,electro; ++ private static JComboBox ensemble,electro; + private static JTextField ttemp,tpress,ttstep,trcut,tdelr,trvdw,trprim,tepsq,ttaut,ttaup,tgamt; + private static JButton close; + +@@ -142,7 +142,7 @@ + // Choice of ensemble + + fix(new JLabel("Ensemble.............",JLabel.LEFT),grd,gbc,0,n,1,1); +- ensemble = new JComboBox(); ++ ensemble = new JComboBox(); + ensemble.setBackground(art.scrn); + ensemble.setForeground(art.scrf); + ensemble.addItem("NVE"); +@@ -173,7 +173,7 @@ + // Choice of electrostatics + + fix(new JLabel("Electrostatics.......",JLabel.LEFT),grd,gbc,0,n,1,1); +- electro = new JComboBox(); ++ electro = new JComboBox(); + electro.setBackground(art.scrn); + electro.setForeground(art.scrf); + electro.addItem("NONE"); diff --git a/dl_poly-javaexec.patch b/dl_poly-javaexec.patch new file mode 100644 index 0000000..5acd8e0 --- /dev/null +++ b/dl_poly-javaexec.patch @@ -0,0 +1,11 @@ +--- dl_class_1.9/java/Basic.java~ 2012-04-23 11:43:54.000000000 +0100 ++++ dl_class_1.9/java/Basic.java 2014-06-17 23:08:13.531793300 +0100 +@@ -51,7 +51,7 @@ + public static final int MXATMS=100; + public static final int MXJOIN=100; + public static String ftype=null; +- public static String defaultexecutable="./DLPOLY.X"; ++ public static String defaultexecutable="/usr/bin/dl_poly"; + public static String executable=null; + public static Font fontMain; + public static boolean perspective=true; diff --git a/dl_poly-makefile b/dl_poly-makefile new file mode 100644 index 0000000..01419b8 --- /dev/null +++ b/dl_poly-makefile @@ -0,0 +1,16 @@ +# assume unrolling is good, as usual +FFLAGS = -O2 -ffast-math -funroll-loops $(NATIVE) + +ifeq ($(PAR),1) +TYPE = par +include ../build/MakePAR +build: + $(MAKE) FC=mpif90 LD="mpif90 -o" FFLAGS="-c $(FFLAGS)" \ + EX=$(EX) BINROOT=$(BINROOT) par +else +TYPE = seq +include ../build/MakeSEQ +build: + $(MAKE) FC=gfortran LD="gfortran -o" FFLAGS="-c $(FFLAGS)" \ + EX=$(EX) BINROOT=$(BINROOT) seq +endif diff --git a/dl_poly.desktop b/dl_poly.desktop new file mode 100644 index 0000000..0c07f1a --- /dev/null +++ b/dl_poly.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=dl_poly +GenericName=GUI for dl_poly molecular dynamics program +Exec=dl_poly_gui +Type=Application +Categories=Chemistry;Biology; +Terminal=false diff --git a/dl_poly.spec b/dl_poly.spec new file mode 100644 index 0000000..78bff62 --- /dev/null +++ b/dl_poly.spec @@ -0,0 +1,224 @@ +# Copyright (c) 2013, 2014 Dave Love, Liverpool University +# The licence for this file is as for the package itself. + +# fixme: look at shipping the example/benchmark data (~ 40MB) + +# Maybe build with -march=native +%bcond_with native + +Name: dl_poly +Version: 1.9.20140324 +Release: 7%{?dist} +Summary: General purpose classical molecular dynamics (MD) simulation +License: BSD +URL: http://www.ccp5.ac.uk/DL_POLY_CLASSIC/ +# NB, the numbers in this URL change when it's updated, but the version doesn't +Source0: http://ccpforge.cse.rl.ac.uk/gf/download/frsrelease/255/4726/dl_class_1.9.tar.gz +Source1: dl_poly-makefile +Source2: dl_poly.desktop +# The current version won't build on EPEL or Fedora without backing out +# this change made against an older tarball. +Patch1: dl_poly-java.patch +# Default to the serial executable +Patch2: dl_poly-javaexec.patch +BuildRequires: gcc-gfortran, makedepf90, java-devel +BuildRequires: openmpi-devel, mpich-devel, desktop-file-utils +Requires: %{name}-common = %{version}-%{release} +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +%global base_description \ +DL_POLY Classic is a general purpose molecular dynamics simulation\ +package developed at Daresbury Laboratory by W. Smith, T.R. Forester\ +and I.T. Todorov. It is based on the package DL_POLY_2, which was\ +originally developed by the Computational Chemistry Group, (CCG) at\ +Daresbury Laboratory under the auspices of the Engineering and\ +Physical Sciences Research Council (EPSRC) for (CCP5), the EPSRC's\ +Collaborative Computational Project for the Computer Simulation of\ +Condensed Phases.\ +\ +DL_POLY Classic can be executed as a serial or a parallel application.\ +The code achieves parallelisation using the Replicated Data strategy\ +which is suitable for homogeneous, distributed-memory, parallel\ +computers. The code is useful for simulations of up to 30,000 atoms\ +with good parallel performance on up to 100 processors, though in some\ +circumstances it can exceed or fail to reach these limits.\ +\ +Reference: I.T. Todorov, W. Smith, K. Trachenko & M.T. Dove,\ +Journal of Materials Chemistry, (2006) 16, 1911-1918 + +%description +%{base_description} + +This is a serial version. + +%package common +Summary: General purpose classical molecular dynamics (MD) simulation - common files +BuildArch: noarch + +%description common +Common files for %name. +This package contains, principally the "utility" source and data files. + +%package doc +Summary: Documentation for %name and %{name}-gui +BuildArch: noarch + +%description doc +Documentation for %{name} and %{name}-gui. + +%package openmpi +Summary: General purpose classical molecular dynamics (MD) simulation - openmpi version +Requires: openmpi%{_isa}, %{name}-common = %{version}-%{release} + +%description openmpi +%{base_description} + +This is a parallel version using openmpi. + +%package mpich +Summary: General purpose classical molecular dynamics (MD) simulation - mpich version +Requires: mpich%{_isa}, %{name}-common = %{version}-%{release} + +%description mpich +%{base_description} + +This is a parallel version using mpich. + +%package gui +Summary: GUI for %name +Requires: java >= 1:1.6, jpackage-utils +BuildArch: noarch + +%description gui +This package provides the Java-based graphical user interface for %name. + +%prep +%setup -q -n dl_class_1.9 +rm java/GUI.jar +cp %{SOURCE1} source/Makefile + +%patch1 -p1 +%patch2 -p1 + +%build +%if %{with native} +%global native NATIVE=-march=native +%else +%global native NATIVE= +%endif + +%global dobuild \ +mkdir $MPI_COMPILER;\ +make %{?_smp_mflags} build PAR=1 FFLAGS="-c %{optflags}" %{native};\ +mv ../execute/DLPOLY.X $MPI_COMPILER/%{name}$MPI_SUFFIX + +cd source +makedepf90 *.f >>Makefile +mkdir single +make %{?_smp_mflags} build PAR=0 %{native} +mv ../execute/DLPOLY.X single/%{name} + +%{_openmpi_load} +%{dobuild} +%{_openmpi_unload} + +%{_mpich_load} +%{dobuild} +%{_mpich_unload} + +cd ../java +sh build +cat <<+ >%{name}_gui +#!/bin/sh +exec java -jar %{_javadir}/DL_POLY_GUI.jar ++ +cd .. +cat <<+ >README.running +Use the environment modules command + module load -%{_arch} +to put the %{name}_ parallel executable on your path, +where may be openmpi or mpich. In a batch job You may +need to source /etc/profile.d/modules.sh or /etc/profile.d/modules.csh +first. +The serial version is available directly as %{name}. ++ + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/%{_libdir}/mpich/bin +mkdir -p $RPM_BUILD_ROOT%{_javadir} $RPM_BUILD_ROOT%_datadir/%name +mkdir -p $RPM_BUILD_ROOT%{_bindir} +install source/single/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name} +mkdir -p $RPM_BUILD_ROOT/%{_libdir}/openmpi/bin +install source/openmpi*/%{name}_* $RPM_BUILD_ROOT%{_libdir}/openmpi/bin +install source/mpich*/%{name}_* $RPM_BUILD_ROOT%{_libdir}/mpich/bin +cp data/README README.data +chmod 644 utility/dl2xyz +cp -a utility $RPM_BUILD_ROOT%{_datadir}/%{name} +install java/GUI.jar $RPM_BUILD_ROOT%{_javadir}/DL_POLY_GUI.jar +install -m 755 java/%{name}_gui $RPM_BUILD_ROOT%{_bindir} +chmod 644 LICENCE.pdf manual/JavaGUI.pdf +desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE2} + +%clean +rm -rf $RPM_BUILD_ROOT + +%check +# would depend on shipping the data files per fixme above + +%files +%{_bindir}/%{name} + +%files common +%doc README.data README LICENCE.pdf +%{_datadir}/%{name} + +%files doc +%doc manual/USRMAN.pdf manual/JavaGUI.pdf + +%files gui +%{_javadir}/DL_POLY_GUI.jar +%{_bindir}/%{name}_gui +%doc README LICENCE.pdf +%{_datadir}/applications/* + +%files openmpi +%{_libdir}/openmpi/bin/* + +%files mpich +%{_libdir}/mpich/bin/* + +%changelog +* Wed Feb 11 2015 Dave Love - 1.9.20140324-7 +- Remove _isa on -common and java requires + +* Tue Feb 10 2015 Dave Love - 1.9.20140324-6 +- Add _isa suffix to requires +- Use %%global, not %%define + +* Fri Feb 6 2015 Dave Love - 1.9.20140324-5 + From review: +- Remove bundled .jar +- Change buildroot to the preferred form +- Add desktop file +- Zap %%defattr +- Use %%optflags (sigh) + +* Thu Dec 11 2014 Dave Love - 1.9.20140324-4 +- Drop EPEL5 for now + +* Fri Nov 21 2014 Dave Love - 1.9.20140324-3 +- Adjust for mpich3 on EPEL6 + +* Sun Jul 27 2014 Dave Love - 1.9.20140324-2 +- Add doc package +- Add jpackage-utils dependency for gui +- Remove Group tags + +* Thu Jun 5 2014 Dave Love - 1.9.20140324-1 +- Build serial and mpich packages as well as openmpi, for Fedora +- Make common and gui packages +- Use updated tarball (which has the same version number) + +* Fri Oct 11 2013 Dave Love - 1.9-1 +- Initial packaging diff --git a/sources b/sources index e69de29..6c0cdc2 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +66e40eccc6d3f696c8e3654b5dd2de54 dl_class_1.9.tar.gz