diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/openmpi/package.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 85c99889da..30a70d948f 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -52,6 +52,18 @@ def _verbs_dir(): return None +def _mxm_dir(): + """Look for default directory where the Mellanox package is + installed. Return None if not found. + """ + # Only using default directory; make this more flexible in the future + path = "/opt/mellanox/mxm" + if os.path.isdir(path): + return path + else: + return None + + class Openmpi(AutotoolsPackage): """The Open MPI Project is an open source Message Passing Interface implementation that is developed and maintained by a consortium @@ -251,6 +263,17 @@ class Openmpi(AutotoolsPackage): line += '={0}'.format(path) return line + def with_or_without_mxm(self, activated): + opt = 'mxm' + # If the option has not been activated return --without-mxm + if not activated: + return '--without-{0}'.format(opt) + line = '--with-{0}'.format(opt) + path = _mxm_dir() + if (path is not None): + line += '={0}'.format(path) + return line + @run_before('autoreconf') def die_without_fortran(self): # Until we can pass variants such as +fortran through virtual |