pocketpy/run_profile.sh
Kanika Kapoor c7572c76ba Fix amalgamation script to work with python3-only environments (#444)
- Use sys.executable in Python scripts (amalgamate.py, cmake_build.py) instead of hardcoded 'python'
- Update shell scripts to prefer python3 over python with fallback
- Fix scripts/run_tests.py to detect python3 for CPython benchmarking

This fixes the issue where the amalgamation script fails on Linux systems
that only have python3 available and no 'python' symlink.
2025-12-27 00:42:53 +05:30

14 lines
358 B
Bash

set -e
# Use python3 if available, otherwise fall back to python
PYTHON=$(command -v python3 >/dev/null 2>&1 && echo python3 || echo python)
$PYTHON prebuild.py
SRC=$(find src/ -name "*.c")
gcc -pg -Og -std=c11 -Wfatal-errors -o main $SRC src2/main.c -Iinclude -lm -ldl -DNDEBUG -flto
./main benchmarks/fib.py
gprof main gmon.out > gprof.txt
rm gmon.out