Skip to content

Link against zstd, which current ProteoWizard needs - #36

Open
percolator wants to merge 1 commit into
masterfrom
fix/zstd-link
Open

percolator wants to merge 1 commit into
masterfrom
fix/zstd-link

Conversation

@percolator

Copy link
Copy Markdown
Contributor

The problem

A build against a ProteoWizard fetched today fails at the link step:

/usr/bin/ld: /build/tools/lib/libpwiz_data_msdata_core.a(BinaryDataEncoder.o):
  undefined reference to `ZSTD_compress'
  undefined reference to `ZSTD_getErrorCode'
  undefined reference to `ZSTD_defaultCLevel'
  ...
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/maracluster.dir/build.make:120: src/maracluster] Error 1

ProteoWizard compresses binary data with zstd now, so pwiz_data_msdata_core references it. Two things are missing on our side:

  1. admin/builders/install_proteowizard.sh creates plain-name symlinks for the Boost components only (its line 77). bjam names its output libzstd-gcc11-mt-s.a, so -lzstd finds nothing.
  2. cmake/FindProteoWizard.cmake never asks for the library, so it is not on the link line at all.

The fix

A symlink for zstd alongside the Boost ones, and an optional find_library in the find module. Optional because ProteoWizard releases predating the zstd compression do not build it; the message says so when it is absent. It is appended after the libraries that reference it, which is what a single-pass linker needs.

Testing

Ubuntu 22.04, gcc 11, ProteoWizard 3.0.26260 built by admin/builders/install_proteowizard.sh from this branch. master does not link at all on that toolchain; with this change it builds and maracluster unit-test passes.

Found while preparing #35, but independent of it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01D7vADr6Z93sRBvfNGHUwW6

A build against a ProteoWizard fetched today fails at the link step with
undefined references to ZSTD_compress, ZSTD_getErrorCode, ZSTD_defaultCLevel
and others, from libpwiz_data_msdata_core.a: ProteoWizard now compresses
binary data with zstd.

Two things are missing. install_proteowizard.sh creates plain-name symlinks
for the Boost components only, so bjam's libzstd-gcc11-mt-s.a is invisible to
-lzstd; and FindProteoWizard.cmake never asks for the library, so it is not on
the link line at all.

The find is optional, since ProteoWizard releases predating the zstd
compression do not build it, and it appends after the libraries that
reference it, which is what a single-pass linker needs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7vADr6Z93sRBvfNGHUwW6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant