Repository navigation
[BUILD] Link only Boost headers and remove BOOST_USE_STATIC - #10311
Conversation
OpenMS only uses header-only Boost code: Boost.Regex has been header-only since 1.76, Boost.DateTime is not used at all, and the Boost.Iostreams filtering_ostream/null_sink that FileInfo uses are templates. Linking the compiled regex, iostreams and date_time libraries therefore added nothing but link dependencies. With the default BOOST_USE_STATIC=ON they were static archives linked into the shared libOpenMS, which fails where a distribution's archives are not built with -fPIC, and which needs their own dependencies (zstd, lzma, ICU) installed as development packages. - find_boost() is called without compiled components. libOpenMS, FileMerger and the class tests rely on the public Boost::boost headers target; DecoyDatabase and NucleicAcidSearchEngine (and their tool tests) include no Boost header and link no Boost target at all. - Remove the BOOST_USE_STATIC option, which was also defined twice, and the Homebrew static-Boost link fixups that only existed for the compiled components. - Drop -DBOOST_USE_STATIC from the CMake presets, CI, Dockerfile, gitpod, devcontainer and quickbuild scripts, and replace the misspelled -DBOOST_USE_STATIC_LIBS workaround in AGENTS.md/CLAUDE.md. Fixes #3319 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01N9CUs8wEoRPn6afieaB7VM
OpenMS no longer links any compiled Boost library (previous commit), so the build stage installs libboost-dev instead of the date_time, iostreams, regex, math and random dev packages, and the runtime image no longer installs their libboost-*1.83.0 libraries. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01N9CUs8wEoRPn6afieaB7VM
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (24)
💤 Files with no reviewable changes (10)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughOpenMS removes the ChangesBoost header-only linkage
Suggested reviewers: Priority: ➖ Normal Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The reviewed Boost dependency changes have no identified issue that needs correction before merging. Normal build checks remain appropriate. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 9 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the Boosted build, Comment |
|
oh wow, yes sure, if we dont use any compiled boost functionality anymore this is the way to go. |
|
@pjones will you need anything from boost that requires linking? |
|
@timosachsenberg As far as the mzPeak library linking with boost, yes:
But I'm sure this can wait until the integration with OpenMS happens. |
Description
Fixes #3319. Implements option 1 ("link only the Boost headers") from the status review on the issue.
OpenMS only uses header-only Boost code:
FileInfo's Boost.Iostreamsfiltering_ostream/null_sinkare templates.Linking the compiled regex, iostreams and date_time libraries therefore added only link dependencies. With the old default
BOOST_USE_STATIC=ON, they were static archives linked into the shared libOpenMS. That fails where a distribution's archives are not built with-fPIC, and it requires their own dependencies (zstd, lzma, ICU) as development packages.Build system
find_boost()is called without compiled components.FileMergerand the class tests rely on the publicBoost::boostheaders target.DecoyDatabaseandNucleicAcidSearchEngine(and their tool tests) include no Boost header and now link no Boost target.BOOST_USE_STATICremoved-DBOOST_USE_STATICin the CMake presets, CI, Dockerfile, gitpod, devcontainer and quickbuild scripts.OFFwould have broken the first two.Docker image
libboost-dev(the headers) instead of five compiled Boost dev packages.library) stage no longer installs the fivelibboost-*1.83.0libraries, which libOpenMS no longer loads.Docs
AGENTS.md/CLAUDE.mdno longer recommend the misspelled-DBOOST_USE_STATIC_LIBS=OFF.Not changed
-DBOOST_USE_STATIC=OFF. It builds the 3.5.0 release, which still needs the flag (conda-forge ships only shared Boost), so the flag can go with the bump to 3.6.0.Testing
Ubuntu 24.04, GCC 13, Boost 1.83 from apt, Arrow/Parquet 23. Release build with GUI, docs, Thermo RAW and opentims off; none of them use compiled Boost. No Boost flag was passed.
TestExternalCodeCore(installed consumer)libboost1.83-dev(headers) installed, fresh configure¹ Every class test for a libOpenMS source that uses Boost.Regex, plus the tests the removed Boost link loop covered.
² All tests for FileInfo, FileMerger, DecoyDatabase, NucleicAcidSearchEngine, PercolatorAdapter, OpenNuXL and MSstatsConverter.
libboost_*NEEDED entry, and libOpenMS.so has no undefined Boost symbols.-lbz2 -llzma -lz -lzstd -licu*) against the same objects with-Wl,--trace. It pulled 0 members from the Boost archives and produced a library with a byte-identical.textsection and the same exported symbols.ubuntu:24.04containers:libboost-dev/libboost1.83-devget installed and nolibboost_*library is present. OpenMS configures, andOpenMS,OpenMS_CLI,FileInfoandFileMergerbuild.library) stage list plus Arrow/Parquet 23: no Boost package is installed.lddresolves every dependency of the libraries and tools built above. TheFileInfo_1,FileInfo_7andFileMerger_1test commands run and write output identical to the passing host runs. The full image build and its test stage were not run.Not tested locally: Windows, macOS, the vcpkg presets, pyOpenMS and the GUI. CI needs to cover these, especially the Windows static-md triplet.
Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01N9CUs8wEoRPn6afieaB7VM
Generated by Claude Code
Summary by CodeRabbit
BOOST_USE_STATICCMake option has been removed. Passing it may produce an unused-variable warning.