From ed4d0c5a87a9bcb51f65790169f088926791ddc5 Mon Sep 17 00:00:00 2001 From: Matthias Maiterth Date: Tue, 17 Apr 2018 14:51:56 +0200 Subject: [PATCH] Package/geopm (#7560) * geopm: Added initial files for package geopm and py-natsort dependency * geopm: Updated variants for hwloc and mpi defaults * geopm: Cleaned up unwanted hyphenation in description. * geopm: updates according to change request. * geopm: Updated minor change requests. Clarification for ruby-ronn dependency included as a TODO. This requires changes in the current configure and build process which will be changed in a future version. * geopm: changed to AutotoolsPackage and fixed hwloc The changes for hwloc required to add a specific version bc of a conflicting version of openmpi's hwloc dependency being below 1.99. This works but updates to this package should check if this restriction is still required. (Thus TODO added) * geopm: Added link dependencies (thanks for pointing this out). Also removed empty line below class definition. * geopm: Fixed depends_on according to package guide. Removed wrong type 'run' and removed types for numactl, mpi and hwloc to use default build & link type. * geopm: Fixed and updated +doc dependencies new pacakge ruby-ronn (package specified as in ruby-narray package) Updated second +doc dependency doxygen. * geopm: Changed args for Autotools specific feature. Added enable_or_disable and with_or_without instead of if cascade. Added overhead variant. Also added missing dependency (default: build&link) for json-c). --- .../repos/builtin/packages/geopm/package.py | 94 +++++++++++++++++++ .../builtin/packages/py-natsort/package.py | 45 +++++++++ .../builtin/packages/ruby-ronn/package.py | 42 +++++++++ 3 files changed, 181 insertions(+) create mode 100644 var/spack/repos/builtin/packages/geopm/package.py create mode 100644 var/spack/repos/builtin/packages/py-natsort/package.py create mode 100644 var/spack/repos/builtin/packages/ruby-ronn/package.py diff --git a/var/spack/repos/builtin/packages/geopm/package.py b/var/spack/repos/builtin/packages/geopm/package.py new file mode 100644 index 0000000000..6895291c16 --- /dev/null +++ b/var/spack/repos/builtin/packages/geopm/package.py @@ -0,0 +1,94 @@ +############################################################################## +# Copyright (c) 2013-2017, 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 Geopm(AutotoolsPackage): + """GEOPM is an extensible power management framework targeting HPC. + The GEOPM package provides libgeopm, libgeopmpolicy and applications + geopmctl and geopmpolicy, as well as tools for postprocessing. + GEOPM is designed to be extended for new control algorithms and new + hardware power management features via its plugin infrastructure. + + Note: GEOPM interfaces with hardware using Model Specific Registers (MSRs). + For propper usage make sure MSRs are made available directly or via the + msr-safe kernel module by your administrator.""" + + homepage = "https://geopm.github.io" + url = "https://github.com/geopm/geopm/releases/download/v0.4.0/geopm-0.4.0.tar.gz" + + # Add additional proper versions and checksums here. "spack checksum geopm" + version('0.4.0', 'd4cc8fffe521296dab379857d7e2064d') + version('0.3.0', '568fd37234396fff134f8d57b60f2b83') + version('master', git='https://github.com/geopm/geopm.git', branch='master') + version('develop', git='https://github.com/geopm/geopm.git', branch='dev') + + # Variants reflecting most ./configure --help options + variant('debug', default=False, description='Enable debug.') + variant('coverage', default=False, description='Enable test coverage support, enables debug by default.') + variant('overhead', default=False, description='Enable GEOPM to calculate and display time spent in GEOPM API calls.') + variant('procfs', default=True, description='Enable procfs (disable for OSes not using procfs).') + variant('mpi', default=True, description='Enable MPI dependent components.') + variant('fortran', default=True, description='Build fortran interface.') + variant('doc', default=True, description='Create man pages with ruby-ronn.') + variant('openmp', default=True, description='Build with OpenMP.') + variant('ompt', default=False, description='Use OpenMP Tools Interface.') + variant('hwloc', default=True, description='Build with hwloc.') + variant('gnu-ld', default=False, description='Assume C compiler uses gnu-ld.') + + # Added dependencies. + depends_on('m4', type='build') + depends_on('automake', type='build') + depends_on('autoconf', type='build') + depends_on('libtool', type='build') + depends_on('ruby-ronn', type='build', when='+doc') + depends_on('doxygen', type='build', when='+doc') + depends_on('numactl') + depends_on('mpi', when='+mpi') + # TODO: check if hwloc@specific-version still required with future openmpi + depends_on('hwloc@1.11.9', when='+hwloc') + depends_on('json-c') + depends_on('py-pandas', type='run') + depends_on('py-numpy', type='run') + depends_on('py-natsort', type='run') + depends_on('py-matplotlib', type='run') + + parallel = False + + def configure_args(self): + args = [] + args.extend(self.enable_or_disable('debug')) + args.extend(self.enable_or_disable('coverage')) + args.extend(self.enable_or_disable('overhead')) + args.extend(self.enable_or_disable('procfs')) + args.extend(self.enable_or_disable('mpi')) + args.extend(self.enable_or_disable('fortran')) + args.extend(self.enable_or_disable('doc')) + args.extend(self.enable_or_disable('openmp')) + args.extend(self.enable_or_disable('ompt')) + args.extend(self.with_or_without('hwloc', activation_value='prefix')) + args.extend(self.with_or_without('gnu-ld')) + + return args diff --git a/var/spack/repos/builtin/packages/py-natsort/package.py b/var/spack/repos/builtin/packages/py-natsort/package.py new file mode 100644 index 0000000000..bc7303d3ac --- /dev/null +++ b/var/spack/repos/builtin/packages/py-natsort/package.py @@ -0,0 +1,45 @@ +############################################################################## +# Copyright (c) 2013-2017, 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 PyNatsort(PythonPackage): + """Simple yet flexible natural sorting in Python.""" + + homepage = "https://pypi.org/project/natsort/" + url = "https://github.com/SethMMorton/natsort/archive/5.2.0.zip" + + version('5.2.0', '2ed2826550eef1f9ea3dd04f08b5da8b') + version('5.1.1', '0525d4897fc98f40df5cc5a4a05f3c82') + version('5.1.0', '518688548936d548775fb00afba999fb') + version('5.0.3', '11147d75693995a946656927df7617d0') + version('5.0.2', '1eb11a69086a5fb21d03f8189f1afed3') + version('5.0.1', 'ca21c728bb3dd5dcfb010fa50b9c5e3c') + version('5.0.0', 'fc7800fea50dcccbf8b116e1dff2ebf8') + version('4.0.4', '7478ba31ec7fe554fcbfda41bb01f5ef') + version('4.0.3', '2dc4fb1eb6ebfe4c9d95a12c2406df33') + version('4.0.1', '659cf6ce95951003de0c85fc80b9f135') + + depends_on('py-setuptools', type=('build')) diff --git a/var/spack/repos/builtin/packages/ruby-ronn/package.py b/var/spack/repos/builtin/packages/ruby-ronn/package.py new file mode 100644 index 0000000000..af3776a5a3 --- /dev/null +++ b/var/spack/repos/builtin/packages/ruby-ronn/package.py @@ -0,0 +1,42 @@ +############################################################################## +# Copyright (c) 2013-2017, 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 RubyRonn(Package): + """Ronn builds manuals. It converts simple, human readable textfiles to + roff for terminal display, and also to HTML for the web.""" + + homepage = "https://rubygems.org/gems/ronn" + url = "https://github.com/rtomayko/ronn/archive/0.7.3.tar.gz" + + version('0.7.3', '90cdedb42920c8c2a74e2d177e9535b6') + version('0.7.0', '34ad78510a75e46904629631f5335e06') + + extends('ruby') + + def install(self, spec, prefix): + gem('build', 'ronn.gemspec') + gem('install', 'ronn-{0}.gem'.format(self.version))