Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find CLANG_RESOURCE_DIR using clang -print-resource-dir #70

Closed

Conversation

littlewu2508
Copy link

Suggested-By: https://reviews.llvm.org/D49486
Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
@lamb-j lamb-j self-assigned this May 2, 2024
@lamb-j lamb-j added the comgr Related to Code Object Manager label May 2, 2024
@lamb-j
Copy link
Collaborator

lamb-j commented May 2, 2024

Thanks for adding!

Testing this with internal CI, will report back with results

searlmc1 pushed a commit that referenced this pull request May 15, 2024
Submitting on behalf of github user @littlewu2508

#70

Change-Id: I6437677c2cdaecd0ab2d966ce26760f4f75ea09d
@lamb-j lamb-j changed the title Find CLANG_RESOURCE_DIR using clang -print-resource-dirFind clang resource Find CLANG_RESOURCE_DIR using clang -print-resource-dir May 21, 2024
@lamb-j
Copy link
Collaborator

lamb-j commented May 21, 2024

Getting this error on Windows:

2024-05-15 19:53:35 FAILED: tools/comgr/opencl1.2-c.pch C:/mlse/drivers/compute/build/native/Release/x64/lc/tools/comgr/opencl1.2-c.pch 2024-05-15 19:53:35 cmd.exe /C "cd /D C:\mlse\drivers\compute\build\native\Release\x64\lc\tools\comgr && C:\mlse\drivers\compute\build\native\Release\x64\lc\bin\clang.exe -cc1 -x cl-header -triple amdgcn-amd-amdhsa -Werror -O3 -Dcl_khr_fp64 -Dcl_khr_fp16 -DNDEBUG -cl-std=CL1.2 -emit-pch -o C:/mlse/drivers/compute/build/native/Release/x64/lc/tools/comgr/opencl1.2-c.pch <"2024-05-15 19:53:35 The syntax of the command is incorrect.

Apparently "The syntax of the command is incorrect" is a Windows error on invalid file copy/move/rename. So I'm guessing either CLANG_RESOURCE_DIR or OPENCL_C_H are empty?

Any ideas? Should we condition this on NOT WIN32? Also wondering if we may want to keep some of the error checking

@lamb-j
Copy link
Collaborator

lamb-j commented May 21, 2024

FYI I did land this internally, but then had to revert due to the error above, so we can keep using this PR to discuss

a992a6a - [Comgr] Find CLANG_RESOURCE_DIR using clang -print-resource-dir
3b543c2 - Revert "[Comgr] Find CLANG_RESOURCE_DIR using clang -print-resource-dir"

else()
get_target_property(clang_build_header_dir clang-resource-headers RUNTIME_OUTPUT_DIRECTORY)
set(OPENCL_C_H "${clang_build_header_dir}/opencl-c.h")
execute_process(COMMAND "${CLANG_CMAKE_DIR}/../../../bin/clang" -print-resource-dir OUTPUT_VARIABLE CLANG_RESOURCE_DIR)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently "The syntax of the command is incorrect" is a Windows error on invalid file copy/move/rename. So I'm guessing either CLANG_RESOURCE_DIR or OPENCL_C_H are empty?

This line is the key to determine CLANG_RESOURCE_DIR, and it calls to the clang executable. Maybe on windows this should be clang.exe rather than clang? Or on windows "${CLANG_CMAKE_DIR}/../../../bin/clang.exe" does not exist?

@lamb-j Can you trace the output of this command? Sorry that I'm not familiar with Windows.

@lamb-j
Copy link
Collaborator

lamb-j commented Jun 11, 2024

I've just submitted for testing a follow up patch that switches clang/clang.exe for windows, and adds error checking. Will report back with results

@searlmc1 searlmc1 deleted the branch ROCm:amd-staging June 14, 2024 20:54
@searlmc1 searlmc1 closed this Jun 14, 2024
searlmc1 pushed a commit that referenced this pull request Aug 29, 2024
llvm#105923)

…519)"

This reverts commit e00d32a and adds a
test for lambda arrow SplitPenalty.

Fixes llvm#105480.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comgr Related to Code Object Manager
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants