lean4-htt/tests/bench/compile.sh
Sebastian Ullrich 572926f5ce perf(shell/CMakeLists.txt, tests/): define NDEBUG in leanc release builds
`assert` is now being used by the C runtime
2019-08-27 16:54:29 +02:00

28 lines
606 B
Bash
Executable file

#!/usr/bin/env bash
if [ $# -eq 0 ]; then
echo "Usage: compile.sh [file]"
exit 1
fi
ulimit -s 8192
BIN_DIR=../../bin
LEAN=$BIN_DIR/lean
export LEAN_PATH=../../library:.
ff=$1
if [[ "$OSTYPE" == "msys" ]]; then
# Windows running MSYS2
# Replace /c/ with c:, and / with \\
ff=$(echo $ff | sed 's|^/\([a-z]\)/|\1:/|' | sed 's|/|\\\\|g')
fi
$LEAN --cpp="$ff".cpp "$ff"
if [ $? -ne 0 ]; then
echo "Failed to compile $ff into C++ file"
exit 1
fi
$BIN_DIR/leanc -O3 -DNDEBUG -g -o "$ff.out" $ff.cpp
if [ $? -ne 0 ]; then
echo "Failed to compile C++ file $ff.cpp"
exit 1
fi