Skip to content

Commit 1d73b67

Browse files
committed
fix(arm): use two-pass cmake so TOPP links against system libstdc++
The ARM build of `make -j4 TOPP` failed at the link step with /usr/bin/ld: /root/miniforge3/lib/libyaml-cpp.so.0.8: undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32' The conda-forge libyaml-cpp wheel for aarch64 is built against GLIBCXX_3.4.32 (gcc 13+), but Ubuntu 22.04's system g++ ships with an older libstdc++. Running cmake inside the mamba shell lets it discover /root/miniforge3/lib first, so the conda-forge yaml-cpp gets linked into every TOPP binary and breaks. amd64 happens to work because the conda-forge amd64 yaml-cpp build is older. Fix mirrors FLASHApp's Dockerfile.arm: configure OpenMS in two cmake passes — pass 1 under plain `/bin/bash` with `-DCMAKE_IGNORE_PREFIX_PATH=/root/miniforge3` so cmake resolves C++ deps from the system tree (libyaml-cpp from contrib, boost from apt, etc.); pass 2 under `mamba run` with `-DPYOPENMS=ON` so the Python bindings still find conda-forge Python / Cython / NumPy. The IGNORE_PREFIX_PATH flag is repeated on pass 2 to keep the cached C++ link command unchanged. Only Dockerfile.arm changes; Dockerfile (amd64) keeps its single-pass cmake to avoid disturbing the working x86 path.
1 parent d32c1b9 commit 1d73b67

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

Dockerfile.arm

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,21 @@ WORKDIR /
8686
RUN mkdir /openms-build
8787
WORKDIR /openms-build
8888

89-
# Configure.
90-
RUN /bin/bash -c "cmake -DCMAKE_BUILD_TYPE='Release' -DCMAKE_PREFIX_PATH='/OpenMS/contrib-build/;/usr/;/usr/local' -DHAS_XSERVER=OFF -DBOOST_USE_STATIC=OFF -DPYOPENMS=ON ../OpenMS -DPY_MEMLEAK_DISABLE=On"
89+
# Configure (two-pass — mirrors FLASHApp.arm).
90+
# Pass 1 runs under plain bash so cmake does NOT search /root/miniforge3
91+
# when resolving C++ system dependencies. On ARM the conda-forge build of
92+
# libyaml-cpp.so.0.8 is linked against a newer libstdc++ (GLIBCXX_3.4.32,
93+
# i.e. gcc 13+) than ubuntu:22.04's system g++ ships, so letting cmake
94+
# pick the miniforge yaml-cpp makes TOPP linking fail with
95+
# undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32`
96+
# amd64 happens to work because its conda-forge yaml-cpp build is older.
97+
# Pass 2 re-runs cmake inside the mamba env with PYOPENMS=ON so the Python
98+
# bindings can find the conda-forge Python/Cython/NumPy; CMAKE_IGNORE_PREFIX_PATH
99+
# keeps the C++ link command unchanged from pass 1.
100+
SHELL ["/bin/bash", "-c"]
101+
RUN cmake -DCMAKE_BUILD_TYPE='Release' -DCMAKE_PREFIX_PATH='/OpenMS/contrib-build/;/usr/;/usr/local' -DCMAKE_IGNORE_PREFIX_PATH=/root/miniforge3 -DHAS_XSERVER=OFF -DBOOST_USE_STATIC=OFF ../OpenMS
102+
SHELL ["mamba", "run", "-n", "streamlit-env", "/bin/bash", "-c"]
103+
RUN cmake -DPYOPENMS=ON -DPY_MEMLEAK_DISABLE=On -DCMAKE_IGNORE_PREFIX_PATH=/root/miniforge3 .
91104

92105
# Build TOPP tools and clean up.
93106
RUN make -j4 TOPP

0 commit comments

Comments
 (0)