This repository has been archived by the owner on Jan 26, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SWDEV-335902 - Fix HIP when Git info unavailable
Prior to this change, when Git_FOUND was false, HIP_VERSION_BUILD_ID would be undefined in the CMake code. The value of HIP_VERSION_BUILD_ID in <hip/hip_version.h> is taken from the CMake variable, so it was being defined as nothing in those cases. That would cause compilation failures, as src/hip_global.cpp contains the function: size_t amd_dbgapi_get_build_id() { return HIP_VERSION_BUILD_ID; } which would become size_t amd_dbgapi_get_build_id() { return ; } after preprocessing. To prevent this, we can define the version information to a default value when Git is not found. A related problem was reported by Harmen Stoppels in ROCm/HIP#2218. When Git is not available (or if the library is being built from a tarball), the HIP_VERSION_GITHASH is not defined. This causes trouble because HIP_LIB_VERSION_STRING is defined as "X.Y.Z-${HIP_VERSION_GITHASH}" and therefore becomes "X.Y.Z-". The incomplete version string becomes a problem when it is appended to the shared library file name. File names that end with '-' confuse the linker. They cause strange errors when attempting to link to the HIP library. This problem can be prevented by dropping the trailing dash and using "X.Y.Z" as the version string when HIP_VERSION_GITHASH is not defined. Change-Id: I6e290c1f1b603ba30c9ded885e125d9ca9a2e688 Signed-off-by: Cordell Bloor <Cordell.Bloor@amd.com>
- Loading branch information