Skip to content

Commit 2037029

Browse files
isurufh-vetinari
authored andcommitted
Fix Intel/LLVM openmp build
Signed-off-by: Michał Górny <[email protected]>
1 parent b6e903b commit 2037029

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

recipe/meta.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ source:
6262
- patches/0014-skip-test_norm_matrix_degenerate_shapes-on-numpy-2.3.patch
6363
# backport https://github.com/pytorch/pytorch/pull/127702
6464
- patches/0015-Define-PY_SSIZE_T_CLEAN-before-include-Python.h.patch
65+
- patches/0018-Use-Intel-LLVM-openmp.patch
6566
- patches_submodules/fbgemm/0001-remove-DESTINATION-lib-from-CMake-install-directives.patch # [win]
6667
- patches_submodules/tensorpipe/0001-switch-away-from-find_package-CUDA.patch
6768

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From ffbdd8bb8fa38397ad6d7958a8c4ddd80ff738eb Mon Sep 17 00:00:00 2001
2+
From: Isuru Fernando <[email protected]>
3+
Date: Thu, 31 Jul 2025 12:34:30 -0500
4+
Subject: [PATCH] Use Intel/LLVM openmp
5+
6+
This make MSVC use __kmp_* symbols available in both libiomp.dll
7+
and libiomp5md.dll instead of vcomp* symbols which are only in
8+
vcomp140.dll and libiomp5md.dll, but are missing in libiomp.dll
9+
---
10+
cmake/Modules/FindOpenMP.cmake | 4 ++--
11+
1 file changed, 2 insertions(+), 2 deletions(-)
12+
13+
diff --git a/cmake/Modules/FindOpenMP.cmake b/cmake/Modules/FindOpenMP.cmake
14+
index 8a9abff398..336a9a927a 100644
15+
--- a/cmake/Modules/FindOpenMP.cmake
16+
+++ b/cmake/Modules/FindOpenMP.cmake
17+
@@ -122,9 +122,9 @@ function(_OPENMP_FLAG_CANDIDATES LANG)
18+
set(OMP_FLAG_MIPSpro "-mp")
19+
if(__header_dir MATCHES ".*Microsoft Visual Studio.*")
20+
# MSVC header. No need to pass it as additional include.
21+
- set(OMP_FLAG_MSVC "-openmp:experimental" "-openmp")
22+
+ set(OMP_FLAG_MSVC "-openmp:llvm" "-openmp:experimental" "-openmp")
23+
else()
24+
- set(OMP_FLAG_MSVC "-openmp:experimental -I${__header_dir}" "-openmp -I${__header_dir}")
25+
+ set(OMP_FLAG_MSVC "-openmp:llvm" "-openmp:experimental -I${__header_dir}" "-openmp -I${__header_dir}")
26+
endif()
27+
set(OMP_FLAG_PathScale "-openmp")
28+
set(OMP_FLAG_NAG "-openmp")
29+
--
30+
2.45.2
31+

0 commit comments

Comments
 (0)