Repository: spack/spack

Issue:
Add an option to install openmpi with ucx.
I need to build openmpi with [ucx](https://github.com/openucx/ucx) since openshmem (in openmpi 3.0.0) requires it.
To build openmpi with ucx:
1- Build ucx
2- Configure openmpi with `--with-ucx=/path/to/ucx `


Discussion:
You first have to package `ucx` in spack, see http://spack.readthedocs.io/en/latest/tutorial_packaging.html on how to get started.
@ChinouneMehdi: We'd gladly accept a PR for this feature!  Note that there is also a guide for [contributing to Spack](https://spack.readthedocs.io/en/latest/contribution_guide.html).

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py
--- a/var/spack/repos/builtin/packages/openmpi/package.py
+++ b/var/spack/repos/builtin/packages/openmpi/package.py
@@ -195,6 +195,7 @@ class Openmpi(AutotoolsPackage):
     variant('thread_multiple', default=False,
             description='Enable MPI_THREAD_MULTIPLE support')
     variant('cuda', default=False, description='Enable CUDA support')
+    variant('ucx', default=False, description='Enable UCX support')
 
     provides('mpi')
     provides('mpi@:2.2', when='@1.6.5')
@@ -205,6 +206,7 @@ class Openmpi(AutotoolsPackage):
     depends_on('hwloc +cuda', when='+cuda')
     depends_on('java', when='+java')
     depends_on('sqlite', when='+sqlite3@:1.11')
+    depends_on('ucx', when='+ucx')
 
     conflicts('+cuda', when='@:1.6')  # CUDA support was added in 1.7
     conflicts('fabrics=psm2', when='@:1.8')  # PSM2 support was added in 1.10.0
@@ -364,6 +366,12 @@ def configure_args(self):
             else:
                 config_args.append('--without-cuda')
 
+        # UCX support
+        if '+ucx' in spec:
+            config_args.append('--with-ucx={0}'.format(spec['ucx'].prefix))
+        else:
+            config_args.append('--without-ucx')
+
         return config_args
 
     @run_after('install')
diff --git a/var/spack/repos/builtin/packages/ucx/package.py b/var/spack/repos/builtin/packages/ucx/package.py
new file mode 100644
--- /dev/null
+++ b/var/spack/repos/builtin/packages/ucx/package.py
@@ -0,0 +1,35 @@
+##############################################################################
+# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
+# Produced at the Los Alamos National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/spack/spack
+# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class Ucx(AutotoolsPackage):
+    """a communication library implementing high-performance messaging for
+    MPI/PGAS frameworks"""
+
+    homepage = "http://www.openucx.org"
+    url      = "https://github.com/openucx/ucx/releases/download/v1.2.1/ucx-1.2.1.tar.gz"
+
+    version('1.2.1', '697c2fd7912614fb5a1dadff3bfa485c')


Test patch: