time-current-version.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #! /bin/bash
  2. # This builds Reduec from the most up to date subversion revision
  3. # and runs the test scripts. It puts a copy of the output from the
  4. # testing in a file "red-REVISION:DATE.log"
  5. #
  6. # If invoked with an argument "profile" it will re-profile the CSL
  7. # version of Reduce before collecting the timings.
  8. # If given "fetch" it will bring the current sources into step with the
  9. # sourceforge repository before doing anything. Even though I generally want
  10. # to measure a sourcefore version I make the default behaviour without
  11. # "fetch" be to avoid overwriting current local changes.
  12. # "nopsl" is for use on platforms where the PSL version is not available.
  13. #
  14. # The above options can be given in any order and with or without prefixed
  15. # "-" or "--". In fact the decoding is very crude indeed so any argument with
  16. # those strings of letters included will be acted upon.
  17. #
  18. # HOWEVER in ALL cases this will remove and rebuild the cslbuild and
  19. # pslbuild directories.
  20. P=""
  21. F=""
  22. NOPSL="--csl --psl"
  23. case "$*" in
  24. *profile*)
  25. P="P"
  26. ;;
  27. esac
  28. case "$*" in
  29. *fetch*)
  30. F="F"
  31. ;;
  32. esac
  33. case "$*" in
  34. *nopsl*)
  35. NOPSL="--csl"
  36. ;;
  37. esac
  38. if test "$F" = "F"
  39. then
  40. svn -R revert .
  41. svn update
  42. fi
  43. NPROC=`nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || printf "1"`
  44. rm -rf cslbuild pslbuild
  45. ./autogen.sh
  46. ( ./configure --without-autogen --with-csl
  47. for d in cslbuild/*-*-*
  48. do
  49. cd $d/fox; make -j $NPROC install
  50. cd ../crli*; make -j $NPROC install
  51. cd ../libffi*; make -j $NPROC install
  52. cd ../soft*; make -j $NPROC install
  53. cd ../csl
  54. make -j $NPROC bootstrapreduce
  55. cd ../../..
  56. done
  57. cd `ls cslbuild/*/csl | head -1` && \
  58. make -j $NPROC standard-c-code && \
  59. cd ../../..
  60. make -j $NPROC reduce.img ) &
  61. CSL=$!
  62. case "$NOPSL" in
  63. *psl*)
  64. ./configure --without-autogen --with-psl
  65. make psl
  66. ;;
  67. esac
  68. wait $CSL
  69. if test "$P" = "P"
  70. then
  71. make profile
  72. make reduce.img
  73. fi
  74. script -c "time scripts/testall.sh --noregressions $NOPSL" \
  75. red-`scripts/revision.sh`$P:`date +%y-%m-%d`.log
  76. printf "Data collected\n"
  77. exit 0