OpenMP header path?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenMP header path?

Дилян Палаузов via cfe-dev
Hi!

I'm trying to build file with enabled OpenMP support by trunk Clang
with GCC STL. Compilation is failing because of:

fatal error: 'omp.h' file not found
#include <omp.h>

Clang options:

-stdlib=libstdc++ --gcc-toolchain=<GCC 6.3.0 path> -fopenmp

Search path reported by -v:

#include <...> search starts here:

<GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../include/c++/6.3.0
<GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../include/c++/6.3.0/x86_64-redhat-linux/32
<GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../include/c++/6.3.0/backward

Location of omp.h:

<GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/include/omp.h

Eugene.
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenMP header path?

Дилян Палаузов via cfe-dev
On Wed, Feb 6, 2019 at 11:35 AM Eugene Zelenko via cfe-dev
<[hidden email]> wrote:
>
> Hi!
>
> I'm trying to build file with enabled OpenMP support by trunk Clang
> with GCC STL. Compilation is failing because of:
>
> fatal error: 'omp.h' file not found
> #include <omp.h>
Clang is normally looking for it's own omp.h
It won't find it unless you actually install clang.
It won't work out of build dir.
https://bugs.llvm.org/show_bug.cgi?id=40139

Also, you need to build libomp for that header to be build, IIRC.

> Clang options:
>
> -stdlib=libstdc++ --gcc-toolchain=<GCC 6.3.0 path> -fopenmp
>
> Search path reported by -v:
>
> #include <...> search starts here:
>
> <GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../include/c++/6.3.0
> <GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../include/c++/6.3.0/x86_64-redhat-linux/32
> <GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../include/c++/6.3.0/backward
>
> Location of omp.h:
>
> <GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/include/omp.h
>
> Eugene.
Roman.

> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenMP header path?

Дилян Палаузов via cfe-dev
Hi, Roman!

On Wed, Feb 6, 2019 at 12:38 AM Roman Lebedev <[hidden email]> wrote:

>
> On Wed, Feb 6, 2019 at 11:35 AM Eugene Zelenko via cfe-dev
> <[hidden email]> wrote:
> >
> > Hi!
> >
> > I'm trying to build file with enabled OpenMP support by trunk Clang
> > with GCC STL. Compilation is failing because of:
> >
> > fatal error: 'omp.h' file not found
> > #include <omp.h>
> Clang is normally looking for it's own omp.h
> It won't find it unless you actually install clang.
> It won't work out of build dir.
> https://bugs.llvm.org/show_bug.cgi?id=40139
>
> Also, you need to build libomp for that header to be build, IIRC.

It was my first thought, so I built and install OpenMP. I use
installed Clang, not build directory. omp.h is in include directory in
installation path, but Clang could not find it.

Only <Clang installation dir>/lib64/clang/9.0.0/include is in search
path reported by -v.

> > Clang options:
> >
> > -stdlib=libstdc++ --gcc-toolchain=<GCC 6.3.0 path> -fopenmp
> >
> > Search path reported by -v:
> >
> > #include <...> search starts here:
> >
> > <GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../include/c++/6.3.0
> > <GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../include/c++/6.3.0/x86_64-redhat-linux/32
> > <GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../include/c++/6.3.0/backward
> >
> > Location of omp.h:
> >
> > <GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/include/omp.h
> >
> > Eugene.
> Roman.
>
> > _______________________________________________
> > cfe-dev mailing list
> > [hidden email]
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

Eugene.
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenMP header path?

Дилян Палаузов via cfe-dev
In reply to this post by Дилян Палаузов via cfe-dev
Hi, Eugene,

Have you built and installed LLVM's OpenMP runtime library? Even when
using GCC's libstdc++, you should be using LLVM's OpenMP runtime and
LLVM's omp.h.

 -Hal

On 2/5/19 3:48 PM, Eugene Zelenko via cfe-dev wrote:

> Hi!
>
> I'm trying to build file with enabled OpenMP support by trunk Clang
> with GCC STL. Compilation is failing because of:
>
> fatal error: 'omp.h' file not found
> #include <omp.h>
>
> Clang options:
>
> -stdlib=libstdc++ --gcc-toolchain=<GCC 6.3.0 path> -fopenmp
>
> Search path reported by -v:
>
> #include <...> search starts here:
>
> <GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../include/c++/6.3.0
> <GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../include/c++/6.3.0/x86_64-redhat-linux/32
> <GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../include/c++/6.3.0/backward
>
> Location of omp.h:
>
> <GCC 6.3.0 path>/lib/gcc/x86_64-redhat-linux/6.3.0/include/omp.h
>
> Eugene.
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenMP header path?

Дилян Палаузов via cfe-dev
Hi, Hal!

On Wed, Feb 6, 2019 at 1:00 PM Finkel, Hal J. <[hidden email]> wrote:
>
> Hi, Eugene,
>
> Have you built and installed LLVM's OpenMP runtime library? Even when
> using GCC's libstdc++, you should be using LLVM's OpenMP runtime and
> LLVM's omp.h.
>
>  -Hal

Yes, I built and installed LLVM's OpenMP runtime library, but this didn't help.

Eugene.
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenMP header path?

Дилян Палаузов via cfe-dev
On 2/6/19 3:24 PM, Eugene Zelenko via cfe-dev wrote:

> Hi, Hal!
>
> On Wed, Feb 6, 2019 at 1:00 PM Finkel, Hal J. <[hidden email]> wrote:
>> Hi, Eugene,
>>
>> Have you built and installed LLVM's OpenMP runtime library? Even when
>> using GCC's libstdc++, you should be using LLVM's OpenMP runtime and
>> LLVM's omp.h.
>>
>>  -Hal
> Yes, I built and installed LLVM's OpenMP runtime library, but this didn't help.


That should have installed an omp.h, did it not? Is the relevant path
one that Clang searches by default?

 -Hal


>
> Eugene.
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenMP header path?

Дилян Палаузов via cfe-dev
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.

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenMP header path?

Дилян Палаузов via cfe-dev
Hi, Marcus!

On Wed, Feb 6, 2019 at 3:47 PM Marcus Johnson
<[hidden email]> 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?

Eugene.
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenMP header path?

Дилян Палаузов via cfe-dev
On 2/6/19 5:52 PM, Eugene Zelenko wrote:

> Hi, Marcus!
>
> On Wed, Feb 6, 2019 at 3:47 PM Marcus Johnson
> <[hidden email]> 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.

 -Hal


>
> Eugene.

--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenMP header path?

Дилян Палаузов via cfe-dev


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
>> <[hidden email]> 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
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev