diff --git a/var/spack/repos/builtin/packages/pvm/package.py b/var/spack/repos/builtin/packages/pvm/package.py index 3e052f563f..887969e868 100644 --- a/var/spack/repos/builtin/packages/pvm/package.py +++ b/var/spack/repos/builtin/packages/pvm/package.py @@ -26,10 +26,11 @@ class Pvm(MakefilePackage): parallel = False - @property - def pvm_arch(self): + @staticmethod + def pvm_arch(root): """Returns the appropriate PVM_ARCH.""" - process = subprocess.Popen(['lib/pvmgetarch'], stdout=subprocess.PIPE) + process = subprocess.Popen([ + join_path(root, 'lib', 'pvmgetarch')], stdout=subprocess.PIPE) return process.communicate()[0].strip().decode() def edit(self, spec, prefix): @@ -39,7 +40,7 @@ def edit(self, spec, prefix): def patch(self): - pvm_arch = self.pvm_arch + pvm_arch = self.pvm_arch(self.stage.source_path) if '+fpic' in self.spec: filter_file( @@ -57,14 +58,17 @@ def setup_build_environment(self, env): env.set('SPACK_LDLIBS', '-ltirpc') def install(self, spec, prefix): - pvm_arch = self.pvm_arch - install_tree(join_path('bin', pvm_arch), prefix.bin) + install_tree('bin', prefix.bin) install_tree('include', prefix.include) - install_tree(join_path('lib', pvm_arch), prefix.lib) + install_tree('lib', prefix.lib) install_tree('man', prefix.man) def setup_run_environment(self, env): # Before running PVM, you must set the environment # variable "PVM_ROOT" to the path where PVM resides + pvm_arch = self.pvm_arch(self.prefix) env.set('PVM_ROOT', self.prefix) + env.set('PVM_ARCH', pvm_arch) + env.prepend_path('PATH', join_path(self.prefix, 'lib')) + env.prepend_path('PATH', join_path(self.prefix, 'lib', pvm_arch))