diff options
author | Andrew Williams <andrew@alshain.org.uk> | 2016-08-22 12:15:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-22 12:15:35 +0100 |
commit | 4b354cbe261da27e26e9f81e00b768bae2cedf25 (patch) | |
tree | 3f315795b178459c97512efdc9b13589a6bccf83 | |
parent | e6a122417aee3dbb0f83c92d23a408a855b07c40 (diff) | |
parent | 226d4f04f3b931755124f6b56741cd89099a3fec (diff) | |
download | spack-4b354cbe261da27e26e9f81e00b768bae2cedf25.tar.gz spack-4b354cbe261da27e26e9f81e00b768bae2cedf25.tar.bz2 spack-4b354cbe261da27e26e9f81e00b768bae2cedf25.tar.xz spack-4b354cbe261da27e26e9f81e00b768bae2cedf25.zip |
Merge pull request #1 from ARCCA/plumed
Plumed
-rw-r--r-- | etc/spack/packages.yaml | 8 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/intelmpi/package.py | 51 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/plumed/package.py | 52 |
3 files changed, 104 insertions, 7 deletions
diff --git a/etc/spack/packages.yaml b/etc/spack/packages.yaml new file mode 100644 index 0000000000..abdd888351 --- /dev/null +++ b/etc/spack/packages.yaml @@ -0,0 +1,8 @@ +packages: + intelmpi: + paths: + intelmpi@4.1.0%gcc@4.4.7 arch=linux-x86_64: /software/compilers/intel/13.0/impi/4.1.0.024/intel64 + buildable: False +# all: +# providers: +# mpi: [intelmpi] diff --git a/var/spack/repos/builtin/packages/intelmpi/package.py b/var/spack/repos/builtin/packages/intelmpi/package.py new file mode 100644 index 0000000000..5a0382a392 --- /dev/null +++ b/var/spack/repos/builtin/packages/intelmpi/package.py @@ -0,0 +1,51 @@ +############################################################################## +# 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 Intelmpi(Package): + """Intel MPI""" + + homepage = "http://www.example.com" + url = "https://software.intel.com/en-us/intel-mpi-library" + + version('4.1.0') + + # Provides a virtual dependency 'mpi' + provides('mpi') + + def setup_dependent_environment(self, spack_env, run_env, dependent_spec): + spack_env.set('MPICC', join_path(self.prefix.bin, 'mpicc')) + spack_env.set('MPICXX', join_path(self.prefix.bin, 'mpicxx')) + spack_env.set('MPIF77', join_path(self.prefix.bin, 'mpif77')) + spack_env.set('MPIF90', join_path(self.prefix.bin, 'mpif90')) + # NOTE: Need to find a better way of setting this compiler argument + # which is only required when building packages with intelmpi. + spack_env.set('CXXFLAGS', '-DMPICH_IGNORE_CXX_SEEK') + + def setup_dependent_package(self, module, dep_spec): + self.spec.mpicc = join_path(self.prefix.bin, 'mpicc') + self.spec.mpicxx = join_path(self.prefix.bin, 'mpicxx') + self.spec.mpifc = join_path(self.prefix.bin, 'mpif90') + self.spec.mpif77 = join_path(self.prefix.bin, 'mpif77') diff --git a/var/spack/repos/builtin/packages/plumed/package.py b/var/spack/repos/builtin/packages/plumed/package.py index b670b4c2b8..8a0e631463 100644 --- a/var/spack/repos/builtin/packages/plumed/package.py +++ b/var/spack/repos/builtin/packages/plumed/package.py @@ -41,14 +41,24 @@ class Plumed(Package): and C/C++ codes. """ homepage = 'http://www.plumed.org/' - url = 'https://github.com/plumed/plumed2/archive/v2.2.3.tar.gz' + url = 'https://github.com/plumed/plumed2' - version('2.2.3', 'a6e3863e40aac07eb8cf739cbd14ecf8') + version('2.2.3', git="https://github.com/plumed/plumed2.git", tag='v2.2.3') + # Variants. PLUMED by default builds a number of optional modules. + # The ones listed here are not built by default for various reasons, + # such as stability, lack of testing, or lack of demand. + variant('crystallization', default=False, + description='Build support for optional crystallization module.') + variant('imd', default=False, + description='Build support for optional imd module.') + variant('manyrestraints', default=False, + description='Build support for optional manyrestraints module.') variant('shared', default=True, description='Builds shared libraries') variant('mpi', default=True, description='Activates MPI support') variant('gsl', default=True, description='Activates GSL support') + # Dependencies. LAPACK and BLAS are recommended but not essential. depends_on('zlib') depends_on('blas') depends_on('lapack') @@ -96,17 +106,45 @@ class Plumed(Package): # with MPI you should use: # # > ./configure CXX="$MPICXX" - configure_opts = [ - 'CXX={0}'.format(spec['mpi'].mpicxx) - ] if '+mpi' in self.spec else [] + configure_opts = ['--prefix=' + prefix] + # If using MPI then ensure the correct compiler wrapper is used. + if '+mpi' in spec: + configure_opts.extend([ + '--enable-mpi', + 'CXX={0}'.format(spec['mpi'].mpicxx) + ]) + + # If the MPI dependency is provided by the intelmpi package then + # the following additional argument is required to allow it to + # build. + if spec.satisfies('^intelmpi'): + configure_opts.extend([ + 'STATIC_LIBS=-mt_mpi' + ]) + + # Additional arguments 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') ]) + # Construct list of optional modules + module_opts = [] + module_opts.extend([ + '+crystallization' if ( + '+crystallization' in spec) else '-crystallization', + '+imd' if '+imd' in spec else '-imd', + '+manyrestraints' if ( + '+manyrestraints' in spec) else '-manyrestraints' + ]) + + # If we have specified any optional modules then add the argument to + # enable or disable them. + if module_opts: + configure_opts.extend([ + '--enable-modules={0}'.format("".join(module_opts))]) + configure(*configure_opts) make() make('install') |