From f506eb580eb335fa053e757b3d6cf64a87be7ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Fri, 24 Oct 2025 16:28:32 +0200 Subject: [PATCH] Improve ALICE bashrc --- docs/tools/bashrc-alice.sh | 15 +++++++++++---- docs/troubleshooting/README.md | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/tools/bashrc-alice.sh b/docs/tools/bashrc-alice.sh index 1d33e6b1..a3b93aaf 100644 --- a/docs/tools/bashrc-alice.sh +++ b/docs/tools/bashrc-alice.sh @@ -18,6 +18,7 @@ alias root='root -l' # Command "recompile O2Physics" will invoke "ninja install" for the "master" branch of O2Physics. # Command "recompile O2Physics my-branch" will invoke "ninja install" for the "my-branch" branch of O2Physics. # Command "recompile O2Physics my-branch Common" will invoke "ninja Common/install" for the "my-branch" branch of O2Physics. +# Command "recompile O2Physics my-branch Common -j 1" will invoke "ninja Common/install -j 1" for the "my-branch" branch of O2Physics. recompile() { # set -o xtrace # to print out each command [ "$1" ] || { echo "Provide a package name"; return 1; } @@ -27,6 +28,9 @@ recompile() { target="" target_name="all" [ "$3" ] && { target="$3/"; target_name="$3"; } + shift + shift + shift dir_pwd=$(pwd) dir_build="$ALIBUILD_WORK_DIR/BUILD/${package}-latest-${branch}/${package}" log="$(dirname "$dir_build")/log" @@ -35,8 +39,11 @@ recompile() { direnv allow || { echo "Failed to allow direnv"; return 1; } eval "$(direnv export "$SHELL")" echo "Recompiling ${package}_${branch}_${target_name}..." + if [[ -n "$*" ]]; then + echo "Additional options:" "$@" + fi start=$(date +%s) - ninja "${target}install" > "$log" 2>&1 + ninja "${target}install" "$@" > "$log" 2>&1 ec=$? end=$(date +%s) echo "Compilation exited with: $ec" @@ -52,9 +59,9 @@ recompile() { } # Recompile O2 with ninja. -recompile-o2() { recompile "O2" "$1" "$2"; } +recompile-o2() { recompile "O2" "$@"; } # Recompile O2Physics with ninja. -recompile-o2p() { recompile "O2Physics" "$1" "$2"; } +recompile-o2p() { recompile "O2Physics" "$@"; } # Find the workflow that produces a given table. # Limited functionality. Use find_dependencies.py for a full search. @@ -82,5 +89,5 @@ debug-o2-compile() { # Find runtime error messages in an execution log. debug-o2-run() { [ "$1" ] || { echo "Provide a log file"; return 1; } - grep -n -e "\\[ERROR\\]" -e "\\[FATAL\\]" -e "segmentation" -e "Segmentation" -e "SEGMENTATION" -e "command not found" -e "Program crashed" -e "Error:" -e "Error in " -e "\\[WARN\\]" -e "Warning in " "$1" + grep -n -e "\\[ERROR\\]" -e "\\[FATAL\\]" -e "\\[CRITICAL\\]" -e "segmentation" -e "Segmentation" -e "SEGMENTATION" -e "command not found" -e "Program crashed" -e "Error:" -e "Error in " -e "\\[WARN\\]" -e "Warning in " "$1" } diff --git a/docs/troubleshooting/README.md b/docs/troubleshooting/README.md index b21cedb2..5868392a 100644 --- a/docs/troubleshooting/README.md +++ b/docs/troubleshooting/README.md @@ -36,7 +36,7 @@ o2-analysis-... > stdout.log 2>&1 Search for keywords related to problems in the log file using the `grep` command: ```bash -grep -e "\\[ERROR\\]" -e "\\[FATAL\\]" -e "segmentation" -e "Segmentation" -e "SEGMENTATION" -e "command not found" -e "Program crashed" -e "Error:" -e "Error in " -e "\\[WARN\\]" -e "Warning in " stdout.log +grep -e "\\[ERROR\\]" -e "\\[FATAL\\]" -e "\\[CRITICAL\\]" -e "segmentation" -e "Segmentation" -e "SEGMENTATION" -e "command not found" -e "Program crashed" -e "Error:" -e "Error in " -e "\\[WARN\\]" -e "Warning in " stdout.log ``` See also [shell rc utilities](../tools/README.md#shell-rc-utilities).