chore: use the lean-llvm LLVM for benchmarking (#13634)

This PR makes radar use the LLVM that we actually ship to users (stored
at https://github.com/leanprover/lean-llvm). In doing so it also makes
the lake build compatible with lean-llvm, allowing us to do potential
release builds with lake in the future.
This commit is contained in:
Henrik Böving 2026-05-05 16:26:08 +02:00 committed by GitHub
parent e47636cdca
commit aa6fa1cf1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 45 additions and 5 deletions

View file

@ -52,7 +52,8 @@ if(NOT CMAKE_SYSTEM_NAME MATCHES "Emscripten")
# Use same platform flags as for Lean executables, in particular from `prepare-llvm-linux.sh`,
# but not Lean-specific `LEAN_EXTRA_CXX_FLAGS` such as fsanitize.
set(CADICAL_CXXFLAGS "${CMAKE_CXX_FLAGS}")
set(CADICAL_LDFLAGS "-Wl,-rpath=\\$$ORIGIN/../lib")
string(REPLACE "ROOT" "${CMAKE_BINARY_DIR}/stage1" CADICAL_INTERNAL_LINKER_FLAGS "${LEANC_INTERNAL_LINKER_FLAGS}")
set(CADICAL_LDFLAGS "${CADICAL_INTERNAL_LINKER_FLAGS} -Wl,-rpath=\\$$ORIGIN/../lib")
endif()
find_program(CCACHE ccache)
if(CCACHE)

View file

@ -1075,6 +1075,7 @@ string(REPLACE "ROOT" "${CMAKE_BINARY_DIR}" LEANC_INTERNAL_FLAGS "${LEANC_INTERN
string(REPLACE "ROOT" "${CMAKE_BINARY_DIR}" LEANC_INTERNAL_LINKER_FLAGS "${LEANC_INTERNAL_LINKER_FLAGS}")
toml_escape("${LEAN_EXTRA_OPTS}" LEAN_EXTRA_OPTS_TOML)
toml_escape("${LEANC_INTERNAL_FLAGS} ${LEANC_INTERNAL_LINKER_FLAGS}" LEAN_MORE_LEANC_ARGS_TOML)
if(CMAKE_BUILD_TYPE MATCHES "Debug|Release|RelWithDebInfo|MinSizeRel")
set(CMAKE_BUILD_TYPE_TOML "${CMAKE_BUILD_TYPE}")

View file

@ -46,6 +46,8 @@ moreLeanArgs = [${LEAN_EXTRA_OPTS_TOML}]
# Uncomment to limit number of reported errors further in case of overwhelming cmdline output
#weakLeanArgs = ["-DmaxErrors=1"]
moreLeancArgs = [${LEAN_MORE_LEANC_ARGS_TOML}]
${LEAN_EXTRA_LAKEFILE_TOML}
[[lean_lib]]

View file

@ -1,10 +1,28 @@
#!/usr/bin/env bash
#!/usr/bin/env nix
#! nix develop ..#oldGlibc --command /usr/bin/env bash
# This script must be called from the repo root.
# The radar environment variables must be provided.
# See also the https://github.com/leanprover/radar readme.
cmake --preset release -DWFAIL=OFF
LLVM_RELEASE=19.1.2
LLVM_TARBALL="$RADAR_CACHE/llvm/$LLVM_RELEASE.tar.zst"
if [ ! -f "$LLVM_TARBALL" ]; then
mkdir -p "$RADAR_CACHE/llvm"
curl --location -o "$LLVM_TARBALL" "https://github.com/leanprover/lean-llvm/releases/download/$LLVM_RELEASE/lean-llvm-x86_64-linux-gnu.tar.zst"
fi
mkdir -p build/release
cd build/release
eval cmake ../.. \
--preset release $(../../script/prepare-llvm-linux.sh $LLVM_TARBALL) \
-DWFAIL=OFF
rm -rf stage2
cp -r stage1 stage2
rm -rf stage3
cp -r stage1 stage3
cd ../..
make -C build/release -j"$(nproc)" bench-part1
mv tests/part1.measurements.jsonl "$RADAR_OUT"

View file

@ -1,9 +1,27 @@
#!/usr/bin/env bash
#!/usr/bin/env nix
#! nix develop ..#oldGlibc --command /usr/bin/env bash
# This script must be called from the repo root.
# The radar environment variables must be provided.
# See also the https://github.com/leanprover/radar readme.
cmake --preset release -DWFAIL=OFF
LLVM_RELEASE=19.1.2
LLVM_TARBALL="$RADAR_CACHE/llvm/$LLVM_RELEASE.tar.zst"
if [ ! -f "$LLVM_TARBALL" ]; then
mkdir -p "$RADAR_CACHE/llvm"
curl --location -o "$LLVM_TARBALL" "https://github.com/leanprover/lean-llvm/releases/download/$LLVM_RELEASE/lean-llvm-x86_64-linux-gnu.tar.zst"
fi
mkdir -p build/release
cd build/release
eval cmake ../.. \
--preset release $(../../script/prepare-llvm-linux.sh $LLVM_TARBALL) \
-DWFAIL=OFF
rm -rf stage2
cp -r stage1 stage2
rm -rf stage3
cp -r stage1 stage3
cd ../..
make -C build/release -j"$(nproc)" bench-part2
mv tests/part2.measurements.jsonl "$RADAR_OUT"