-
Notifications
You must be signed in to change notification settings - Fork 31
AMDGPUCompiler::addCompilationFlags
unconditionally adds system include directories
#49
Comments
@Mystro256, I would appreciate if you could have a look at this and forward it to the right people to get this fixed. |
@awehrfritz in the meantime, I've pushed a patch to the Fedora package: If that looks fine to you, I can cherry-pick it to Fedora 36 when I rebuild everything against LLVM 15. |
@awehrfritz Thanks for bringing this up! In general the way Comgr interacts with the environment for Clang/ROCm/HIP Include Paths needs an overhaul. We're working on deprecating the AMD_COMGR_ACTION_COMPILE_SOURCE_TO_FATBIN action (1a15280), and once it's removed we may be able to remove the ROCm/HIP paths entirely. I'll try to keep this issue updated, with the hopes that at some point in the future we may not need custom patches like @Mystro256's in this context |
Relating to this upstream bug: ROCm/ROCm-CompilerSupport#49 - remove redundant includes - fix libdir path
This should be resolved by ROCm/llvm-project@6eb9d12 Please open a new issue at https://github.com/ROCm/llvm-project if you're still able to recreate this though! Thanks! |
For installations in
/usr
, such as in the Fedora, Debian or Gentoo packages,ROCMIncludePath
andHIPIncludePath
are both set to/usr/include
. Adding them to the system include directories messes up the order and leads to compilation errors, as discussed e.g. on the Debian mailing list.If
ROCMIncludePath
andHIPIncludePath
are set to/usr/include
or some other path already in the search path of clang, they should not be added. Here the respective code:https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/blob/846cd67177bcf91dbbb941d525fff99d04364a0b/lib/comgr/src/comgr-compiler.cpp#L1017-L1020
In the Gentoo package build, they simply delete those lines to fix the issues.
Also,
ClangIncludePath
andClangIncludePath2
are not set correctly for such installation:https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/blob/846cd67177bcf91dbbb941d525fff99d04364a0b/lib/comgr/src/comgr-compiler.cpp#L991-L995
Gentoo has a patch to fix this: https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-libs/rocm-comgr/files/rocm-comgr-5.1.3-Find-CLANG_RESOURCE_DIR.patch
On my Fedora 36 system,
clang -print-resource-dir
yields/usr/lib64/clang/14.0.0
which would be the correctClangIncludePath
. However, that is already included in the compiler command, and adding it again may mess up the include order, similar as withROCMIncludePath
andHIPIncludePath
.The text was updated successfully, but these errors were encountered: