summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/openmpi/package.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py
index 4b054cf610..ef5a788c5e 100644
--- a/var/spack/repos/builtin/packages/openmpi/package.py
+++ b/var/spack/repos/builtin/packages/openmpi/package.py
@@ -45,6 +45,18 @@ def _mxm_dir():
return None
+def _tm_dir():
+ """Look for default directory where the PBS/TM package is
+ installed. Return None if not found.
+ """
+ # /opt/pbs from PBS 18+; make this more flexible in the future
+ paths_list = ("/opt/pbs", )
+ for path in paths_list:
+ if os.path.isdir(path) and os.path.isfile(path + "/include/tm.h"):
+ return path
+ return None
+
+
class Openmpi(AutotoolsPackage):
"""An open source Message Passing Interface implementation.
@@ -344,7 +356,18 @@ class Openmpi(AutotoolsPackage):
return '--without-{0}'.format(opt)
line = '--with-{0}'.format(opt)
path = _mxm_dir()
- if (path is not None):
+ if path is not None:
+ line += '={0}'.format(path)
+ return line
+
+ def with_or_without_tm(self, activated):
+ opt = 'tm'
+ # If the option has not been activated return --without-tm
+ if not activated:
+ return '--without-{0}'.format(opt)
+ line = '--with-{0}'.format(opt)
+ path = _tm_dir()
+ if path is not None:
line += '={0}'.format(path)
return line