summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-08-25 02:45:33 -0700
committerGitHub <noreply@github.com>2016-08-25 02:45:33 -0700
commit8170bcfcdd14b2cd3c6c3b91e6864d588ba9cf2b (patch)
tree20dc1197d13a556dc47062b5e0bcde5c45763962
parent22d27869400df52da8501da81c72253a0af02f8a (diff)
parent07e0da24c5614533a93c392cf2b6f03c8b00b949 (diff)
downloadspack-8170bcfcdd14b2cd3c6c3b91e6864d588ba9cf2b.tar.gz
spack-8170bcfcdd14b2cd3c6c3b91e6864d588ba9cf2b.tar.bz2
spack-8170bcfcdd14b2cd3c6c3b91e6864d588ba9cf2b.tar.xz
spack-8170bcfcdd14b2cd3c6c3b91e6864d588ba9cf2b.zip
Merge pull request #1574 from ARCCA/plumed-push
Update plumed package to include optional modules
-rw-r--r--var/spack/repos/builtin/packages/plumed/package.py48
1 files changed, 43 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/plumed/package.py b/var/spack/repos/builtin/packages/plumed/package.py
index b670b4c2b8..79632abf38 100644
--- a/var/spack/repos/builtin/packages/plumed/package.py
+++ b/var/spack/repos/builtin/packages/plumed/package.py
@@ -45,10 +45,20 @@ class Plumed(Package):
version('2.2.3', 'a6e3863e40aac07eb8cf739cbd14ecf8')
+ # 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 intel-mpi package then
+ # the following additional argument is required to allow it to
+ # build.
+ if spec.satisfies('^intel-mpi'):
+ 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')