-
Notifications
You must be signed in to change notification settings - Fork 21.7k
CPU/Windows: Ensure LLVMs OpenMP library gets selected in CMake and CI #25782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3718857
78421c6
a23bb9b
dcce527
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,6 +9,31 @@ set( CMAKE_CXX_COMPILER clang++ ) | |||||
| set( CMAKE_C_COMPILER_TARGET ${target} ) | ||||||
| set( CMAKE_CXX_COMPILER_TARGET ${target} ) | ||||||
|
|
||||||
| if (NOT DEFINED GGML_OPENMP OR GGML_OPENMP) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this supposed to be just:
Suggested change
|
||||||
| file(TO_CMAKE_PATH | ||||||
| "$ENV{VCINSTALLDIR}/Tools/Llvm/ARM64" | ||||||
| llvm_arm64_root | ||||||
| ) | ||||||
|
|
||||||
| set( LLVM_ARM64_ROOT | ||||||
| "${llvm_arm64_root}" | ||||||
| CACHE PATH | ||||||
| "ARM64 LLVM installation containing the target OpenMP runtime" | ||||||
| ) | ||||||
|
|
||||||
| if (EXISTS "${LLVM_ARM64_ROOT}/lib/libomp.lib") | ||||||
| # Prefer the target LLVM OpenMP library over the MSVC import library. | ||||||
| set( OpenMP_libomp_LIBRARY | ||||||
| "${LLVM_ARM64_ROOT}/lib/libomp.lib" | ||||||
| CACHE FILEPATH | ||||||
| "ARM64 LLVM OpenMP import library" | ||||||
| FORCE | ||||||
| ) | ||||||
| else() | ||||||
| message(WARNING "LLVM ARM64 OpenMP library not found: ${LLVM_ARM64_ROOT}/lib/libomp.lib") | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we always package LLVM's OpenMP, CI has to fail if this is absent |
||||||
| endif() | ||||||
| endif() | ||||||
|
|
||||||
| set( arch_c_flags "-march=armv8.7-a -fvectorize -ffp-model=fast -fno-finite-math-only" ) | ||||||
| set( warn_c_flags "-Wno-format -Wno-unused-variable -Wno-unused-function -Wno-gnu-zero-variadic-macro-arguments" ) | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,28 @@ set( CMAKE_SYSTEM_PROCESSOR x86_64 ) | |
|
|
||
| set( CMAKE_C_COMPILER clang ) | ||
| set( CMAKE_CXX_COMPILER clang++ ) | ||
|
|
||
| if (NOT DEFINED GGML_OPENMP OR GGML_OPENMP) | ||
| file(TO_CMAKE_PATH | ||
| "$ENV{VCINSTALLDIR}/Tools/Llvm/x64" | ||
| llvm_X64_root | ||
| ) | ||
|
|
||
| set( LLVM_X64_ROOT | ||
| "${llvm_X64_root}" | ||
| CACHE PATH | ||
| "x64 LLVM installation containing the target OpenMP runtime" | ||
| ) | ||
|
|
||
| if (EXISTS "${LLVM_X64_ROOT}/lib/libomp.lib") | ||
| # Prefer the target LLVM OpenMP library over the MSVC import library. | ||
| set( OpenMP_libomp_LIBRARY | ||
| "${LLVM_X64_ROOT}/lib/libomp.lib" | ||
| CACHE FILEPATH | ||
| "x64 LLVM OpenMP import library" | ||
| FORCE | ||
| ) | ||
| else() | ||
| message(WARNING "LLVM x64 OpenMP library not found: ${LLVM_X64_ROOT}/lib/libomp.lib") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we always package LLVM's OpenMP, CI has to fail if this is absent |
||
| endif() | ||
| endif() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use something like the below to avoid hardcoding the Visual Studio path, which can vary across machines?