bugfix rmda-core external find library (#34484)

* Added a more robust check for an external version of the library.
Included a guard to identify when the library gives no discernible
version information and then to substitute with "unknown_ver"
identifier.
This commit is contained in:
Brian Van Essen 2023-01-12 11:41:17 -08:00 committed by GitHub
parent c0b458e38a
commit e804671fc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,7 +64,12 @@ class RdmaCore(CMakePackage):
@classmethod @classmethod
def determine_version(cls, lib): def determine_version(cls, lib):
match = re.search(r"lib\S*\.so\.\d+\.\d+\.(\d+\.\d+)", lib) match = re.search(r"lib\S*\.so\.\d+\.\d+\.(\d+(?:\.\d+)?)", lib)
if match and match.group(1) == "0":
# On some systems there is a truncated shared library name that does not
# sufficient version information, return a clear indicator of that
return "unknown_ver"
return match.group(1) if match else None return match.group(1) if match else None
# NOTE: specify CMAKE_INSTALL_RUNDIR explicitly to prevent rdma-core from # NOTE: specify CMAKE_INSTALL_RUNDIR explicitly to prevent rdma-core from