From 6b281f56559cc62b5dad52f5313b4bd7040567a1 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Jun 05 2013 15:48:25 +0000 Subject: Initial import after review --- diff --git a/.gitignore b/.gitignore index e69de29..4633889 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,3 @@ +/*.tar.gz +/*.LHgrid +/*.LHpdf diff --git a/lhapdf-config.1 b/lhapdf-config.1 new file mode 100644 index 0000000..e0f63d2 --- /dev/null +++ b/lhapdf-config.1 @@ -0,0 +1,40 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.39.4. +.TH LHAPDF-CONFIG "1" "May 2011" "lhapdf-config" "User Commands" +.SH NAME +lhapdf-config \- script to get version number and compiler flags of the installed LHAPDF library +.SH SYNOPSIS +.B lhapdf-config +[[\fI--help|-h\fR] \fI| \fR[\fI--prefix\fR] \fI| \fR[\fI--pdfsets-path\fR]] +.SH DESCRIPTION +\fIlhapdf-config\fP is a tool that is used to configure to determine +the compiler and linker flags that should be used to compile +and link programs that use \fILHAPDF\fP. +.SH OPTIONS +.TP +\fB\-\-help\fR | \fB\-h\fR +: show this help message +.TP +\fB\-\-prefix\fR +: show the installation prefix (cf. autoconf) +.TP +\fB\-\-incdir\fR +: show the path to the LHAPDF header directory (for C++ interface) +.TP +\fB\-\-libdir\fR +: show the path to the LHAPDF library directory +.TP +\fB\-\-datadir\fR +: show the path to the LHAPDF installed data directory +.HP +\fB\-\-pdfsets\-path\fR : show the path to the directory containing the PDF set data files +.TP +\fB\-\-cppflags\fR +: get compiler flags for use with the C preprocessor stage of C++ compilation +.TP +\fB\-\-ldflags\fR +: get compiler flags for use with the linker stage of any compilation +.TP +\fB\-\-version\fR +: returns LHAPDF release version number +.SH AUTHOR +This manual page was written by Lifeng Sun for the Debian system (but may be used by others). diff --git a/lhapdf-fix-lhapdf-config.patch b/lhapdf-fix-lhapdf-config.patch new file mode 100644 index 0000000..09b5ee6 --- /dev/null +++ b/lhapdf-fix-lhapdf-config.patch @@ -0,0 +1,13 @@ +Fix the package name in lhapdf-config. + +--- a/bin/lhapdf-config.in ++++ b/bin/lhapdf-config.in +@@ -22,7 +22,7 @@ + echo " --cppflags : get compiler flags for use with the C preprocessor stage of C++ compilation" + echo " --ldflags : get compiler flags for use with the linker stage of any compilation" + echo +- echo " --version : returns Rivet release version number" ++ echo " --version : returns LHAPDF release version number" + fi + + OUT="" diff --git a/lhapdf-fix-test-environment.patch b/lhapdf-fix-test-environment.patch new file mode 100644 index 0000000..8287201 --- /dev/null +++ b/lhapdf-fix-test-environment.patch @@ -0,0 +1,44 @@ +Fix test environment. + +--- a/octave/Makefile.am ++++ b/octave/Makefile.am +@@ -5,5 +5,5 @@ + lhapdf.oct: wrapoctave.cc + $(MKOCTFILE) -I$(top_srcdir)/include -v -g -o lhapdf.oct wrapoctave.cc -L$(top_builddir)/lib -L$(top_builddir)/lib/.libs -lLHAPDF + +-TESTS_ENVIRONMENT = LHAPATH=$(top_srcdir)/PDFsets $(OCTAVE) ++TESTS_ENVIRONMENT = LHAPATH=$(top_srcdir)/PDFsets LD_LIBRARY_PATH="$(top_builddir)/lib/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}" $(OCTAVE) + TESTS = $(srcdir)/lhapdf-octave-example1.m +--- a/octave/Makefile.in ++++ b/octave/Makefile.in +@@ -195,7 +195,7 @@ + top_srcdir = @top_srcdir@ + EXTRA_DIST = lhapdf-octave-example1.m wrapoctave.cc + pkgdata_DATA = lhapdf.oct +-TESTS_ENVIRONMENT = LHAPATH=$(top_srcdir)/PDFsets $(OCTAVE) ++TESTS_ENVIRONMENT = LHAPATH=$(top_srcdir)/PDFsets LD_LIBRARY_PATH="$(top_builddir)/lib/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}" $(OCTAVE) + TESTS = $(srcdir)/lhapdf-octave-example1.m + all: all-am + +--- a/examples/Makefile.am ++++ b/examples/Makefile.am +@@ -12,7 +12,7 @@ + lhapdf_example9_SOURCES = Example9.f + lhapdf_example10_SOURCES = Example10.f + +-#TESTS_ENVIRONMENT = LHAPATH=$(top_srcdir)/PDFsets ++TESTS_ENVIRONMENT = LHAPATH=$(top_srcdir)/PDFsets + TESTS = lhapdf-example1 + # lhapdf-example2 lhapdf-example3 + +diff -ur lhapdf-5.8.8.orig/examples/Makefile.in lhapdf-5.8.8/examples/Makefile.in +--- a/examples/Makefile.in ++++ b/examples/Makefile.in +@@ -37,6 +37,7 @@ + lhapdf-example8$(EXEEXT) lhapdf-example9$(EXEEXT) \ + lhapdf-example10$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) + TESTS = lhapdf-example1$(EXEEXT) $(am__EXEEXT_3) $(am__EXEEXT_4) ++TESTS_ENVIRONMENT = LHAPATH=$(top_srcdir)/PDFsets + @ENABLE_LHAGLUE_TRUE@am__append_1 = lhapdf-example4 lhapdf-example5 lhapdf-example6 + @ENABLE_LHAGLUE_TRUE@am__append_2 = lhapdf-example4 + @ENABLE_CCWRAP_TRUE@am__append_3 = lhapdf-cctest1 lhapdf-cctest2 lhapdf-cctest3 lhapdf-cctest4 lhapdf-cctest5 diff --git a/lhapdf-fix-typo.patch b/lhapdf-fix-typo.patch new file mode 100644 index 0000000..71eb447 --- /dev/null +++ b/lhapdf-fix-typo.patch @@ -0,0 +1,13 @@ +Fix typo: AVAIABLE->AVAILABLE. + +--- a/src/wrapevolve.F ++++ b/src/wrapevolve.F +@@ -315,7 +315,7 @@ + if(index(setpath,'NNPDF').gt.0) then + if(nset.gt.1) then + if((index(setpath,'1000.').gt.0.and.nnpdf.gt.0).or.(index(setpath,'100.').gt.0.and.nnpdf1000.gt.0)) then +- print *,'LHAPDF ERROR: MULTISET-INITIALIZATION with NNPDF 1000 sets IS NOT AVAIABLE (AT THE MOMENT)!' ++ print *,'LHAPDF ERROR: MULTISET-INITIALIZATION with NNPDF 1000 sets IS NOT AVAILABLE (AT THE MOMENT)!' + STOP + endif + endif diff --git a/lhapdf-getdata.1 b/lhapdf-getdata.1 new file mode 100644 index 0000000..aaec653 --- /dev/null +++ b/lhapdf-getdata.1 @@ -0,0 +1,64 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.39.4. +.TH LHAPDF-GETDATA "1" "May 2011" "lhapdf-getdata" "User Commands" +.SH NAME +lhapdf-getdata \- Get PDF sets from the LHAPDF repository +.SH SYNOPSIS +.B lhapdf-getdata +[\fI--main\fR] [\fI--all\fR] [\fI--repo=URL\fR] [\fI--dest=DEST\fR] [\fI--dryrun\fR] + [ ...] +.SH DESCRIPTION +.IP +.PP +Grab PDF grid and param files from the LHAPDF repository and install +them into the local LHAPDF data directory. +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-\-repo\fR=\fIURL\fR +Base URL of online sets repository +(http://www.hepforge.org/archive/lhapdf/pdfsets/current) +.TP +\fB\-\-dest\fR=\fIDEST\fR +PDF sets directory to install to (/usr/share/lhapdf/PDFsets) +.TP +\fB\-\-all\fR +Get ALL sets (this will be hundreds of megabytes... be +careful!) +.TP +\fB\-\-list\fR +Just list available files +.TP +\fB\-\-force\fR +Overwrite existing files +.TP +\fB\-\-dryrun\fR +Don't actually do any downloading +.TP +\fB\-Q\fR, \fB\-\-quiet\fR +Suppress normal messages +.TP +\fB\-V\fR, \fB\-\-verbose\fR +Add extra debug messages +.SH EXAMPLES +.TP +Show all available sets: +lhapdf\-getdata \fB\-\-list\fR +.TP +Get all NNPDF PDFs with pattern matching: +lhapdf\-getdata NNPDF +.TP +Get CTEQ6L1, CTEQ66, MRST\-S LO* and LO** PDFs with pattern matching: +lhapdf\-getdata CTEQ6ll CTEQ66 lomod MCal +.TP +Get MSTW2008 68% confidence PDF by full name: +lhapdf\-getdata MSTW2008lo68cl.LHgrid +.TP +See how much downloading would be involved in getting all PDF sets: +lhapdf\-getdata \fB\-\-all\fR \fB\-\-dryrun\fR +.TP +I'm hardcore, give me the whole collection: +lhapdf\-getdata \fB\-\-all\fR +.SH AUTHOR +This manual page was written by Lifeng Sun for the Debian system (but may be used by others). diff --git a/lhapdf-path-max.patch b/lhapdf-path-max.patch new file mode 100644 index 0000000..b209dc9 --- /dev/null +++ b/lhapdf-path-max.patch @@ -0,0 +1,13 @@ +--- a/src/binreloc.c ++++ b/src/binreloc.c +@@ -24,6 +24,10 @@ + #include + #include "binreloc.h" + ++#ifndef PATH_MAX ++#define PATH_MAX 4096 ++#endif ++ + #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ diff --git a/lhapdf-query.1 b/lhapdf-query.1 new file mode 100644 index 0000000..43a09c5 --- /dev/null +++ b/lhapdf-query.1 @@ -0,0 +1,25 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.39.4. +.TH LHAPDF-QUERY "1" "May 2011" "lhapdf-query" "User Commands" +.SH NAME +lhapdf-query \- Query PDF values from LHAPDF +.SH SYNOPSIS +.B lhapdf-query +[cmd] [setname|num] [memnum] x Q [flavourID] +.SH DESCRIPTION +.PP +Retrieve PDF values from LHAPDF, given a set name, member number +and values for x and Q. This will return a list of xf(x,Q2) values +for each parton; specifying a parton name on the command line will +return the single appropriate xf(x,Q2) value for that flavour. +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +Show this help message and exit +.TP +\fB\-Q\fR, \fB\-\-quiet\fR +Suppress normal messages +.TP +\fB\-V\fR, \fB\-\-verbose\fR +Add extra debug messages +.SH AUTHOR +This manual page was written by Lifeng Sun for the Debian system (but may be used by others). diff --git a/lhapdf.spec b/lhapdf.spec new file mode 100644 index 0000000..4345928 --- /dev/null +++ b/lhapdf.spec @@ -0,0 +1,224 @@ +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} + +Name: lhapdf +Version: 5.8.9 +Release: 3%{?dist} +Summary: Les Houches Accord PDF Interface +Group: System Environment/Libraries + +License: GPLv2+ +URL: http://lhapdf.hepforge.org/ +Source0: http://www.hepforge.org/archive/lhapdf/%{name}-%{version}.tar.gz +# Minimal set of PDFs (needed to run make check) +Source1: http://www.hepforge.org/archive/lhapdf/pdfsets/%{version}/cteq5l.LHgrid +Source2: http://www.hepforge.org/archive/lhapdf/pdfsets/%{version}/cteq6ll.LHpdf +Source3: http://www.hepforge.org/archive/lhapdf/pdfsets/%{version}/cteq61.LHgrid +Source4: http://www.hepforge.org/archive/lhapdf/pdfsets/%{version}/CT10.LHgrid +Source5: http://www.hepforge.org/archive/lhapdf/pdfsets/%{version}/GRV98nlo.LHgrid +Source6: http://www.hepforge.org/archive/lhapdf/pdfsets/%{version}/MRST2001nlo.LHgrid +# Man pages (from the Debian package) +Source7: %{name}-config.1 +Source8: %{name}-getdata.1 +Source9: %{name}-query.1 +# Patches (from the Debian package) +Patch0: %{name}-fix-lhapdf-config.patch +Patch1: %{name}-fix-test-environment.patch +Patch2: %{name}-fix-typo.patch +Patch3: %{name}-path-max.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: octave-devel%{?_isa} +BuildRequires: ncurses-devel%{?_isa} +BuildRequires: python-devel%{?_isa} +BuildRequires: gcc-gfortran +BuildRequires: swig +BuildRequires: doxygen +BuildRequires: tex(latex) +BuildRequires: ghostscript + +%description +LHAPDF provides a unified and easy to use interface to modern PDF +sets. It is designed to work not only with individual PDF sets but +also with the more recent multiple "error" sets. It can be viewed as +the successor to PDFLIB, incorporating many of the older sets found in +the latter, including pion and photon PDFs. In LHAPDF the computer +code and input parameters/grids are separated thus allowing more easy +updating and no limit to the expansion possibilities. + +%package devel +Summary: Les Houches Accord PDF Interface - development files +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package provides development files of LHAPDF, including C++ bindings. + +%global octpkg %{name} +%{!?octave_api: %global octave_api %(octave-config -p API_VERSION || echo 0)} +%{!?octpkgdir: %global octpkgdir %{_datadir}/octave/packages/%{octpkg}-%{version}} +%{!?octpkglibdir: %global octpkglibdir %{_libdir}/octave/packages/%{octpkg}-%{version}} +%{!?octave_cmd: %global octave_cmd() octave -H -q --no-window-system --no-site-file --eval "%*";} + +%package -n octave-%{name} +Summary: Les Houches Accord PDF Interface - Octave module +Group: Applications/Engineering +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: octave(api) = %{octave_api} +Requires(post): octave +Requires(postun): octave + +%description -n octave-%{name} +This package provides Octave bindings for LHAPDF. + +%package -n python-%{name} +Summary: Les Houches Accord PDF Interface - Python module +Group: Applications/Engineering +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description -n python-%{name} +This package provides Python bindings for LHAPDF. + +%package pdfsets-minimal +Summary: Les Houches Accord PDF Interface - PDF sets +Group: Applications/Engineering +%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6 +BuildArch: noarch +%endif +Requires: %{name} = %{version}-%{release} + +%description pdfsets-minimal +This package provides a minimal PDF sets required by the test suites. +Note: the python-lhapdf package provides the lhapdf-getdata script to +download other PDF sets. + +%package doc +Summary: Les Houches Accord PDF Interface - documentation +Group: Documentation +%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6 +BuildArch: noarch +%endif + +%description doc +This package provides documentation of C++ bindings for LHAPDF. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +mkdir PDFsets +install -m 644 -p %SOURCE1 PDFsets +install -m 644 -p %SOURCE2 PDFsets +install -m 644 -p %SOURCE3 PDFsets +install -m 644 -p %SOURCE4 PDFsets +install -m 644 -p %SOURCE5 PDFsets +install -m 644 -p %SOURCE6 PDFsets + +sed 's!/usr/bin/env python!/usr/bin/python!' -i bin/lhapdf-* examples/*.py +sed 's!/usr/bin/env bash!/bin/bash!' -i bin/lhapdf-config.in + +%build +%configure --disable-static + +# Reduce overlinking +sed 's!CC -shared !CC \${wl}--as-needed -shared !g' -i libtool + +make %{?_smp_mflags} + +%install +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} + +mkdir -p %{buildroot}%{_mandir}/man1 +install -m 644 -p %SOURCE7 %{buildroot}%{_mandir}/man1 +install -m 644 -p %SOURCE8 %{buildroot}%{_mandir}/man1 +install -m 644 -p %SOURCE9 %{buildroot}%{_mandir}/man1 + +rm %{buildroot}%{_libdir}/libLHAPDF.la +rm %{buildroot}%{_datadir}/%{name}/doc/html + +APIDIR=$(octave-config -p CANONICAL_HOST_TYPE)-$(octave-config -p API_VERSION) +mkdir -p %{buildroot}%{octpkglibdir}/${APIDIR} +mv %{buildroot}%{_datadir}/%{name}/%{name}.oct \ + %{buildroot}%{octpkglibdir}/${APIDIR}/%{name}.oct +chmod 755 %{buildroot}%{octpkglibdir}/${APIDIR}/%{name}.oct +mkdir -p %{buildroot}%{octpkgdir}/packinfo +install -m 644 -p COPYING %{buildroot}%{octpkgdir}/packinfo/COPYING +cat << EOF > %{buildroot}%{octpkgdir}/packinfo/DESCRIPTION +Name: %{name} +Version: %{version} +Date: `date -I` +Author: W Giele , Mike R Whalley +Maintainer: W Giele , Mike R Whalley +Title: Les Houches Accord PDF Interface +Description: LHAPDF provides a unified and easy to use interface to + modern PDF sets. It is designed to work not only with individual PDF + sets but also with the more recent multiple "error" sets. It can be + viewed as the successor to PDFLIB, incorporating many of the older sets + found in the latter, including pion and photon PDFs. In LHAPDF the + computer code and input parameters/grids are separated thus allowing + more easy updating and no limit to the expansion possibilities. +EOF + +mkdir -p %{buildroot}%{_datadir}/%{name}/PDFsets +install -m 644 -p PDFsets/* %{buildroot}%{_datadir}/%{name}/PDFsets + +%check +make check + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%post -n octave-%{name} +%octave_cmd pkg rebuild + +%postun -n octave-%{name} +%octave_cmd pkg rebuild + +%files +%{_libdir}/libLHAPDF.so.* +%doc AUTHORS ChangeLog COPYING README TODO + +%files devel +%{_bindir}/lhapdf-config +%{_mandir}/man1/lhapdf-config.1* +%{_includedir}/LHAPDF +%{_libdir}/libLHAPDF.so +%doc examples/CC*.cc examples/Example*.f + +%files -n octave-%{name} +%{octpkglibdir} +%{octpkgdir} +%doc octave/lhapdf-octave-example1.m + +%files -n python-%{name} +%{_bindir}/lhapdf-getdata +%{_bindir}/lhapdf-query +%{_mandir}/man1/lhapdf-getdata.1* +%{_mandir}/man1/lhapdf-query.1* +%{python_sitearch}/* +%doc examples/pdf-*.py + +%files pdfsets-minimal +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/PDFsets +%{_datadir}/%{name}/PDFsets.index + +%files doc +%doc ccwrap/doxy/html COPYING + +%changelog +* Wed Jun 05 2013 Mattias Ellert - 5.8.9-3 +- Make doc package independent + +* Wed May 22 2013 Mattias Ellert - 5.8.9-2 +- Reduce libtool overlinking +- Add isa to dependencies + +* Sat May 18 2013 Mattias Ellert - 5.8.9-1 +- New upstream version + +* Wed Nov 14 2012 Mattias Ellert - 5.8.8-1 +- Initial build diff --git a/sources b/sources index e69de29..dd8779b 100644 --- a/sources +++ b/sources @@ -0,0 +1,7 @@ +51e61fa316957abd13d1b76b44e665cf lhapdf-5.8.9.tar.gz +b592db3245a875f1a2ab5b0be0e06b5b cteq5l.LHgrid +330dc600f0ee7f9b5fa8051eef732930 cteq6ll.LHpdf +f85b82894b43df936fa395465ba155c4 cteq61.LHgrid +49276a39307a609d446722302915b09a CT10.LHgrid +4b93c4101fa8f162ae744da3b3fce031 GRV98nlo.LHgrid +a5121e3ab1912a4a72e85889ba5e9234 MRST2001nlo.LHgrid