We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN 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


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `var/spack/repos/builtin/packages/rdma-core/package.py`
Content:
```
1 # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
2 # Spack Project Developers. See the top-level COPYRIGHT file for details.
3 #
4 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
5 
6 from spack import *
7 
8 
9 class RdmaCore(CMakePackage):
10     """RDMA core userspace libraries and daemons"""
11 
12     homepage = "https://github.com/linux-rdma/rdma-core"
13     url      = "https://github.com/linux-rdma/rdma-core/releases/download/v17.1/rdma-core-17.1.tar.gz"
14 
15     version('20', sha256='bc846989f807cd2b03643927d2b99fbf6f849cb1e766ab49bc9e81ce769d5421')
16     version('17.1', sha256='b47444b7c05d3906deb8771eec3e634984dd83f5e620d5e37d3a83f74f0cc1ba')
17     version('13', sha256='e5230fd7cda610753ad1252b40a28b1e9cf836423a10d8c2525b081527760d97')
18 
19     depends_on('pkgconfig', type='build')
20     depends_on('libnl')
21     conflicts('platform=darwin', msg='rdma-core requires FreeBSD or Linux')
22     conflicts('%intel', msg='rdma-core cannot be built with intel (use gcc instead)')
23 
24 # NOTE: specify CMAKE_INSTALL_RUNDIR explicitly to prevent rdma-core from
25 #       using the spack staging build dir (which may be a very long file
26 #       system path) as a component in compile-time static strings such as
27 #       IBACM_SERVER_PATH.
28     def cmake_args(self):
29         cmake_args = ["-DCMAKE_INSTALL_SYSCONFDIR=" +
30                       self.spec.prefix.etc,
31                       "-DCMAKE_INSTALL_RUNDIR=/var/run"]
32         return cmake_args
33
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

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 @@
     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')

{"golden_diff": "diff --git a/var/spack/repos/builtin/packages/rdma-core/package.py b/var/spack/repos/builtin/packages/rdma-core/package.py\n--- a/var/spack/repos/builtin/packages/rdma-core/package.py\n+++ b/var/spack/repos/builtin/packages/rdma-core/package.py\n@@ -12,6 +12,15 @@\n     homepage = \"https://github.com/linux-rdma/rdma-core\"\n     url      = \"https://github.com/linux-rdma/rdma-core/releases/download/v17.1/rdma-core-17.1.tar.gz\"\n \n+    version('32.0', sha256='8197e20a59990b9b06a2e4c83f4a96802fc080ec1669392b643b59b6023931fc')\n+    version('31.0', sha256='51ae9a3ab81cd6834436813fafc310c8b7007feae9d09a53fdd5c169e648d50b')\n+    version('30.0', sha256='23e1bd2d7b38149a1621ee577a3428ac652e305adb8e0eee923cbe71356a9bf9')\n+    version('28.1', sha256='d9961fd9b0867f17cb6a30a728562f00528b63dd72d1168d838220ab44e5c713')\n+    version('27.1', sha256='39eeb3ab5f868ef3a5f7623d1ee69adca04efabe2a37de8080f354b8f4ef0ad7')\n+    version('26.2', sha256='115087ab438bea3530a0d520640f1eeb5872b902ee2263acf83dcc7835d296c6')\n+    version('25.4', sha256='f622491b0aac819f05c73174e0c7a9e630cc02fc0914d5ba1bb1d87fc4d313fd')\n+    version('24.3', sha256='3a02d2d864258acc763849c635c815e3fa6a798a1464511cd3a2a370ddd6ee89')\n+    version('23.4', sha256='6bfe009e9a382085def3b004d9396f7255a2e0c90c36647d1df0b86773d21a79')\n     version('20', sha256='bc846989f807cd2b03643927d2b99fbf6f849cb1e766ab49bc9e81ce769d5421')\n     version('17.1', sha256='b47444b7c05d3906deb8771eec3e634984dd83f5e620d5e37d3a83f74f0cc1ba')\n     version('13', sha256='e5230fd7cda610753ad1252b40a28b1e9cf836423a10d8c2525b081527760d97')\n", "issue": "Installation issue: ucx\nI'm trying to build openmpi with ucx but on compiling ucx I get build errors with `error: implicit declaration of function`.\r\n\r\n```console\r\n     637      CC       libuct_rdmacm_la-rdmacm_iface.lo\r\n     638      CC       libuct_rdmacm_la-rdmacm_ep.lo\r\n     639      CC       libuct_rdmacm_la-rdmacm_cm.lo\r\n     640      CC       libuct_rdmacm_la-rdmacm_listener.lo\r\n     641      CC       libuct_rdmacm_la-rdmacm_cm_ep.lo\r\n     642    rdmacm_cm.c: In function 'uct_rdmacm_cm_id_to_dev_addr':\r\n  >> 643    rdmacm_cm.c:146:9: error: implicit declaration of function 'rdma_init_qp_attr' [-Werror=implicit-function-declaration]\r\n     644      146 |     if (rdma_init_qp_attr(cm_id, &qp_attr, &qp_attr_mask)) {\r\n     645          |         ^~~~~~~~~~~~~~~~~\r\n     646    rdmacm_cm.c: In function 'uct_rdmacm_cm_handle_event_connect_response':\r\n  >> 647    rdmacm_cm.c:269:9: error: implicit declaration of function 'rdma_establish' [-Werror=implicit-function-declaration]\r\n     648      269 |     if (rdma_establish(event->id)) {\r\n     649          |         ^~~~~~~~~~~~~~\r\n     650    cc1: all warnings being treated as errors\r\n     651    make[4]: *** [Makefile:670: libuct_rdmacm_la-rdmacm_cm.lo] Error 1\r\n     652    make[4]: *** Waiting for unfinished jobs....\r\n     653    make[4]: Leaving directory '/tmp/root/spack-stage/spack-stage-ucx-1.8.0-344rhrrnr7m3kpod3hg6bbwi4ml3nn5k/spack-src/src/uct/ib/rdmacm'\r\n\r\n```\r\n\r\n### Steps to reproduce the issue\r\n\r\n```console\r\n$ spack install openmpi+thread_multiple+pmi fabrics=ucx schedulers=slurm %gcc@9.3.0 ucx%gcc@9.3.0\r\n```\r\n\r\n### Information on your system\r\n\r\n* **Spack:** 0.15.3-387-3a02d1a84\r\n* **Python:** 3.6.8\r\n* **Platform:** linux-centos8-zen2\r\n\r\n### Additional information\r\n\r\n* [spack-build-out.txt](https://github.com/spack/spack/files/5021896/spack-build-out.txt)\r\n\r\nI have slurm locally installed, with the following in my .spack/packages.yaml :\r\n\r\n```\r\n  slurm:\r\n    buildable: False\r\n    paths:\r\n      slurm@20-02-3-1: /usr\r\n```\r\n\r\n\r\n@hppritcha \r\n\r\n### General information\r\n\r\n<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->\r\n- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform\r\n- [x] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers\r\n- [x] I have uploaded the build log and environment files\r\n- [x] I have searched the issues of this repo and believe this is not a duplicate\r\n\n", "before_files": [{"content": "# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other\n# Spack Project Developers. See the top-level COPYRIGHT file for details.\n#\n# SPDX-License-Identifier: (Apache-2.0 OR MIT)\n\nfrom spack import *\n\n\nclass RdmaCore(CMakePackage):\n    \"\"\"RDMA core userspace libraries and daemons\"\"\"\n\n    homepage = \"https://github.com/linux-rdma/rdma-core\"\n    url      = \"https://github.com/linux-rdma/rdma-core/releases/download/v17.1/rdma-core-17.1.tar.gz\"\n\n    version('20', sha256='bc846989f807cd2b03643927d2b99fbf6f849cb1e766ab49bc9e81ce769d5421')\n    version('17.1', sha256='b47444b7c05d3906deb8771eec3e634984dd83f5e620d5e37d3a83f74f0cc1ba')\n    version('13', sha256='e5230fd7cda610753ad1252b40a28b1e9cf836423a10d8c2525b081527760d97')\n\n    depends_on('pkgconfig', type='build')\n    depends_on('libnl')\n    conflicts('platform=darwin', msg='rdma-core requires FreeBSD or Linux')\n    conflicts('%intel', msg='rdma-core cannot be built with intel (use gcc instead)')\n\n# NOTE: specify CMAKE_INSTALL_RUNDIR explicitly to prevent rdma-core from\n#       using the spack staging build dir (which may be a very long file\n#       system path) as a component in compile-time static strings such as\n#       IBACM_SERVER_PATH.\n    def cmake_args(self):\n        cmake_args = [\"-DCMAKE_INSTALL_SYSCONFDIR=\" +\n                      self.spec.prefix.etc,\n                      \"-DCMAKE_INSTALL_RUNDIR=/var/run\"]\n        return cmake_args\n", "path": "var/spack/repos/builtin/packages/rdma-core/package.py"}], "after_files": [{"content": "# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other\n# Spack Project Developers. See the top-level COPYRIGHT file for details.\n#\n# SPDX-License-Identifier: (Apache-2.0 OR MIT)\n\nfrom spack import *\n\n\nclass RdmaCore(CMakePackage):\n    \"\"\"RDMA core userspace libraries and daemons\"\"\"\n\n    homepage = \"https://github.com/linux-rdma/rdma-core\"\n    url      = \"https://github.com/linux-rdma/rdma-core/releases/download/v17.1/rdma-core-17.1.tar.gz\"\n\n    version('32.0', sha256='8197e20a59990b9b06a2e4c83f4a96802fc080ec1669392b643b59b6023931fc')\n    version('31.0', sha256='51ae9a3ab81cd6834436813fafc310c8b7007feae9d09a53fdd5c169e648d50b')\n    version('30.0', sha256='23e1bd2d7b38149a1621ee577a3428ac652e305adb8e0eee923cbe71356a9bf9')\n    version('28.1', sha256='d9961fd9b0867f17cb6a30a728562f00528b63dd72d1168d838220ab44e5c713')\n    version('27.1', sha256='39eeb3ab5f868ef3a5f7623d1ee69adca04efabe2a37de8080f354b8f4ef0ad7')\n    version('26.2', sha256='115087ab438bea3530a0d520640f1eeb5872b902ee2263acf83dcc7835d296c6')\n    version('25.4', sha256='f622491b0aac819f05c73174e0c7a9e630cc02fc0914d5ba1bb1d87fc4d313fd')\n    version('24.3', sha256='3a02d2d864258acc763849c635c815e3fa6a798a1464511cd3a2a370ddd6ee89')\n    version('23.4', sha256='6bfe009e9a382085def3b004d9396f7255a2e0c90c36647d1df0b86773d21a79')\n    version('20', sha256='bc846989f807cd2b03643927d2b99fbf6f849cb1e766ab49bc9e81ce769d5421')\n    version('17.1', sha256='b47444b7c05d3906deb8771eec3e634984dd83f5e620d5e37d3a83f74f0cc1ba')\n    version('13', sha256='e5230fd7cda610753ad1252b40a28b1e9cf836423a10d8c2525b081527760d97')\n\n    depends_on('pkgconfig', type='build')\n    depends_on('libnl')\n    conflicts('platform=darwin', msg='rdma-core requires FreeBSD or Linux')\n    conflicts('%intel', msg='rdma-core cannot be built with intel (use gcc instead)')\n\n# NOTE: specify CMAKE_INSTALL_RUNDIR explicitly to prevent rdma-core from\n#       using the spack staging build dir (which may be a very long file\n#       system path) as a component in compile-time static strings such as\n#       IBACM_SERVER_PATH.\n    def cmake_args(self):\n        cmake_args = [\"-DCMAKE_INSTALL_SYSCONFDIR=\" +\n                      self.spec.prefix.etc,\n                      \"-DCMAKE_INSTALL_RUNDIR=/var/run\"]\n        return cmake_args\n", "path": "var/spack/repos/builtin/packages/rdma-core/package.py"}]}