summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/turbine/package.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/turbine/package.py b/var/spack/repos/builtin/packages/turbine/package.py
index 636f3cec48..07a575c126 100644
--- a/var/spack/repos/builtin/packages/turbine/package.py
+++ b/var/spack/repos/builtin/packages/turbine/package.py
@@ -6,6 +6,8 @@
from spack import *
+import os
+
class Turbine(AutotoolsPackage):
"""Turbine: The Swift/T runtime"""
@@ -71,6 +73,13 @@ class Turbine(AutotoolsPackage):
args.append('--with-python-exe={0}'.format(
self.spec['python'].command.path))
if '+r' in self.spec:
- args.append('--with-r={0}/rlib/R'.format(
- self.spec['r'].prefix))
+ r_location = '{0}/rlib/R'.format(self.spec['r'].prefix)
+ if not os.path.exists(r_location):
+ rscript = which('Rscript')
+ if rscript is not None:
+ r_location = rscript('-e', 'cat(R.home())', output=str)
+ else:
+ msg = 'Could not locate Rscript on your PATH!'
+ raise RuntimeError(msg)
+ args.append('--with-r={0}'.format(r_location))
return args