Repository navigation
fix(windows): link LLVM's libomp from cvcpkg; drop the libomp140 exception - #607
Merged
Merged
Conversation
…ption MSVC builds of cvc compile with -openmp:llvm (voxels.cpp needs OpenMP 3.0), so cvc.dll imported libomp140.x86_64.dll, which Microsoft does not allow redistributing. #587 shipped the Windows SDK with that as a documented, temporary exception. This removes it: - cvc links LLVM's own libomp from cvcpkg's `openmp` bundle (Windows build in cy-pca/cvcpkg#146): lib/libomp-llvm.lib by full path, plus /NODEFAULTLIB:libomp.lib and libompd.lib, through a build-local imported target LLVMOpenMP::omp. cvc.dll then imports libomp.dll, which the SDK ships from that bundle. Without the bundle, cvc still builds, falls back to libomp140 and warns at configure time. - A STATIC cvc exports $<LINK_ONLY:LLVMOpenMP::omp>; cvcConfig.cmake.in recreates it from the package's lib/libomp-llvm.lib, so static consumers bind LLVM's libomp too. - The recipe adds `openmp` and `mingw-w64-runtime` as Windows runtime deps. The latter supplies libmcfgthread-2.dll, which cvcpkg's native Windows mpfr (cy-pca/cvcpkg#156) needs. - sdk-check-closure.sh now fails any SDK whose cvc imports libomp140, instead of warning. sdk-smoke-test.sh's Windows run no longer adds Visual Studio's libomp140 to PATH: the SDK's bin/ and the Windows directories only. The release.yml header and the top-level CMakeLists.txt comment are updated.
transfix
force-pushed
the
fix/windows-libomp-from-cvcpkg
branch
from
October 12, 2026 00:54
bc886f6 to
2bde136
Compare
transfix
marked this pull request as ready for review
October 12, 2026 02:06
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #587. It removes the Windows SDK's one temporary exception, the dependency on MSVC's non-redistributable
libomp140.x86_64.dll.cvcpkg now publishes everything this needs for windows/x86_64/release/shared (cy-pca/cvcpkg#146, #156, #164 and #166 merged and deployed; built by windows-build run https://github.com/cy-pca/cvcpkg/actions/runs/38189723443):
openmp 21.1.8+cvc.2gmp 6.3.0+cvc.10andmpfr 4.2.1+cvc.6, which replace the vcpkg-built bundles.mingw-w64-runtimeis added here for mpfr'slibmcfgthread-2.dll.Changes
-openmp:llvm, becausevoxels.cppneeds OpenMP 3.0. It now links LLVM's libomp from cvcpkg'sopenmpbundle:lib/libomp-llvm.libby full path, plus/NODEFAULTLIB:libomp.libandlibompd.lib, through the build-local imported targetLLVMOpenMP::omp;cvc.dllthen importslibomp.dll, which the SDK ships from that bundle through the whole-bundle rule;cvc.libexports$<LINK_ONLY:LLVMOpenMP::omp>, andcvcConfig.cmake.inrecreates it from the package's ownlib/libomp-llvm.libwith the same/NODEFAULTLIBflags.openmpandmingw-w64-runtimebecome Windows runtime deps.sdk-check-closure.shnow fails any SDK whose cvc imports libomp140, where it used to warn.sdk-smoke-test.sh's Windows run uses only the SDK'sbin/and the Windows directories; Visual Studio's libomp140 is no longer on PATH.release.ymlheader and the top-levelCMakeLists.txtcomment are updated.Validation
Rebased onto master (now including #591, #596 and #609). Dry run: https://github.com/transfix/libcvc/actions/runs/38192113286. All 17 jobs passed: 10 build lanes, 6
sdk-smokelegs and the release gate.openmp 21.1.8+cvc.2,gmp 6.3.0+cvc.10andmpfr 4.2.1+cvc.6from the catalog.cvclinkslibomp-llvm.lib.sdk/bin/libomp.dll, and every non-OS module comes from the SDK'sbin/. The archive is reported self-contained.sdk/lib/libomp-llvm.lib, and the consumer loadssdk/bin/libomp.dll.My earlier expectations were partly wrong:
libgmp-10.dll,libmpfr-6.dllandlibmcfgthread-2.dlldo not appear in the loaded-modules list, becausecvc.dlldoes not import them. They ship inbin/as part of the whole-bundle install, for consumers that use gmp/mpfr directly.VCOMP140.DLL, MSVC's own OpenMP runtime, does load. The loader resolves it from System32 on the runner, and something in the dependency closure imports it; ImageMagick'sCORE_RL_*DLLs are the likely source. Unlike libomp140 it is part of the VC++ redistributable, and the SDK shipsvcomp140.dllinbin/with the rest of the MSVC runtime. A consumer process therefore has two OpenMP runtimes (LLVM's for cvc, MSVC's for that dependency). That was already the case before this PR.A local configure on Linux generates the config correctly:
CVC_USES_LLVM_OPENMPevaluates to FALSE there.