Skip to content
Snippets Groups Projects
Commit 4b354cbe authored by Andrew Williams's avatar Andrew Williams Committed by GitHub
Browse files

Merge pull request #1 from ARCCA/plumed

Plumed
parents e6a12241 226d4f04
No related branches found
No related tags found
No related merge requests found
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]
##############################################################################
# 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')
...@@ -41,14 +41,24 @@ class Plumed(Package): ...@@ -41,14 +41,24 @@ class Plumed(Package):
and C/C++ codes. and C/C++ codes.
""" """
homepage = 'http://www.plumed.org/' 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('shared', default=True, description='Builds shared libraries')
variant('mpi', default=True, description='Activates MPI support') variant('mpi', default=True, description='Activates MPI support')
variant('gsl', default=True, description='Activates GSL support') variant('gsl', default=True, description='Activates GSL support')
# Dependencies. LAPACK and BLAS are recommended but not essential.
depends_on('zlib') depends_on('zlib')
depends_on('blas') depends_on('blas')
depends_on('lapack') depends_on('lapack')
...@@ -96,17 +106,45 @@ def install(self, spec, prefix): ...@@ -96,17 +106,45 @@ def install(self, spec, prefix):
# with MPI you should use: # with MPI you should use:
# #
# > ./configure CXX="$MPICXX" # > ./configure CXX="$MPICXX"
configure_opts = [ configure_opts = ['--prefix=' + prefix]
'CXX={0}'.format(spec['mpi'].mpicxx)
] if '+mpi' in self.spec else []
# 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([ 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'),
'--enable-mpi={0}'.format('yes' if '+mpi' in spec else 'no'),
'--enable-gsl={0}'.format('yes' if '+gsl' 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) configure(*configure_opts)
make() make()
make('install') make('install')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment