Page MenuHomePhabricator

[AMDGPU][OpenMP] Add <install-prefix>/include to the search path
Needs ReviewPublic

Authored by pdhaliwal on Mar 26 2021, 1:48 AM.



Fixes the include error for omp.h as compiler was not looking in the
correct directory.

Diff Detail

Unit TestsFailed

1,330 msx64 windows > Clang.Driver::amdgpu-openmp-toolchain.c
Script: -- : 'RUN: at line 3'; env LIBRARY_PATH=C:\ws\w16-1\llvm-project\premerge-checks\clang\test\Driver/Inputs/hip_dev_lib c:\ws\w16-1\llvm-project\premerge-checks\build\bin\clang.exe -### --target=x86_64-unknown-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx906 C:\ws\w16-1\llvm-project\premerge-checks\clang\test\Driver\amdgpu-openmp-toolchain.c 2>&1 | c:\ws\w16-1\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w16-1\llvm-project\premerge-checks\clang\test\Driver\amdgpu-openmp-toolchain.c

Event Timeline

pdhaliwal created this revision.Mar 26 2021, 1:48 AM
pdhaliwal requested review of this revision.Mar 26 2021, 1:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 26 2021, 1:48 AM

Any chance you might be interested in fixing the more general problem, benefiting every clang openmp user, not just amdgpu?

I was not aware that it was a general problem. I will check if I could get a general solution.

The general problem looks harder but important to fix. Finding the right headers but the wrong shared library is bad, and iirc we currently have to use LD_LIBRARY_PATH to bodge the latter which is not a good UX.

The general problem seems bit more involved. I am not that familiar with how other architectures/systems handle the library/include path. Simplest solution that I can propose right now is to generalise my revision to other architectures for header lookup and similarly for library lookup in case of openmp. If there is better solution available please let me know I will be happy to implement it.