# Find \`omp-tools.h\` with FindOpenMP

**URL:** <https://discourse.cmake.org/t/find-omp-tools-h-with-findopenmp/8275>\
**Category:** Code\
**Created:** [June 7, 2023, 1:43pm UTC](https://discourse.cmake.org/t/find-omp-tools-h-with-findopenmp/8275 "2023-06-07T13:43:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![parzt](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/ecae2f/32.png) [@parzt](https://discourse.cmake.org/u/parzt)\
**Post date:** [June 7, 2023, 1:43pm UTC](https://discourse.cmake.org/t/find-omp-tools-h-with-findopenmp/8275/1 "2023-06-07T13:43:13Z")

</div>

I use the [OpenMP tools interface](https://www.openmp.org/spec-html/5.0/openmpsu15.html#x25-240001.5.1) for my project and therefore need to header `omp-tools.h`. Is there any way to find the include directory which this file using FindOpenMP? If not, would such a feature be possible and sensible?

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [June 7, 2023, 2:00pm UTC](https://discourse.cmake.org/t/find-omp-tools-h-with-findopenmp/8275/2 "2023-06-07T14:00:43Z")

</div>

A component for this seems sensible to me. Feel free to [submit an MR](https://gitlab.kitware.com/cmake/cmake/-/blob/master/CONTRIBUTING.rst) or [file an issue](https://gitlab.kitware.com/cmake/cmake/-/issues) (an issue is good even if you end up working on it just for tracking/search purposes).

---

<div class="post-metadata">

**Author:** ![parzt](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/ecae2f/32.png) [@parzt](https://discourse.cmake.org/u/parzt)\
**Post date:** [June 12, 2023, 9:07am UTC](https://discourse.cmake.org/t/find-omp-tools-h-with-findopenmp/8275/3 "2023-06-12T09:07:17Z")

</div>

I did some more experimentation and realized that at least for Clang (i.e., `CMAKE_C_COMPILER=clang`) the compiler automatically finds `omp-tools.h` as it is located in the `include` directory of the compiler installation.

So, supporting something like `find_package(OpenMP 5.0 REQUIRED COMPONENTS ompt)` would be useful, right? Is this what you meant by “component for this”?

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [June 17, 2023, 8:58pm UTC](https://discourse.cmake.org/t/find-omp-tools-h-with-findopenmp/8275/4 "2023-06-17T20:58:48Z")

</div>

> [@parzt](#):
>
> So, supporting something like `find_package(OpenMP 5.0 REQUIRED COMPONENTS ompt)` would be useful, right? Is this what you meant by “component for this”?

Yes.

---

<div class="post-metadata">

**Author:** ![parzt](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/ecae2f/32.png) [@parzt](https://discourse.cmake.org/u/parzt)\
**Post date:** [June 19, 2023, 9:17am UTC](https://discourse.cmake.org/t/find-omp-tools-h-with-findopenmp/8275/5 "2023-06-19T09:17:39Z")

</div>

Gitlab issue for this: [https://gitlab.kitware.com/cmake/cmake/-/issues/25005](https://gitlab.kitware.com/cmake/cmake/-/issues/25005)
