From 55c94329859099fc0a582e3a2e88c6037c3ce4cc Mon Sep 17 00:00:00 2001 From: Siu Chi Chan Date: Fri, 23 Sep 2022 15:13:13 -0400 Subject: [PATCH] SWDEV-355608 - Remove clang include path Clang doesn't need to be told where to find the clang headers Change-Id: I2d1e84b31013aa6668efd2ff096f5e68f9ba9a64 --- amd/hipcc/src/hipBin_amd.h | 46 ++++--------------------------------- amd/hipcc/src/hipBin_base.h | 1 - 2 files changed, 4 insertions(+), 43 deletions(-) diff --git a/amd/hipcc/src/hipBin_amd.h b/amd/hipcc/src/hipBin_amd.h index 155a600c4189b4..4821bb203133ed 100644 --- a/amd/hipcc/src/hipBin_amd.h +++ b/amd/hipcc/src/hipBin_amd.h @@ -64,7 +64,6 @@ class HipBinAmd : public HipBinBase { virtual string getDeviceLibPath() const; virtual string getHipLibPath() const; virtual string getHipCC() const; - virtual string getCompilerIncludePath(); virtual string getHipInclude() const; virtual void initializeHipCXXFlags(); virtual void initializeHipCFlags(); @@ -166,9 +165,6 @@ void HipBinAmd::initializeHipLdFlags() { void HipBinAmd::initializeHipCFlags() { string hipCFlags; - string hipclangIncludePath; - hipclangIncludePath = getHipInclude(); - hipCFlags += " -isystem \"" + hipclangIncludePath + "\""; const OsType& os = getOSInfo(); if (os != windows) { string hsaPath; @@ -203,12 +199,6 @@ string HipBinAmd::getHipInclude() const { void HipBinAmd::initializeHipCXXFlags() { string hipCXXFlags; const OsType& os = getOSInfo(); - string hipClangIncludePath; - hipClangIncludePath = getCompilerIncludePath(); - hipCXXFlags += " -isystem \"" + hipClangIncludePath; - fs::path hipCXXFlagsTempFs = hipCXXFlags; - hipCXXFlagsTempFs /= "..\""; - hipCXXFlags = hipCXXFlagsTempFs.string(); const EnvVariables& var = getEnvVariables(); // Allow __fp16 as function parameter and return type. if (var.hipClangHccCompactModeEnv_.compare("1") == 0) { @@ -324,28 +314,19 @@ string HipBinAmd::getCppConfig() { string compilerVersion; compilerVersion = getCompilerVersion(); - fs::path hipPathInclude, hipClangInclude, cppConfigFs; - string hipClangVersionPath; + fs::path hipPathInclude, cppConfigFs; const string& hipPath = getHipPath(); hipPathInclude = hipPath; hipPathInclude /= "include"; - - const string& compilerPath = getCompilerPath(); - hipClangInclude = compilerPath; - hipClangInclude = hipClangInclude.parent_path(); - hipClangInclude /= "lib/clang/"; - hipClangInclude /= compilerVersion; - string hipClangPath = hipClangInclude.string(); - const OsType& osInfo = getOSInfo(); if (osInfo == windows) { - cppConfig += " -I" + hipPathInclude.string() + " -I" + hipClangPath; + cppConfig += " -I" + hipPathInclude.string(); cppConfigFs = cppConfig; cppConfigFs /= "/"; } else { const string& hsaPath = getHsaPath(); cppConfig += " -I" + hipPathInclude.string() + - " -I" + hipClangPath + " -I" + hsaPath; + " -I" + hsaPath; cppConfigFs = cppConfig; cppConfigFs /= "include"; cppConfig = cppConfigFs.string(); @@ -439,23 +420,6 @@ string HipBinAmd::getHipCC() const { return hipCC; } - - -string HipBinAmd::getCompilerIncludePath() { - string hipClangVersion, includePath, compilerIncludePath; - const string& hipClangPath = getCompilerPath(); - hipClangVersion = getCompilerVersion(); - fs::path includePathfs = hipClangPath; - includePathfs = includePathfs.parent_path(); - includePathfs /= "lib/clang/"; - includePathfs /= hipClangVersion; - includePathfs /= "include"; - includePathfs = fs::absolute(includePathfs).string(); - compilerIncludePath = includePathfs.string(); - return compilerIncludePath; -} - - void HipBinAmd::checkHipconfig() { printFull(); cout << endl << "Check system installation: " << endl; @@ -581,14 +545,13 @@ void HipBinAmd::executeHipCCCmd(vector argv) { HIPCXXFLAGS = getHipCXXFlags(); HIPLDFLAGS = getHipLdFlags(); string hipLibPath; - string hipclangIncludePath , hipIncludePath, deviceLibPath; + string hipIncludePath, deviceLibPath; hipLibPath = getHipLibPath(); const string& roccmPath = getRoccmPath(); const string& hipPath = getHipPath(); const PlatformInfo& platformInfo = getPlatformInfo(); const string& rocclrHomePath = getRocclrHomePath(); const string& hipClangPath = getCompilerPath(); - hipclangIncludePath = getCompilerIncludePath(); hipIncludePath = getHipInclude(); deviceLibPath = getDeviceLibPath(); const string& hipVersion = getHipVersion(); @@ -600,7 +563,6 @@ void HipBinAmd::executeHipCCCmd(vector argv) { cout << "ROCM_PATH=" << roccmPath << endl; cout << "HIP_ROCCLR_HOME="<< rocclrHomePath << endl; cout << "HIP_CLANG_PATH=" << hipClangPath <