Repository navigation
cmake: support building with system jerasure and gf-complete - #68258
Merged
Merged
Conversation
…arget Wrap the vendored jerasure and gf-complete object libraries into a static library (jerasure_vendored) and expose it via a Jerasure::jerasure alias target. This prepares for an upcoming WITH_SYSTEM_JERASURE option that will provide the same target backed by system libraries. Split jerasure_init.cc (ceph's own galois field initialization glue) into a separate jerasure_init_objs target, since it is not part of the jerasure library and must always be built from ceph's source. Normalize shec's include paths to use bare #include "jerasure.h" instead of #include "jerasure/include/jerasure.h", consistent with the jerasure plugin and compatible with both vendored and system headers. No functional change: ec_jerasure, ec_shec, and their legacy flavor variants produce identical binaries. Signed-off-by: Kefu Chai <[email protected]>
…plete Add a cmake option to build ceph's erasure code plugins (ec_jerasure and ec_shec) against system-provided jerasure and gf-complete libraries instead of the vendored copies. This allows downstream distributions to build with their own packaged versions of these libraries. For instance, Debian has shipped libjerasure-dev and libgf-complete-dev as build dependencies for ceph since 2021, but the build always used the vendored copies because there was no cmake option to use the system ones. Using system libraries also lets distributions benefit from any optimizations or fixes applied to their packages without having to carry patches against ceph's vendored copies. For example, the vendored gf-complete requires a downstream -O1 workaround to avoid emitting SSE 4.1 instructions that crash on older CPUs. But with system libraries, that becomes the library package's responsibility. The option is OFF by default, preserving the current behavior of building from vendored sources. A new FindJerasure.cmake module locates the system jerasure and gf-complete headers and libraries, and creates the Jerasure::jerasure imported target with the same target name that the vendored build now provides (see previous commit). Signed-off-by: Kefu Chai <[email protected]>
Contributor
Author
|
jenkins test make check arm64 |
Contributor
Author
Add libjerasure-dev to Build-Depends and enable WITH_SYSTEM_JERASURE so that the Debian package builds ec_jerasure and ec_shec plugins against the distribution-provided libraries instead of the vendored copies. libjerasure-dev pulls in libgf-complete-dev, so both libraries are covered by a single build dependency. Add libjerasure2 to ceph-base's Depends for the runtime shared libraries. libjerasure2 in turn depends on libgf-complete1t64. The explicit dependency is needed because dh_shlibdeps excludes erasure-code plugins from automatic dependency scanning (they are loaded via dlopen at runtime). The distro-packaged jerasure and gf-complete are from the same upstream git snapshots (2017/04/10) as ceph's vendored copies. gf-complete source is byte-identical. jerasure differs only in additional null-pointer checks and error handling in jerasure.c, plus an extra galois_uninit_field() function that ceph does not use. All function signatures ceph depends on are present and compatible. Signed-off-by: Kefu Chai <[email protected]>
Contributor
Author
|
jenkins test windows |
Contributor
Author
|
@cbodley hi Casey, could you help review this change? I came across two downstream patches that both work around issues with the vendored jerasure/gf-complete:
Adding an option to build against the system libraries would address both. Debian wouldn't need to carry their packaging patch and it would actually use the jerasure and gf-completed shipped by the distro, and Proxmox could drop the compiler flag workaround in favor of a properly maintained library. |
Contributor
Author
|
cc @ThomasLamprecht and @Aequitosh |
cbodley
approved these changes
Apr 28, 2026
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.
Debian has carried
libjerasure-devandlibgf-complete-devas build-depends for ceph since 2021 (see https://salsa.debian.org/ceph-team/ceph/-/commit/74f71e7757f9), but ceph always builds from its vendored copies because there is no cmake option to use the system ones.This series first wraps the vendored build into a proper cmake target (Jerasure::jerasure), then adds a
WITH_SYSTEM_JERASUREoption that provides the same target backed by system libraries.Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.