From d537bb385998ce2308be63eb6ae992e83785bddf Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 19 Aug 2020 10:47:32 -0400 Subject: [PATCH] Fix hipcc for extracing clang version On teamcity clang --version returns something like clang version 12.0.0 Target: x86_64-unknown-linux-gnu currently hipcc does not handle it correctly since [^ ] causes new line and Targe: matched. \S will make sure only version string matched. Change-Id: I3659d6daf89b709d2b001e6b8024d69d8b79efc0 --- bin/hipcc | 2 +- bin/hipconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/hipcc b/bin/hipcc index 22fd249bfd..0e3027e03a 100755 --- a/bin/hipcc +++ b/bin/hipcc @@ -201,7 +201,7 @@ if ($HIP_PLATFORM eq "hcc" and $HIP_COMPILER eq "clang") { } $HIP_CLANG_VERSION = `$HIPCC --version`; - $HIP_CLANG_VERSION=~/.*clang version ([^ ]+).*/; + $HIP_CLANG_VERSION=~/.*clang version (\S+).*/; $HIP_CLANG_VERSION=$1; if (! defined $HIP_CLANG_INCLUDE_PATH) { diff --git a/bin/hipconfig b/bin/hipconfig index 8659669f5f..b0c01796cc 100755 --- a/bin/hipconfig +++ b/bin/hipconfig @@ -139,7 +139,7 @@ if ($HIP_COMPILER eq "clang") { $HIP_CLANG_PATH = "$HIP_ROCCLR_HOME/bin"; } $HIP_CLANG_VERSION = `$HIP_CLANG_PATH/clang++ --version`; - $HIP_CLANG_VERSION=~/.*clang version ([^ ]+).*/; + $HIP_CLANG_VERSION=~/.*clang version (\S+).*/; $HIP_CLANG_VERSION=$1; $CPP_CONFIG = " -D__HIP_PLATFORM_HCC__= -I$HIP_PATH/include -I$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION -I$HSA_PATH/include";