From 9f5a4148ce90ea38e8fd43ab9ae6bf1871d0c85c Mon Sep 17 00:00:00 2001 From: Alexey Chernov <4ernov@gmail.com> Date: Fri, 24 Jan 2020 13:51:49 +0300 Subject: [PATCH] Clear `HIP_PATH` before version detection (#1786) Don't allow `HIP_PATH` to be propagated to `hipconfig`, when run by CMake to detect the package version, as it leads to the wrong version is detected: when there's already HIP of some different version installed in the system and `HIP_PATH` points to its location, `hipconfig` tends to return the version of the installed HIP, rather than the value defined for the distribution. The compiled results report wrong version and spoils the rest of the stack in this case. --- hipamd/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/hipamd/CMakeLists.txt b/hipamd/CMakeLists.txt index 9a1d940421..3eedf35b09 100644 --- a/hipamd/CMakeLists.txt +++ b/hipamd/CMakeLists.txt @@ -20,6 +20,7 @@ endmacro() # Setup version information ############################# # Determine HIP_BASE_VERSION +set(ENV{HIP_PATH} "") execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bin/hipconfig --version OUTPUT_VARIABLE HIP_BASE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)