#!/bin/csh # Toggle 0/1 to change these options. In particular, if you want # to use freesect without ghc -F. (This would be necessary in order # to use a different compiler.) setenv FS_ANNOTATED 0 setenv FS_PARALLEL 0 setenv FS_GHC_F 1 #set test=S23 set test=S15 #set test=S14 make if ( $? ) exit 1 if ( $FS_GHC_F ) then ./zz $test >&! ./zz.log set zzstat=$? cat ./zz.log \ # We can also prune these in Main.hs (that's how doing now): \ # |& not |, or won't see these if use "error" b/c goes to stderr \ ## |& sed -e 's/SrcLoc {[^}]*}/SrcLoc .../g' \ |& sed -e 's/SrcLoc {[^}]*}//g' \ ## |& sed -e 's/(SrcSpanInfo {[^[][^[]*\[[^]]*]})//g' \ |& sed -e 's/)))))*/)..)/g' \ ##!! if ( $test == S23 ) then echo echo echo "(Ignore errors about missing symbols; you can examine" echo "freesect pre-processor output in the intermediate file.)" echo endif if ( $zzstat ) exit 1 ./$test else # If you want to run without using "ghc -F", consider the rest # of this file. Note that there is a #define GHC_F in Main.hs # for controlling whether or not "ghc -F" is being used. #================================ set infiles=( \ ./{$test}.hs \ ) # Must be a legal module name: set outfile=Z_`sha1sum $infiles[1] | head -c 8` #set outfile=Z_`sha1sum $infiles[1] | cut -d' ' -f1` #echo $infiles #echo $outfile #exit set extra_rtsopts if ( $FS_PARALLEL ) then set extra_rtsopts = ( \ # +RTS -i20 -RTS # (default value of granularity of resched. in ms) \ +RTS -N2 -RTS # Control.Parallel : # of cores (not including hyperthr.) \ ) endif echo freesect infiles=$infiles outfile=$outfile ./freesect \ \ # Don't forget you need the -prof ghc flag when compiling: \ # +RTS -p -RTS \ \ +RTS -K96m -RTS \ # +RTS -K16m -RTS \ \ $extra_rtsopts \ \ $outfile \ \ $infiles \ \ >&! ./z.log set zstat=$? cat ./z.log \ # We can also prune these in Main.hs (that's how doing now): \ # |& not |, or won't see these if use "error" b/c goes to stderr \ # |& sed -e 's/SrcLoc {[^}]*}/SrcLoc .../g' \ # |& sed -e 's/SrcLoc {[^}]*}//g' \ # |& sed -e 's/(SrcSpanInfo {[^[][^[]*\[[^]]*]})//g' \ |& sed -e 's/)))))*/)..)/g' \ \ #& \ #! if ( $zstat ) exit 1 # won't work for Main's exit status, after the pipe ghc --make {$outfile}.hs -main-is {$outfile}.main -o $outfile set zstat=$? if ( $test == S23 ) then echo echo echo "(Ignore errors about missing symbols; you can examine" echo "freesect pre-processor output in the intermediate file.)" echo endif if ( $zstat ) exit 1 # won't work for Main's exit status, after the pipe ./$outfile #/bin/rm -f {$outfile}.hs endif