It also wouldn't be crazy for the `nim c` / `nim cpp` compiler drivers to 
accept some sample program invocation and do the program - sample-run - 
re-compile three stage process more automatically, but that isn't in place 
either. My `nim-pgo` script just assumes the usual `~/.cache/nim/r` locations I 
mentioned. The short of my script is: 
    
    
    nim $be -c --cc:gcc -d:release -d:danger $nimOpts "$prog.nim" || exit 1
    inputs=$(echo $nimcache/*.c*)
    $cc -fprofile-generate $inputs -o $prog $ccL || exit 1
    rm -f *.gcda
    eval "$cmd"
    $cc -fprofile-use      $inputs -o $prog $ccL
    
    
    Run

but I also echo some things like PWD and set up those `$` environment vars.

Reply via email to