summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/mpich/package.py18
-rw-r--r--var/spack/repos/builtin/packages/mvapich2/package.py2
-rw-r--r--var/spack/repos/builtin/packages/netlib-scalapack/package.py5
-rw-r--r--var/spack/repos/builtin/packages/openmpi/package.py14
-rw-r--r--var/spack/repos/builtin/packages/python/package.py20
-rw-r--r--var/spack/repos/builtin/packages/qt/package.py9
-rw-r--r--var/spack/repos/builtin/packages/ruby/package.py27
7 files changed, 51 insertions, 44 deletions
diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py
index e2b3654c19..d298981c92 100644
--- a/var/spack/repos/builtin/packages/mpich/package.py
+++ b/var/spack/repos/builtin/packages/mpich/package.py
@@ -46,14 +46,18 @@ class Mpich(Package):
provides('mpi@:3.0', when='@3:')
provides('mpi@:1.3', when='@1:')
- def setup_dependent_environment(self, module, spec, dep_spec):
+ def environment_modifications(self, dependent_spec):
+ env = super(Mpich, self).environment_modifications(dependent_spec)
+ env.set_env('MPICH_CC', os.environ['CC'])
+ env.set_env('MPICH_CXX', os.environ['CXX'])
+ env.set_env('MPICH_F77', os.environ['F77'])
+ env.set_env('MPICH_F90', os.environ['FC'])
+ env.set_env('MPICH_FC', os.environ['FC'])
+ return env
+
+ def module_modifications(self, module, spec, dep_spec):
"""For dependencies, make mpicc's use spack wrapper."""
- os.environ['MPICH_CC'] = os.environ['CC']
- os.environ['MPICH_CXX'] = os.environ['CXX']
- os.environ['MPICH_F77'] = os.environ['F77']
- os.environ['MPICH_F90'] = os.environ['FC']
- os.environ['MPICH_FC'] = os.environ['FC']
-
+ # FIXME : is this necessary ? Shouldn't this be part of a contract with MPI providers?
module.mpicc = join_path(self.prefix.bin, 'mpicc')
def install(self, spec, prefix):
diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py
index af5ed1b088..e4e95f92af 100644
--- a/var/spack/repos/builtin/packages/mvapich2/package.py
+++ b/var/spack/repos/builtin/packages/mvapich2/package.py
@@ -123,7 +123,7 @@ class Mvapich2(Package):
count += 1
if count > 1:
raise RuntimeError('network variants are mutually exclusive (only one can be selected at a time)')
-
+ network_options = []
# From here on I can suppose that only one variant has been selected
if self.enabled(Mvapich2.PSM) in spec:
network_options = ["--with-device=ch3:psm"]
diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py
index 22d538560e..ecdea46442 100644
--- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py
+++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py
@@ -40,11 +40,10 @@ class NetlibScalapack(Package):
make()
make("install")
- def setup_dependent_environment(self, module, spec, dependent_spec):
+ def module_modifications(self, module, spec, dependent_spec):
# TODO treat OS that are not Linux...
lib_suffix = '.so' if '+shared' in spec['scalapack'] else '.a'
spec['scalapack'].fc_link = '-L%s -lscalapack' % spec['scalapack'].prefix.lib
spec['scalapack'].cc_link = spec['scalapack'].fc_link
- spec['scalapack'].libraries = [join_path(spec['scalapack'].prefix.lib,
- 'libscalapack%s' % lib_suffix)]
+ spec['scalapack'].libraries = [join_path(spec['scalapack'].prefix.lib, 'libscalapack%s' % lib_suffix)]
diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py
index e4484af8c5..3a14170457 100644
--- a/var/spack/repos/builtin/packages/openmpi/package.py
+++ b/var/spack/repos/builtin/packages/openmpi/package.py
@@ -41,12 +41,14 @@ class Openmpi(Package):
def url_for_version(self, version):
return "http://www.open-mpi.org/software/ompi/v%s/downloads/openmpi-%s.tar.bz2" % (version.up_to(2), version)
- def setup_dependent_environment(self, module, spec, dep_spec):
- """For dependencies, make mpicc's use spack wrapper."""
- os.environ['OMPI_CC'] = 'cc'
- os.environ['OMPI_CXX'] = 'c++'
- os.environ['OMPI_FC'] = 'f90'
- os.environ['OMPI_F77'] = 'f77'
+ def environment_modifications(self, dependent_spec):
+ env = super(Openmpi, self).environment_modifications(dependent_spec)
+ # FIXME : the compilers should point to the current wrappers, not to generic cc etc.
+ env.set_env('OMPI_CC', 'cc')
+ env.set_env('OMPI_CXX', 'c++')
+ env.set_env('OMPI_FC', 'f90')
+ env.set_env('OMPI_F77', 'f77')
+ return env
def install(self, spec, prefix):
config_args = ["--prefix=%s" % prefix,
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py
index dd240d1ea0..307cec726b 100644
--- a/var/spack/repos/builtin/packages/python/package.py
+++ b/var/spack/repos/builtin/packages/python/package.py
@@ -89,8 +89,17 @@ class Python(Package):
def site_packages_dir(self):
return os.path.join(self.python_lib_dir, 'site-packages')
+ def environment_modifications(self, extension_spec):
+ env = super(Python, self).environment_modifications(extension_spec)
+ # Set PYTHONPATH to include site-packages dir for the
+ # extension and any other python extensions it depends on.
+ python_paths = []
+ for d in extension_spec.traverse():
+ if d.package.extends(self.spec):
+ python_paths.append(os.path.join(d.prefix, self.site_packages_dir))
+ env.set_env['PYTHONPATH'] = ':'.join(python_paths)
- def setup_dependent_environment(self, module, spec, ext_spec):
+ def module_modifications(self, module, spec, ext_spec):
"""Called before python modules' install() methods.
In most cases, extensions will only need to have one line::
@@ -111,15 +120,6 @@ class Python(Package):
# Make the site packages directory if it does not exist already.
mkdirp(module.site_packages_dir)
- # Set PYTHONPATH to include site-packages dir for the
- # extension and any other python extensions it depends on.
- python_paths = []
- for d in ext_spec.traverse():
- if d.package.extends(self.spec):
- python_paths.append(os.path.join(d.prefix, self.site_packages_dir))
- os.environ['PYTHONPATH'] = ':'.join(python_paths)
-
-
# ========================================================================
# Handle specifics of activating and deactivating python modules.
# ========================================================================
diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py
index ef5f05601f..0adf352be2 100644
--- a/var/spack/repos/builtin/packages/qt/package.py
+++ b/var/spack/repos/builtin/packages/qt/package.py
@@ -55,11 +55,10 @@ class Qt(Package):
depends_on("mesa", when='@4:+mesa')
depends_on("libxcb")
-
- def setup_dependent_environment(self, module, spec, dep_spec):
- """Dependencies of Qt find it using the QTDIR environment variable."""
- os.environ['QTDIR'] = self.prefix
-
+ def environment_modifications(self, dependent_spec):
+ env = super(Qt, self).environment_modifications(dependent_spec)
+ env.set_env['QTDIR'] = self.prefix
+ return env
def patch(self):
if self.spec.satisfies('@4'):
diff --git a/var/spack/repos/builtin/packages/ruby/package.py b/var/spack/repos/builtin/packages/ruby/package.py
index 6b6242362c..9caea30ef4 100644
--- a/var/spack/repos/builtin/packages/ruby/package.py
+++ b/var/spack/repos/builtin/packages/ruby/package.py
@@ -1,6 +1,5 @@
from spack import *
-import spack
-import os
+
class Ruby(Package):
"""A dynamic, open source programming language with a focus on
@@ -15,11 +14,22 @@ class Ruby(Package):
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
-
make()
make("install")
- def setup_dependent_environment(self, module, spec, ext_spec):
+ def environment_modifications(self, extension_spec):
+ env = super(Ruby, self).environment_modifications(extension_spec)
+ # Set GEM_PATH to include dependent gem directories
+ ruby_paths = []
+ for d in extension_spec.traverse():
+ if d.package.extends(self.spec):
+ ruby_paths.append(d.prefix)
+ env.set_env('GEM_PATH', concatenate_paths(ruby_paths))
+ # The actual installation path for this gem
+ env.set_env('GEM_HOME', extension_spec.prefix)
+ return env
+
+ def module_modifications(self, module, spec, ext_spec):
"""Called before ruby modules' install() methods. Sets GEM_HOME
and GEM_PATH to values appropriate for the package being built.
@@ -31,11 +41,4 @@ class Ruby(Package):
module.ruby = Executable(join_path(spec.prefix.bin, 'ruby'))
module.gem = Executable(join_path(spec.prefix.bin, 'gem'))
- # Set GEM_PATH to include dependent gem directories
- ruby_paths = []
- for d in ext_spec.traverse():
- if d.package.extends(self.spec):
- ruby_paths.append(d.prefix)
- os.environ['GEM_PATH'] = ':'.join(ruby_paths)
- # The actual installation path for this gem
- os.environ['GEM_HOME'] = ext_spec.prefix
+