From dea7bbb4a09dcdc4f74b2080c2ac66e13c558b82 Mon Sep 17 00:00:00 2001 From: Gilles Fourestey Date: Tue, 2 Aug 2016 14:58:31 +0200 Subject: added plumed * plumed : first version * plumed : added dependencies and docs --- var/spack/repos/builtin/packages/plumed/package.py | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 var/spack/repos/builtin/packages/plumed/package.py diff --git a/var/spack/repos/builtin/packages/plumed/package.py b/var/spack/repos/builtin/packages/plumed/package.py new file mode 100644 index 0000000000..e8cd6d1894 --- /dev/null +++ b/var/spack/repos/builtin/packages/plumed/package.py @@ -0,0 +1,82 @@ +############################################################################## +# 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 * + + +class Plumed(Package): + """PLUMED is an open source library for free energy calculations in + molecular systems which works together with some of the most popular + molecular dynamics engines. + + Free energy calculations can be performed as a function of many order + parameters with a particular focus on biological problems, using state + of the art methods such as metadynamics, umbrella sampling and + Jarzynski-equation based steered MD. + + The software, written in C++, can be easily interfaced with both fortran + and C/C++ codes. + """ + homepage = 'http://www.plumed.org/' + url = 'https://github.com/plumed/plumed2/archive/v2.2.3.tar.gz' + + version('2.2.3', 'a6e3863e40aac07eb8cf739cbd14ecf8') + + + variant('shared', default=True, description='Builds shared libraries') + variant('mpi', default=True, description='Activates MPI support') + variant('gsl', default=True, description='Activates GSL support') + + depends_on('zlib') + depends_on('blas') + depends_on('lapack') + + depends_on('mpi', when='+mpi') + depends_on('gsl', when='+gsl') + + def setup_dependent_package(self, module, ext_spec): + # Make plumed visible from dependent packages + module.plumed = Executable(join_path(self.spec.prefix.bin, 'plumed')) + + def install(self, spec, prefix): + # From plumed docs : + # Also consider that this is different with respect to what some other + # configure script does in that variables such as MPICXX are + # completely ignored here. In case you work on a machine where CXX is + # set to a serial compiler and MPICXX to a MPI compiler, to compile with + # MPI you should use: + # + # > ./configure CXX="$MPICXX" + configure_opts = ['CXX={0}'.format(spec['mpi'].mpicxx)] if '+mpi' in self.spec else [] + configure_opts.extend([ + '--prefix={0}'.format(prefix), + '--enable-shared={0}'.format('yes' if '+shared' in spec else 'no'), + '--enable-mpi={0}'.format('yes' if '+mpi' in spec else 'no'), + '--enable-gsl={0}'.format('yes' if '+gsl' in spec else 'no') + ]) + + configure(*configure_opts) + make() + make('install') -- cgit v1.2.3-70-g09d2 From 2f1c000f6231b7dbba899bf6e99b4535eba6a6a8 Mon Sep 17 00:00:00 2001 From: alalazo Date: Wed, 3 Aug 2016 08:26:58 +0200 Subject: qa : flake8 issues --- var/spack/repos/builtin/packages/plumed/package.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/var/spack/repos/builtin/packages/plumed/package.py b/var/spack/repos/builtin/packages/plumed/package.py index e8cd6d1894..32571455eb 100644 --- a/var/spack/repos/builtin/packages/plumed/package.py +++ b/var/spack/repos/builtin/packages/plumed/package.py @@ -44,7 +44,6 @@ class Plumed(Package): version('2.2.3', 'a6e3863e40aac07eb8cf739cbd14ecf8') - variant('shared', default=True, description='Builds shared libraries') variant('mpi', default=True, description='Activates MPI support') variant('gsl', default=True, description='Activates GSL support') @@ -65,14 +64,17 @@ class Plumed(Package): # Also consider that this is different with respect to what some other # configure script does in that variables such as MPICXX are # completely ignored here. In case you work on a machine where CXX is - # set to a serial compiler and MPICXX to a MPI compiler, to compile with - # MPI you should use: + # set to a serial compiler and MPICXX to a MPI compiler, to compile + # with MPI you should use: # # > ./configure CXX="$MPICXX" - configure_opts = ['CXX={0}'.format(spec['mpi'].mpicxx)] if '+mpi' in self.spec else [] + configure_opts = [ + 'CXX={0}'.format(spec['mpi'].mpicxx) + ] if '+mpi' in self.spec else [] + configure_opts.extend([ '--prefix={0}'.format(prefix), - '--enable-shared={0}'.format('yes' if '+shared' in spec else 'no'), + '--enable-shared={0}'.format('yes' if '+shared' in spec else 'no'), # NOQA: ignore=E501 '--enable-mpi={0}'.format('yes' if '+mpi' in spec else 'no'), '--enable-gsl={0}'.format('yes' if '+gsl' in spec else 'no') ]) -- cgit v1.2.3-70-g09d2