[cfe-dev] OpenMP header path?

Jonas Hahnfeld via cfe-dev cfe-dev at lists.llvm.org
Wed Feb 6 23:46:06 PST 2019



On 2019-02-07 02:27, Finkel, Hal J. via cfe-dev wrote:
> On 2/6/19 5:52 PM, Eugene Zelenko wrote:
>> Hi, Marcus!
>> 
>> On Wed, Feb 6, 2019 at 3:47 PM Marcus Johnson
>> <bumblebritches57 at gmail.com> wrote:
>>>> Ok, so what you need to do is run this in your terminal: find / 
>>>> -iname "omp.h"
>>> then check all of the results for LLVM's header copyright info, once 
>>> you find the correct OpenMP header, add that to Clang's search path 
>>> with either -i (but capitalized) or -system-header-prefix.
>>> 
>>> I'm not entirely clear on this part.
>> But isn't -fopenmp should add omp.h location (<Clang installation
>> directory>/include) to list of <> search paths?
> 
> 
> This seems like a larger problem, not something OpenMP specific. 
> Perhaps
> Clang should add it's installation-prefix include directory to its list
> of system include paths? Alternatively, or in addition, we should make
> sure that omp.h is installed into Clang's lib/include directory along
> with other compiler-specific headers.

This works iff you build the OpenMP runtime in-tree, so checking out to 
projects/openmp or using LLVM_ENABLE_PROJECTS. When building standalone, 
we cannot do much because CMake doesn't know about the Clang version and 
cannot put the header into lib/clang/<<<version>>>/include.
For reference: There's https://reviews.llvm.org/D55725 which adds 
OPENMP_CLANG_VERSION so that you can tell CMake where to put the header. 
For now I'd say you're responsible that Clang can find both the header 
and the shared library if you're building the OpenMP runtime separately.

Jonas



More information about the cfe-dev mailing list