Skip to content
Merged
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 2 additions & 0 deletions src/lakefile.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
22 changes: 20 additions & 2 deletions tests/bench_build.sh
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
22 changes: 20 additions & 2 deletions tests/bench_other.sh
Original file line number Diff line number Diff line change
@@ -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"
Loading