a few package used in HEP including ROOT6

This commit is contained in:
Patrick Gartung
2016-09-22 15:34:58 -05:00
committed by Todd Gamblin
parent 64194a823a
commit ec91152a36
10 changed files with 607 additions and 0 deletions

View File

@@ -0,0 +1,115 @@
From 5f3faffdd869bce5e254ae70f69290e4651a061d Mon Sep 17 00:00:00 2001
From: Lorenzo Moneta <Lorenzo.Moneta@cern.ch>
Date: Mon, 4 Jan 2016 15:38:23 +0100
Subject: [PATCH] Fix ROOT-7886. Use unsigned int instead of uint
---
math/mathcore/inc/Math/Delaunay2D.h | 2 +-
math/mathcore/src/Delaunay2D.cxx | 30 +++++++++++++++---------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/math/mathcore/inc/Math/Delaunay2D.h b/math/mathcore/inc/Math/Delaunay2D.h
index 6255e78..472bded 100644
--- a/math/mathcore/inc/Math/Delaunay2D.h
+++ b/math/mathcore/inc/Math/Delaunay2D.h
@@ -273,7 +273,7 @@ class Delaunay2D {
double fYCellStep; //! inverse denominator to calculate X cell = fNCells / (fYNmax - fYNmin)
std::set<UInt_t> fCells[(fNCells+1)*(fNCells+1)]; //! grid cells with containing triangles
- inline unsigned int Cell(uint x, uint y) const {
+ inline unsigned int Cell(UInt_t x, UInt_t y) const {
return x*(fNCells+1) + y;
}
diff --git a/math/mathcore/src/Delaunay2D.cxx b/math/mathcore/src/Delaunay2D.cxx
index c4d4680..9a82858 100644
--- a/math/mathcore/src/Delaunay2D.cxx
+++ b/math/mathcore/src/Delaunay2D.cxx
@@ -190,7 +190,7 @@ void Delaunay2D::DoFindTriangles() {
Triangle tri;
- auto transform = [&] (const uint i) {
+ auto transform = [&] (const unsigned int i) {
tri.x[i] = face.vertex(i)->point().x();
tri.y[i] = face.vertex(i)->point().y();
tri.idx[i] = face.vertex(i)->info();
@@ -326,7 +326,7 @@ void Delaunay2D::DoFindTriangles() {
for(int t = 0; t < out.numberoftriangles; ++t){
Triangle tri;
- auto transform = [&] (const uint v) {
+ auto transform = [&] (const unsigned int v) {
//each triangle as numberofcorners vertices ( = 3)
tri.idx[v] = out.trianglelist[t*out.numberofcorners + v];
@@ -354,14 +354,14 @@ void Delaunay2D::DoFindTriangles() {
auto bx = std::minmax({tri.x[0], tri.x[1], tri.x[2]});
auto by = std::minmax({tri.y[0], tri.y[1], tri.y[2]});
- uint cellXmin = CellX(bx.first);
- uint cellXmax = CellX(bx.second);
+ unsigned int cellXmin = CellX(bx.first);
+ unsigned int cellXmax = CellX(bx.second);
- uint cellYmin = CellY(by.first);
- uint cellYmax = CellY(by.second);
+ unsigned int cellYmin = CellY(by.first);
+ unsigned int cellYmax = CellY(by.second);
- for(uint i = cellXmin; i <= cellXmax; ++i)
- for(uint j = cellYmin; j <= cellYmax; ++j){
+ for(unsigned int i = cellXmin; i <= cellXmax; ++i)
+ for(unsigned int j = cellYmin; j <= cellYmax; ++j){
//printf("(%u,%u) = %u\n", i, j, Cell(i,j));
fCells[Cell(i,j)].insert(t);
}
@@ -382,7 +382,7 @@ double Delaunay2D::DoInterpolateNormalized(double xx, double yy)
/// FindAllTriangles();
//see comment in header for CGAL fallback section
- auto bayCoords = [&] (const uint t) -> std::tuple<double, double, double> {
+ auto bayCoords = [&] (const unsigned int t) -> std::tuple<double, double, double> {
double la = ( (fTriangles[t].y[1] - fTriangles[t].y[2])*(xx - fTriangles[t].x[2])
+ (fTriangles[t].x[2] - fTriangles[t].x[1])*(yy - fTriangles[t].y[2]) ) * fTriangles[t].invDenom;
double lb = ( (fTriangles[t].y[2] - fTriangles[t].y[0])*(xx - fTriangles[t].x[2])
@@ -401,7 +401,7 @@ double Delaunay2D::DoInterpolateNormalized(double xx, double yy)
if(cX < 0 || cX > fNCells || cY < 0 || cY > fNCells)
return fZout; //TODO some more fancy interpolation here
- for(uint t : fCells[Cell(cX, cY)]){
+ for(unsigned int t : fCells[Cell(cX, cY)]){
auto coords = bayCoords(t);
if(inTriangle(coords)){
@@ -415,7 +415,7 @@ double Delaunay2D::DoInterpolateNormalized(double xx, double yy)
//debugging
- /*for(uint t = 0; t < fNdt; ++t){
+ /*for(unsigned int t = 0; t < fNdt; ++t){
auto coords = bayCoords(t);
if(inTriangle(coords)){
@@ -423,17 +423,17 @@ double Delaunay2D::DoInterpolateNormalized(double xx, double yy)
//brute force found a triangle -> grid not
printf("Found triangle %u for (%f,%f) -> (%u,%u)\n", t, xx,yy, cX, cY);
printf("Triangles in grid cell: ");
- for(uint x : fCells[Cell(cX, cY)])
+ for(unsigned int x : fCells[Cell(cX, cY)])
printf("%u ", x);
printf("\n");
printf("Triangle %u is in cells: ", t);
- for(uint i = 0; i <= fNCells; ++i)
- for(uint j = 0; j <= fNCells; ++j)
+ for(unsigned int i = 0; i <= fNCells; ++i)
+ for(unsigned int j = 0; j <= fNCells; ++j)
if(fCells[Cell(i,j)].count(t))
printf("(%u,%u) ", i, j);
printf("\n");
- for(uint i = 0; i < 3; ++i)
+ for(unsigned int i = 0; i < 3; ++i)
printf("\tpoint %u (%u): (%f,%f) -> (%u,%u)\n", i, fTriangles[t].idx[i], fTriangles[t].x[i], fTriangles[t].y[i], CellX(fTriangles[t].x[i]), CellY(fTriangles[t].y[i]));
//we found the triangle -> interpolate using the barycentric interpolation

View File

@@ -0,0 +1,89 @@
##############################################################################
# Copyright (c) 2013-2016, 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/llnl/spack
# Please also see the LICENSE file 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 *
import sys
class Root(Package):
"""ROOT is a data analysis framework."""
homepage = "https://root.cern.ch"
url = "https://root.cern.ch/download/root_v6.07.02.source.tar.gz"
version('6.06.06', '4308449892210c8d36e36924261fea26')
version('6.06.04', '55a2f98dd4cea79c9c4e32407c2d6d17')
version('6.06.02', 'e9b8b86838f65b0a78d8d02c66c2ec55')
if sys.platform == 'darwin':
patch('math_uint.patch', when='@6.06.02')
patch('root6-60606-mathmore.patch', when='@6.06.06')
variant('graphviz', default=False, description='Enable graphviz support')
depends_on("cmake", type='build')
depends_on("pcre")
depends_on("fftw")
depends_on("graphviz", when="+graphviz")
depends_on("python")
depends_on("gsl")
depends_on("libxml2+python")
depends_on("jpeg")
if sys.platform != 'darwin':
depends_on("libpng")
depends_on("openssl")
depends_on("freetype")
def install(self, spec, prefix):
build_directory = join_path(self.stage.path, 'spack-build')
source_directory = self.stage.source_path
options = [source_directory]
if '+debug' in spec:
options.append('-DCMAKE_BUILD_TYPE:STRING=Debug')
else:
options.append('-DCMAKE_BUILD_TYPE:STRING=Release')
options.append('-Dcxx14=on')
options.append('-Dcocoa=off')
options.append('-Dbonjour=off')
options.append('-Dx11=on')
options.extend(std_cmake_args)
if sys.platform == 'darwin':
darwin_options = [
'-Dcastor=OFF',
'-Drfio=OFF',
'-Ddcache=OFF']
options.extend(darwin_options)
with working_dir(build_directory, create=True):
cmake(*options)
make()
make("install")
def setup_dependent_environment(self, spack_env, run_env, dspec):
spack_env.set('ROOTSYS', self.prefix)
spack_env.set('ROOT_VERSION', 'v6')
spack_env.prepend_path('PYTHONPATH', self.prefix.lib)
def url_for_version(self, version):
"""Handle ROOT's unusual version string."""
return "https://root.cern.ch/download/root_v%s.source.tar.gz" % version

View File

@@ -0,0 +1,29 @@
diff --git a/math/mathmore/inc/Math/QuantFuncMathMore.h b/math/mathmore/inc/Math/QuantFuncMathMore.h
index fd6679c..03ccc03 100644
--- a/math/mathmore/inc/Math/QuantFuncMathMore.h
+++ b/math/mathmore/inc/Math/QuantFuncMathMore.h
@@ -25,17 +25,6 @@
**********************************************************************/
-#if defined(__CINT__) && !defined(__MAKECINT__)
-// avoid to include header file when using CINT
-#ifndef _WIN32
-#include "../lib/libMathMore.so"
-#else
-#include "../bin/libMathMore.dll"
-#endif
-
-#else
-
-
#ifndef ROOT_Math_QuantFuncMathMore
#define ROOT_Math_QuantFuncMathMore
@@ -190,5 +179,3 @@ namespace MathMore {
#endif // ROOT_Math_QuantFuncMathMore
-
-#endif // if defined (__CINT__) && !defined(__MAKECINT__)