diff options
author | Paul Chelarescu <paulchelarescu@gmail.com> | 2018-06-22 18:27:25 +0200 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2018-06-22 11:27:25 -0500 |
commit | 3e7f5250c0b39d963521269a0d0d68f5d4892be9 (patch) | |
tree | f8e1b5e54c46232f582eaf054d7908839c97faa3 /var | |
parent | d5e8cabe7565fc92f1b64375958146ef57fbd18c (diff) | |
download | spack-3e7f5250c0b39d963521269a0d0d68f5d4892be9.tar.gz spack-3e7f5250c0b39d963521269a0d0d68f5d4892be9.tar.bz2 spack-3e7f5250c0b39d963521269a0d0d68f5d4892be9.tar.xz spack-3e7f5250c0b39d963521269a0d0d68f5d4892be9.zip |
Added minuit package (#8536)
* Added minuit package
* Removed default method and template
* Different URLs for old versions
* Patches for versions down to 1.5.0
* Reverted ROOT package changes
* Removed print statement
* Added checksums for older versions
* Consistent version names
Diffstat (limited to 'var')
4 files changed, 203 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/minuit/LASymMatrix.h.patch b/var/spack/repos/builtin/packages/minuit/LASymMatrix.h.patch new file mode 100644 index 0000000000..645d2ccd35 --- /dev/null +++ b/var/spack/repos/builtin/packages/minuit/LASymMatrix.h.patch @@ -0,0 +1,117 @@ +commit 62772d5fb0c6c7661c7acaa73d21de4205579d73 +Author: Paul Chelarescu <paulchelarescu@gmail.com> +Date: Fri Jun 22 15:34:20 2018 +0200 + + Patched LASymMatrix.h + +diff --git a/Minuit/LASymMatrix.h b/Minuit/LASymMatrix.h +index 755eb11..976c0de 100644 +--- a/Minuit/LASymMatrix.h ++++ b/Minuit/LASymMatrix.h +@@ -16,6 +16,7 @@ + // #include <iostream> + + #include "Minuit/StackAllocator.h" ++#include <cstring> + //extern StackAllocator StackAllocatorHolder::get(); + + int mndaxpy(unsigned int, double, const double*, int, double*, int); +@@ -37,7 +38,7 @@ public: + + LASymMatrix(unsigned int n) : theSize(n*(n+1)/2), theNRow(n), theData((double*)StackAllocatorHolder::get().allocate(sizeof(double)*n*(n+1)/2)) { + // assert(theSize>0); +- memset(theData, 0, theSize*sizeof(double)); ++ std::memset(theData, 0, theSize*sizeof(double)); + // std::cout<<"LASymMatrix(unsigned int n), n= "<<n<<std::endl; + } + +@@ -52,7 +53,7 @@ public: + LASymMatrix(const LASymMatrix& v) : + theSize(v.size()), theNRow(v.nrow()), theData((double*)StackAllocatorHolder::get().allocate(sizeof(double)*v.size())) { + // std::cout<<"LASymMatrix(const LASymMatrix& v)"<<std::endl; +- memcpy(theData, v.data(), theSize*sizeof(double)); ++ std::memcpy(theData, v.data(), theSize*sizeof(double)); + } + + LASymMatrix& operator=(const LASymMatrix& v) { +@@ -60,7 +61,7 @@ public: + // std::cout<<"theSize= "<<theSize<<std::endl; + // std::cout<<"v.size()= "<<v.size()<<std::endl; + assert(theSize == v.size()); +- memcpy(theData, v.data(), theSize*sizeof(double)); ++ std::memcpy(theData, v.data(), theSize*sizeof(double)); + return *this; + } + +@@ -69,7 +70,7 @@ public: + theSize(v.obj().size()), theNRow(v.obj().nrow()), theData((double*)StackAllocatorHolder::get().allocate(sizeof(double)*v.obj().size())) { + // std::cout<<"LASymMatrix(const ABObj<sym, LASymMatrix, T>& v)"<<std::endl; + //std::cout<<"allocate "<<theSize<<std::endl; +- memcpy(theData, v.obj().data(), theSize*sizeof(double)); ++ std::memcpy(theData, v.obj().data(), theSize*sizeof(double)); + mndscal(theSize, double(v.f()), theData, 1); + //std::cout<<"theData= "<<theData[0]<<" "<<theData[1]<<std::endl; + } +@@ -105,7 +106,7 @@ public: + + template<class T> + LASymMatrix(const ABObj<sym, MatrixInverse<sym, ABObj<sym, LASymMatrix, T>, T>, T>& inv) : theSize(inv.obj().obj().obj().size()), theNRow(inv.obj().obj().obj().nrow()), theData((double*)StackAllocatorHolder::get().allocate(sizeof(double)*inv.obj().obj().obj().size())) { +- memcpy(theData, inv.obj().obj().obj().data(), theSize*sizeof(double)); ++ std::memcpy(theData, inv.obj().obj().obj().data(), theSize*sizeof(double)); + mndscal(theSize, double(inv.obj().obj().f()), theData, 1); + invert(*this); + mndscal(theSize, double(inv.f()), theData, 1); +@@ -236,7 +237,7 @@ public: + assert(theSize == v.obj().size()); + } + //std::cout<<"theData= "<<theData[0]<<" "<<theData[1]<<std::endl; +- memcpy(theData, v.obj().data(), theSize*sizeof(double)); ++ std::memcpy(theData, v.obj().data(), theSize*sizeof(double)); + (*this) *= v.f(); + return *this; + } +@@ -251,7 +252,7 @@ public: + LASymMatrix tmp(something.obj()); + tmp *= something.f(); + assert(theSize == tmp.size()); +- memcpy(theData, tmp.data(), theSize*sizeof(double)); ++ std::memcpy(theData, tmp.data(), theSize*sizeof(double)); + } + //std::cout<<"template<class A, class T> LASymMatrix& operator=(const ABObj<sym, ABObj<sym, A, T>, T>& something)"<<std::endl; + return *this; +@@ -270,7 +271,7 @@ public: + tmp += sum.obj().b(); + tmp *= sum.f(); + assert(theSize == tmp.size()); +- memcpy(theData, tmp.data(), theSize*sizeof(double)); ++ std::memcpy(theData, tmp.data(), theSize*sizeof(double)); + } + return *this; + } +@@ -290,7 +291,7 @@ public: + tmp += sum.obj().a(); + tmp *= sum.f(); + assert(theSize == tmp.size()); +- memcpy(theData, tmp.data(), theSize*sizeof(double)); ++ std::memcpy(theData, tmp.data(), theSize*sizeof(double)); + } + //std::cout<<"leaving LASymMatrix& operator=(const ABObj<sym, ABSum<ABObj<sym, LASymMatrix..."<<std::endl; + return *this; +@@ -302,7 +303,7 @@ public: + theSize = inv.obj().obj().obj().size(); + theNRow = inv.obj().obj().obj().nrow(); + theData = (double*)StackAllocatorHolder::get().allocate(sizeof(double)*theSize); +- memcpy(theData, inv.obj().obj().obj().data(), theSize*sizeof(double)); ++ std::memcpy(theData, inv.obj().obj().obj().data(), theSize*sizeof(double)); + (*this) *= inv.obj().obj().f(); + invert(*this); + (*this) *= inv.f(); +@@ -311,7 +312,7 @@ public: + invert(tmp); + tmp *= double(inv.f()); + assert(theSize == tmp.size()); +- memcpy(theData, tmp.data(), theSize*sizeof(double)); ++ std::memcpy(theData, tmp.data(), theSize*sizeof(double)); + } + return *this; + } diff --git a/var/spack/repos/builtin/packages/minuit/package.py b/var/spack/repos/builtin/packages/minuit/package.py new file mode 100644 index 0000000000..9b14aee8a1 --- /dev/null +++ b/var/spack/repos/builtin/packages/minuit/package.py @@ -0,0 +1,66 @@ +############################################################################## +# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/spack/spack +# Please also see the NOTICE and LICENSE files for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class Minuit(AutotoolsPackage): + """MINUIT is a physics analysis tool for function minimization.""" + + homepage = "https://seal.web.cern.ch/seal/snapshot/work-packages/mathlibs/minuit/home.html" + url = "http://www.cern.ch/mathlibs/sw/5_34_14/Minuit2/Minuit2-5.34.14.tar.gz" + list_url = "https://seal.web.cern.ch/seal/snapshot/work-packages/mathlibs/minuit/release/download.html" + + version('5.34.14', '7fc00378a2ed1f731b719d4837d62d6a') + version('5.28.00', '536a1d29e5cc9bd4499d17d665021370') + version('5.27.02', 'b54673f2b9b62a8ff4e6937a2ed8fda5') + version('5.24.00', '9a915e56bee1e8986a719aa80e7b05d6') + version('5.22.00', '2cbc34907bfe202c7a779e9713355846') + version('5.21.06', 'b431ed129abb6c5020fd58d53cb8d27c') + version('5.20.00', '3083d31e3764de45d477d082d60f2c29') + version('5.18.00', 'a8764e7213fe811e56d5b6e5f3a91f5e') + version('5.16.00', '6ea5feca06fca365d324bcfe16db7f08') + version('5.14.00', 'b7452867b01c76cd115c696336c202d2') + version('5.12.00', '36726b8c6fcddf4f0837c900461a1d3c') + version('5.10.00', 'dfc7afc0add70deaca105ff549f5a786') + version('5.08.00', '1cc8da07c4a247c877f39acf8d76ba02') + version('1.7.9', '10fd518fc778317fdadbc4ef6f7ce8e4') + version('1.7.6', '6a9a8341557de154274caff810686364') + version('1.7.1', 'd202a1cf58662e9833f2967b4dc8808e') + version('1.6.3', '955f560d0fb17bd7f081eddd7080fad6') + version('1.6.0', '6992d70fc8fded50be49b6b358b58507') + version('1.5.2', '31a0698febe59edd70aa001c4d7a56f8') + version('1.5.0', 'bc502c66af071fcdc0a2ae45a8740c75') + + def url_for_version(self, version): + if version > Version('5.0.0'): + url = "http://www.cern.ch/mathlibs/sw/{0}/Minuit2/Minuit2-{1}.tar.gz" + return url.format(version.underscored, version) + else: + url = "http://seal.web.cern.ch/seal/minuit/releases/Minuit-{0}.tar.gz" + return url.format(version.underscored) + + patch('sprintf.cxx.patch', when='@5.08.00:5.18.00') + patch('sprintf.patch', when='@:1.7.9') + patch('LASymMatrix.h.patch', when='@:1.7.6') diff --git a/var/spack/repos/builtin/packages/minuit/sprintf.cxx.patch b/var/spack/repos/builtin/packages/minuit/sprintf.cxx.patch new file mode 100644 index 0000000000..f6bf81cbc3 --- /dev/null +++ b/var/spack/repos/builtin/packages/minuit/sprintf.cxx.patch @@ -0,0 +1,10 @@ +--- a/src/MnUserTransformation.cxx 2008-01-17 15:05:38.000000000 +0100 ++++ b/src/MnUserTransformation.cxx 2018-06-22 13:44:02.629389848 +0200 +@@ -11,6 +11,7 @@ + #include "Minuit2/MnUserCovariance.h" + + #include <algorithm> ++#include <cstdio> + + namespace ROOT { + diff --git a/var/spack/repos/builtin/packages/minuit/sprintf.patch b/var/spack/repos/builtin/packages/minuit/sprintf.patch new file mode 100644 index 0000000000..be49ed772a --- /dev/null +++ b/var/spack/repos/builtin/packages/minuit/sprintf.patch @@ -0,0 +1,10 @@ +--- a/src/MnUserTransformation.cpp 2018-06-22 11:35:34.476798087 +0200 ++++ b/src/MnUserTransformation.cpp 2018-06-22 11:08:01.729725829 +0200 +@@ -2,6 +2,7 @@ + #include "Minuit/MnUserCovariance.h" + + #include <algorithm> ++#include <cstdio> + + class MnParStr { + |