fix: pin the full image's C++ libraries to AtCoder's versions - #21
Merged
Merged
Conversation
apt's libabsl-dev (20220623) sat in /usr/lib/<triplet>, which the linker searches before /usr/local/lib, so programs compiled against the 20250512 headers linked the old libraries. AtCoder only has 20250512.1. Co-Authored-By: Claude Code <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQaZJRoT1k7VZ8ThsuLdFa
…der does ojt passed none of AtCoder's defines or libraries, so OR-Tools headers did not compile and Abseil, LightGBM, LibTorch and friends did not link. ojt now adds -fopenmp, -DNOMINMAX and -lstdc++exp like the judge, and in the full image reads cxx/full-flags.txt (AtCoder's defines and -l list, dropping libraries the image lacks). LightGBM is installed as a static library like AtCoder's, LibTorch gets an rpath, and libstdc++ is resolved before OR-Tools, whose arm64 build re-exports standard library symbols and otherwise gets linked into every program (crashing together with LibTorch). A smoke test builds and runs a program using all of them with ojt. Co-Authored-By: Claude Code <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQaZJRoT1k7VZ8ThsuLdFa
…tCoder The prebuilt arm64 OR-Tools is an AlmaLinux build that re-exports libstdc++ symbols; linked together with LibTorch it crashed before main during Abseil's flag registration. Build Abseil 20250512.1 and OR-Tools 9.14 (with GLPK) from source with AtCoder's options in a separate cxx-libs-build stage, cached independently of full. GCC 15 moves to its own gcc stage so edits to light do not invalidate it. The -lstdc++ workaround is no longer needed and -lGLPK is back in ojt's flags. Co-Authored-By: Claude Code <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQaZJRoT1k7VZ8ThsuLdFa
…the Dockerfile Running ojt mid-build tested an unfinished image, reached PyPI through oj's update check, and invalidated the cache below it whenever the check changed. The build job now loads the image it just built and runs test/light.sh or test/full.sh (C++, Python, PyPy and Rust through ojt, plus the full image's C++ libraries together). Co-Authored-By: Claude Code <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQaZJRoT1k7VZ8ThsuLdFa
Co-Authored-By: Claude Code <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQaZJRoT1k7VZ8ThsuLdFa
…d into /usr/local Co-Authored-By: Claude Code <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQaZJRoT1k7VZ8ThsuLdFa
…orch, like AtCoder -L/opt/libtorch/lib made -lprotobuf pick libtorch's older copy instead of the one built with OR-Tools, so OR-Tools programs failed to link on amd64. Co-Authored-By: Claude Code <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQaZJRoT1k7VZ8ThsuLdFa
Boost 1.88.0 is built from source with AtCoder's bootstrap/b2 options in its own cached stage (Ubuntu's 1.83 lacked charconv, contract, process and stacktrace_from_exception, which ojt had to skip). Z3 4.15.2 comes from the official release binaries, and immer / unordered_dense are pinned to v0.8.1 / v4.5.0. apt's Boost and Z3 are dropped. The full test now also links boost::json. Co-Authored-By: Claude Code <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQaZJRoT1k7VZ8ThsuLdFa
# Conflicts: # Dockerfile
…ktree-pin-cxx-libs # Conflicts: # Dockerfile # README.md
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
Pin the full image's C++ libraries to the versions AtCoder's 2025-10 judge uses.
Depends on #20. This branch is based on it, so the diff shows #20's commits until #20 is merged.
boost-buildstage (cached independently)x64-glibc-2.39, arm64arm64-glibc-2.34)ojtno longer has to skipcharconv,contract,processandstacktrace_from_exception. Every library in AtCoder's link list is now present.test/full-smoke.cppnow also linksboost::json, so a compiled Boost library is exercised.Test
CI, all four builds including the test step: https://github.com/carbon-nil/atcoder-docker/actions/runs/35999608939
ojt: skiplines.test/full.shpasses on amd64 and arm64 (C++, Python, PyPy, Rust, and the combined library program withboost::json).🤖 Generated with Claude Code
https://claude.ai/code/session_01VQaZJRoT1k7VZ8ThsuLdFa