summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2016-03-15 13:36:41 +0100
committeralalazo <massimiliano.culpo@googlemail.com>2016-03-15 13:36:41 +0100
commitc85888eb5763d453af7b7255b6d8c3461082362f (patch)
treea51d511e028572337a146cdc77f6cc967dc1616f /var
parentbcea1df01ce145aea5e49eaaceb7a063b44ddf80 (diff)
downloadspack-c85888eb5763d453af7b7255b6d8c3461082362f.tar.gz
spack-c85888eb5763d453af7b7255b6d8c3461082362f.tar.bz2
spack-c85888eb5763d453af7b7255b6d8c3461082362f.tar.xz
spack-c85888eb5763d453af7b7255b6d8c3461082362f.zip
package : added `environment_modifications`
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/mpich/package.py16
-rw-r--r--var/spack/repos/builtin/packages/netlib-scalapack/package.py3
-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.py12
-rw-r--r--var/spack/repos/builtin/packages/ruby/package.py22
6 files changed, 50 insertions, 37 deletions
diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py
index e2b3654c19..c85e8febf3 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 environment_modifications(self, module, spec, dependent_spec):
+ env = super(Mpich, self).environment_modifications(module, spec, 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 setup_dependent_environment(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/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py
index 22d538560e..6dbf367475 100644
--- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py
+++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py
@@ -46,5 +46,4 @@ class NetlibScalapack(Package):
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..83a3fe7a4f 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, module, spec, dependent_spec):
+ env = super(Openmpi, self).environment_modifications(module, spec, 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..39ced0a120 100644
--- a/var/spack/repos/builtin/packages/python/package.py
+++ b/var/spack/repos/builtin/packages/python/package.py
@@ -90,6 +90,17 @@ class Python(Package):
return os.path.join(self.python_lib_dir, 'site-packages')
+ def environment_modifications(self, module, spec, dependent_spec):
+ env = super(Python, self).environment_modifications(module, spec, dependent_spec)
+ # 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))
+ env.set_env['PYTHONPATH'] = ':'.join(python_paths)
+
+
def setup_dependent_environment(self, module, spec, ext_spec):
"""Called before python modules' install() methods.
@@ -111,15 +122,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 91afa420c1..373623cd95 100644
--- a/var/spack/repos/builtin/packages/qt/package.py
+++ b/var/spack/repos/builtin/packages/qt/package.py
@@ -52,11 +52,13 @@ 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, module, spec, dep_spec):
+ """
+ Dependencies of Qt find it using the QTDIR environment variable
+ """
+ env = super(Qt, self).environment_modifications(module, spec, dep_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..9ec0afa268 100644
--- a/var/spack/repos/builtin/packages/ruby/package.py
+++ b/var/spack/repos/builtin/packages/ruby/package.py
@@ -15,10 +15,21 @@ class Ruby(Package):
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
-
make()
make("install")
+ def environment_modifications(self, module, spec, ext_spec):
+ env = super(Ruby, self).environment_modifications(module, spec, ext_spec)
+ # 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)
+ env.set_env('GEM_PATH', concatenate_paths(ruby_paths))
+ # The actual installation path for this gem
+ env.set_env('GEM_HOME', ext_spec.prefix)
+ return env
+
def setup_dependent_environment(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 +42,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
+