================ @@ -345,7 +345,13 @@ void Flang::AddAMDGPUTargetArgs(const ArgList &Args, // Check ROCm path if specified const ToolChain &TC = getToolChain(); - TC.getDeviceLibs(Args); + std::string HIPVersion; + llvm::raw_string_ostream HIPInfo(HIPVersion); + TC.printVerboseInfo(HIPInfo); + llvm::StringRef HIPInfoStrRef(HIPInfo.str()); + if (!HIPInfoStrRef.contains("Found HIP installation") && ---------------- DominikAdamski wrote:
Clang reports an error if `--rocm-path` points to an invalid directory. I need to do a similar check for Flang. The ROCm toolchain checks rocm-path within function `RocmInstallationDetector::checkCommonBitcodeLibs`. This function is called inside `ROCMToolChain::addClangTargetOptions` or `ROCMToolChain::getCommonDeviceLibNames`. `ROCMToolChain::getCommonDeviceLibNames` is called by `AMDGPUOpenMPToolChain::getDeviceLibs`. I decided not to call `ROCMToolChain::addClangTargetOptions` because Flang does not support all Clang options. That's why I initially decided to call `AMDGPUOpenMPToolChain::getDeviceLibs` to check the ROCm path. The second (current) approach is a workaround to emit an error if rocm-path is specified incorrectly. https://github.com/llvm/llvm-project/pull/88190 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits