dorsal-lab / hip-analyzer

Compiler plugin for performance analysis of HIP applications
Apache License 2.0
7 stars 3 forks source link

Compilation Error: clang-15: error: cannot specify -o when generating multiple output files #7

Open yulingao opened 1 month ago

yulingao commented 1 month ago

When attempting to compile hip-analyzer, I encountered the following error:

[  1%] Generating gpu_pass_instr.ll
clang-15: error: cannot specify -o when generating multiple output files
make[2]: *** [CMakeFiles/gpu_pass_instr.dir/build.make:73: gpu_pass_instr.ll] Error 1
make[1]: *** [CMakeFiles/Makefile2:253: CMakeFiles/gpu_pass_instr.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

This issue appears to be caused by specifying the -o option while the hipcc compiler generates multiple output files. Removing the -o gpu_pass_instr.ll option might resolve the issue, but I am seeking a more appropriate solution or guidance on how to handle this correctly.

Could you please provide assistance or a fix for this issue?

Sebdar commented 1 month ago

Hi ! It seems that hipcc will always generate multiple llvm module files if you leave out the default targets. I did not have this problem since I have a amd_targets.lst in my home directory, with a single architecture :

gfx90a

You can use this as a temporary workaround. I will update the readme file soon with the appropriate fixes. You will also probably run into some weird behavior on your kernels since I'm currently running a modified version of LLVM. I'll do my best to ensure everything is documented as soon as possible.

yulingao commented 1 month ago

Hi,

Thank you for your suggestion. I have added an amd_targets.lst file in the hip-analyzer home directory with the following content:

gfx906

However, I am still encountering the same error. Could you clarify if there are any other modifications needed to the build environment or LLVM version being used?

Thank you for your help.