Fix Arrow/Parquet debug build on Windows: add 'd' suffix and build deps in debug mode#183
Open
Fix Arrow/Parquet debug build on Windows: add 'd' suffix and build deps in debug mode#183
Conversation
… in debug mode Agent-Logs-Url: https://github.com/OpenMS/contrib/sessions/a2d6b120-1740-4f2c-8552-e9b32c506848 Co-authored-by: jpfeuffer <8102638+jpfeuffer@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
jpfeuffer
April 30, 2026 06:37
View session
…rs during OpenMS configure time: 'The imported target Arrow::arrow_static references the file /lib/arrow_staticd.lib but this file does not exist. '
Contributor
|
This version now works for me. |
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.
Summary
Fixes issue #182. On Windows (MSVC), the Arrow and Parquet static libraries and their bundled dependencies (Snappy, zstd, Thrift, xsimd, RapidJSON) were not properly built in debug mode, causing
_ITERATOR_DEBUG_LEVELmismatch linker errors when consuming them in a Debug build of OpenMS.Root Causes
Arrow/Parquet own libs (
arrow_static.lib,parquet_static.lib, etc.) — built in both Debug and Release, but with the same filename → only one survives inlib/. Fix: addCMAKE_DEBUG_POSTFIX=d.Bundled ExternalProject dependencies (
arrow_bundled_dependencies.lib/ Snappy, zstd, Thrift, etc.) — Arrow's build system derivesARROW_EP_BUILD_TYPEfromCMAKE_BUILD_TYPE. With the MSVC multi-config generator and noCMAKE_BUILD_TYPEset, Arrow defaulted these to Release → compiled with/MD(Release CRT), causing_ITERATOR_DEBUG_LEVEL=0vs2mismatch when linked into a Debug binary. Fix: two separate build directories withCMAKE_BUILD_TYPE=Debug/Releaseset explicitly.arrow_bundled_dependencies.lib— this merged static library is installed viainstall(FILES ...)rather than as a regular CMake library target, so it ignoresCMAKE_DEBUG_POSTFIXautomatically. Fix: rename toarrow_bundled_dependenciesd.libafter the Debug install, and patchArrowConfig.cmake.inso the installedArrowConfig.cmakereferences the correct variant per configuration.Changes (
libraries.cmake/arrow.cmake, MSVC section only)build_debug,build_releaseinside the Arrow source tree). Each is configured with a differentCMAKE_BUILD_TYPE, ensuring bundled deps inherit the correct MSVC runtime flag (/MDd//MD).-DCMAKE_DEBUG_POSTFIX=dadded to both configurations →arrow_staticd.lib,parquet_staticd.lib, etc.arrow_bundled_dependencies.lib→arrow_bundled_dependenciesd.libimmediately after the Debug install step.ArrowConfig.cmake.in(two targeted single-line replacements) before building so the generatedArrowConfig.cmakesetsArrow::arrow_bundled_dependencies'sIMPORTED_LOCATION_DEBUGto thed-suffixed file andIMPORTED_LOCATION_RELEASEto the normal one.ArrowTargets.cmake/ParquetTargets.cmake: if the Release build's umbrella file omits the debug config include (only needed on CMake < 3.22; modern CMake uses a GLOB), the missing include is appended.Notes