Repository: spack/spack

Issue:
Installation issue: ucx
I'm trying to build openmpi with ucx but on compiling ucx I get build errors with `error: implicit declaration of function`.

```console
     637      CC       libuct_rdmacm_la-rdmacm_iface.lo
     638      CC       libuct_rdmacm_la-rdmacm_ep.lo
     639      CC       libuct_rdmacm_la-rdmacm_cm.lo
     640      CC       libuct_rdmacm_la-rdmacm_listener.lo
     641      CC       libuct_rdmacm_la-rdmacm_cm_ep.lo
     642    rdmacm_cm.c: In function 'uct_rdmacm_cm_id_to_dev_addr':
  >> 643    rdmacm_cm.c:146:9: error: implicit declaration of function 'rdma_init_qp_attr' [-Werror=implicit-function-declaration]
     644      146 |     if (rdma_init_qp_attr(cm_id, &qp_attr, &qp_attr_mask)) {
     645          |         ^~~~~~~~~~~~~~~~~
     646    rdmacm_cm.c: In function 'uct_rdmacm_cm_handle_event_connect_response':
  >> 647    rdmacm_cm.c:269:9: error: implicit declaration of function 'rdma_establish' [-Werror=implicit-function-declaration]
     648      269 |     if (rdma_establish(event->id)) {
     649          |         ^~~~~~~~~~~~~~
     650    cc1: all warnings being treated as errors
     651    make[4]: *** [Makefile:670: libuct_rdmacm_la-rdmacm_cm.lo] Error 1
     652    make[4]: *** Waiting for unfinished jobs....
     653    make[4]: Leaving directory '/tmp/root/spack-stage/spack-stage-ucx-1.8.0-344rhrrnr7m3kpod3hg6bbwi4ml3nn5k/spack-src/src/uct/ib/rdmacm'

```

### Steps to reproduce the issue

```console
$ spack install openmpi+thread_multiple+pmi fabrics=ucx schedulers=slurm %gcc@9.3.0 ucx%gcc@9.3.0
```

### Information on your system

* **Spack:** 0.15.3-387-3a02d1a84
* **Python:** 3.6.8
* **Platform:** linux-centos8-zen2

### Additional information

* [spack-build-out.txt](https://github.com/spack/spack/files/5021896/spack-build-out.txt)

I have slurm locally installed, with the following in my .spack/packages.yaml :

```
  slurm:
    buildable: False
    paths:
      slurm@20-02-3-1: /usr
```


@hppritcha 

### General information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [x] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [x] I have uploaded the build log and environment files
- [x] I have searched the issues of this repo and believe this is not a duplicate



Discussion:
Do you have the latest infiniband driver installed and if so, what's the version of the infiniband driver you have on your system? 
What happens if you build this on a system with an older version of the infiniband driver?
I have the latest infiniband drivers installed from Mellanox. I'm using ConnectX-5 device with 16.27.2008 firmware version. I don't have an older version of the driver available which supports CentOS 8.2. I've tried manually building ucx from source and it works without any issues.
I am on CentOS8.2 as well with the latest IB drivers and am able to build from source without issue. Not able to pinpoint why the build for ucx through spack fails.
I get the same error. With gcc@9.2.0 when running `spack install openmpi@4.0.3 fabrics=ucx schedulers=auto`, which obviously installs ucx. System has ConnectX-6 cards.
So for me UCX 1.6.0 and 1.6.1 work, 1.7.0, 1.8.0 and 1.8.1 fail.

I ran:
```
spac install ucx@1.6.1%gcc@9.2.0~assertions~cuda~debug~gdrcopy~java~knem~logging+optimizations~parameter_checking+pic+thread_multiple~xpmem cuda_arch=none arch=linux-centos7-cascadelake
spack find -l ucx #a2tdcea
spack install openmpi@4.0.3 fabrics=ucx schedulers=auto ^ucx/a2tdcea
```

and this installed ok (haven't actually tested it yet).

I get the same error with UCX 1.7.0, 1.8.0 and 1.8.1, and 1.6.1 works.
Tried with:  GCC 9.3.0, GCC 8.3.0 and GCC 5.4.0

**Spack**: 0.15.4-1308-f83bd36
**Python**: 3.6.8
**OS**: CentOS Linux release 7.8.2003 

+1

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/rdma-core/package.py b/var/spack/repos/builtin/packages/rdma-core/package.py
--- a/var/spack/repos/builtin/packages/rdma-core/package.py
+++ b/var/spack/repos/builtin/packages/rdma-core/package.py
@@ -12,6 +12,15 @@ class RdmaCore(CMakePackage):
     homepage = "https://github.com/linux-rdma/rdma-core"
     url      = "https://github.com/linux-rdma/rdma-core/releases/download/v17.1/rdma-core-17.1.tar.gz"
 
+    version('32.0', sha256='8197e20a59990b9b06a2e4c83f4a96802fc080ec1669392b643b59b6023931fc')
+    version('31.0', sha256='51ae9a3ab81cd6834436813fafc310c8b7007feae9d09a53fdd5c169e648d50b')
+    version('30.0', sha256='23e1bd2d7b38149a1621ee577a3428ac652e305adb8e0eee923cbe71356a9bf9')
+    version('28.1', sha256='d9961fd9b0867f17cb6a30a728562f00528b63dd72d1168d838220ab44e5c713')
+    version('27.1', sha256='39eeb3ab5f868ef3a5f7623d1ee69adca04efabe2a37de8080f354b8f4ef0ad7')
+    version('26.2', sha256='115087ab438bea3530a0d520640f1eeb5872b902ee2263acf83dcc7835d296c6')
+    version('25.4', sha256='f622491b0aac819f05c73174e0c7a9e630cc02fc0914d5ba1bb1d87fc4d313fd')
+    version('24.3', sha256='3a02d2d864258acc763849c635c815e3fa6a798a1464511cd3a2a370ddd6ee89')
+    version('23.4', sha256='6bfe009e9a382085def3b004d9396f7255a2e0c90c36647d1df0b86773d21a79')
     version('20', sha256='bc846989f807cd2b03643927d2b99fbf6f849cb1e766ab49bc9e81ce769d5421')
     version('17.1', sha256='b47444b7c05d3906deb8771eec3e634984dd83f5e620d5e37d3a83f74f0cc1ba')
     version('13', sha256='e5230fd7cda610753ad1252b40a28b1e9cf836423a10d8c2525b081527760d97')


Test patch: