hipcc: HCC workaround no longer needs env var
Change-Id: I81f4eafddbda5e9e2f1082932dd502ab451cfc24
This commit is contained in:
@@ -76,6 +76,7 @@ if ($HIP_PLATFORM eq "hcc") {
|
||||
$HCC_HOME=$ENV{'HCC_HOME'} // $hipConfig{'HCC_HOME'} // "/opt/rocm/hcc";
|
||||
|
||||
$HCC_VERSION=`${HCC_HOME}/bin/hcc --version | cut -d" " -f9 | tr -d "\n"`;
|
||||
$HCC_VERSION_MAJOR=`${HCC_HOME}/bin/hcc --version | cut -d" " -f9 | cut -d"." -f1 | tr -d "\n"`;
|
||||
|
||||
$ROCM_PATH=$ENV{'ROCM_PATH'} // "/opt/rocm";
|
||||
|
||||
@@ -92,14 +93,14 @@ if ($HIP_PLATFORM eq "hcc") {
|
||||
$HIPCXXFLAGS = $HCCFLAGS;
|
||||
|
||||
#### GCC system includes workaround ####
|
||||
$WA = $ENV{'HIP_HCC_SYS_INCLUDES_WA'} // 0;
|
||||
if (${WA}) {
|
||||
$HCC_WA_FLAGS = " ";
|
||||
if ($HCC_VERSION_MAJOR eq 1) {
|
||||
my $GCC_CUR_VER = `gcc -dumpversion`;
|
||||
my $GPP_CUR_VER = `g++ -dumpversion`;
|
||||
$GCC_CUR_VER =~ s/\R//g;
|
||||
$GPP_CUR_VER =~ s/\R//g;
|
||||
if (${GCC_CUR_VER} eq ${GPP_CUR_VER}) {
|
||||
$HIPCXXFLAGS .= "-I/usr/include/x86_64-linux-gnu -I/usr/include/x86_64-linux-gnu/c++/${GCC_CUR_VER} -I/usr/include/c++/${GCC_CUR_VER}";
|
||||
$HCC_WA_FLAGS .= " -I/usr/include/x86_64-linux-gnu -I/usr/include/x86_64-linux-gnu/c++/${GCC_CUR_VER} -I/usr/include/c++/${GCC_CUR_VER} ";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,6 +261,7 @@ foreach $arg (@ARGV)
|
||||
if(($arg eq '-stdlib=libstdc++') and ($setStdLib eq 0))
|
||||
{
|
||||
$HIPCXXFLAGS .= " -stdlib=libstdc++";
|
||||
$HIPCXXFLAGS .= $HCC_WA_FLAGS;
|
||||
$setStdLib = 1;
|
||||
}
|
||||
if($arg eq '--version') {
|
||||
@@ -322,6 +324,7 @@ if ($buildDeps and $HIP_PLATFORM eq 'nvcc') {
|
||||
if ($setStdLib eq 0 and $HIP_PLATFORM eq 'hcc')
|
||||
{
|
||||
$HIPCXXFLAGS .= " -stdlib=libstdc++";
|
||||
$HIPCXXFLAGS .= $HCC_WA_FLAGS;
|
||||
}
|
||||
|
||||
if ($needHipHcc) {
|
||||
|
||||
Reference in New Issue
Block a user