Windows builds are using Microsoft’s OpenMP header instead of Intel’s

🐛 Bug

Windows builds on CI seem to be using Microsoft’s OpenMP headers instead of Intel’s. Is it possible to use Intel’s OpenMP instead, as Microsoft OpenMP doesn’t support all the functions in the OpenMP specification, such as omp_get_level(). The build process installs intel-openmp, which is being used, but as @peterjc123 astutely observed, the omp.h header file provided by Microsoft is being used. Thanks!

-- Found OpenMP_C: -openmp:experimental  
CMake Warning (dev) at C:/w/b/windows/conda/envs/py37/Library/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
  The package name passed to `find_package_handle_standard_args` (OpenMP_CXX)
  does not match the name of the calling package (OpenMP).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/Modules/FindOpenMP.cmake:565 (find_package_handle_standard_args)
  third_party/fbgemm/CMakeLists.txt:60 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenMP_CXX: -openmp:experimental  
-- Found OpenMP: TRUE   
CMake Warning at third_party/fbgemm/CMakeLists.txt:62 (message):
  OpenMP found! OpenMP_C_INCLUDE_DIRS =
CXX flags             : /DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -DNDEBUG -DUSE_FBGEMM -DUSE_XNNPACK

To Reproduce

Steps to reproduce the behavior:

  1. Use a standard OpenMP function that Microsoft doesn’t list in its OpenMP functions list, such as omp_get_level().
  2. Windows builds will fail, as here, for example, because Intel OpenMP’s headers aren’t used.
  3. #52964 by @peterjc123 resolves this issue.

Expected behavior

Is it possible to use Intel’s OpenMP headers for Windows builds instead?



Additional context

#52964 by @peterjc123 resolves this issue.

4 thoughts on “Windows builds are using Microsoft’s OpenMP header instead of Intel’s

  1. @imaginary-person I’m sorry. It still needs the admin’s approval. BTW, I did some tests locally and it seems that the problem is because I forget to package the openmp headers into the mkl package.

  2. After inspection, I don’t think it’s a high-pri issue because the intel libs are still linked instead of the VCOMP ones. So after providing the Intel OpenMP headers, the functions including omp_get_level can be referenced.