From e621f550bcdc54fbfe4d45f739fade0bf164f481 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Tue, 18 Oct 2016 22:38:04 +0300 Subject: [PATCH] [hipcc] A workaround for [SWDEV-105366] HCC's omitting of system includes while compiling kernel code leads to 'file not found' error. Missing includes are set explicitly. Workaround is switched on by default, to disable it set HCC_SYS_INCLUDES_WA=0. WA will be removed after fixing [SWDEV-105366]. [ROCm/hip commit: 2027fcd0a27cd963b35535de45916951695f8833] --- projects/hip/bin/hipcc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/projects/hip/bin/hipcc b/projects/hip/bin/hipcc index f536937455..ebce3414ae 100755 --- a/projects/hip/bin/hipcc +++ b/projects/hip/bin/hipcc @@ -91,6 +91,18 @@ if ($HIP_PLATFORM eq "hcc") { $HIPCC=$HCC; $HIPCXXFLAGS = $HCCFLAGS; + #### GCC system includes workaround #### + $WA = $ENV{'HCC_SYS_INCLUDES_WA'}; + if (!defined($WA) || ${WA} ne "0") { + 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}"; + } + } + $HIPCXXFLAGS .= " -I$HIP_PATH/include/hip/hcc_detail/cuda"; $HIPCXXFLAGS .= " -I$HSA_PATH/include"; $HIPCXXFLAGS .= " -Wno-deprecated-register";