[Openmp-commits] [PATCH] D122667: llvm14 patch: hwloc include directory for libompd

Sajid Ali via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Mar 30 07:52:53 PDT 2022


s-sajid-ali added a comment.

Per this comment <https://github.com/llvm/llvm-project/blob/main/openmp/libomptarget/CMakeLists.txt#L81> at `openmp/libomptarget/CMakeLists.txt`, `LIBOMP_INCLUDE_DIR` represents "Path to folder containing omp.h". Note that `omp.h` is generated from `openmp/runtime/src/include/omp.h.var` per this recipe <https://github.com/llvm/llvm-project/blob/main/openmp/runtime/src/CMakeLists.txt#L12>. Note that `omp.h.var` does not seem to include `hwloc.h` (conditionally or unconditionally).

Looking at the rule for generating `omp.h` more closely, (which is `configure_file(${LIBOMP_INC_DIR}/omp.h.var omp.h @ONLY)`), it looks like the `${LIBOMP_INC_DIR}/omp.h.var ` generates `omp.h` in the build directory that subsequently gets defined as `LIBOMP_INCLUDE_DIR`. Thus, any sub-project that is built **after** the `omp.h` is generated, uses `LIBOMP_INCLUDE_DIR` to include the aforementioned header.

I don't know enough about LLVM's OpenMP internals to decide whether all projects that use `omp.h` need to access `hwloc.h` (conditionally) or not which the above patch does. If not, we could conditionally include the location `${LIBOMP_HWLOC_INSTALL_DIR}/include` in the set of includes for `libompd` (at `openmp/libompd/src/CMakeLists.txt`).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122667/new/

https://reviews.llvm.org/D122667



More information about the Openmp-commits mailing list