Advertisement
Guest User

build

a guest
Mar 27th, 2015
41
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None
  1. #!/bin/bash
  2. # CCache + multicore compilation script
  3. # For "The OTX Server"
  4.  
  5. # Example:
  6. # # make clean
  7. # # time ./build.sh
  8.  
  9. # Gives:
  10. # real 3m27.070s
  11. # user 6m4.066s
  12. # sys 0m16.659s
  13.  
  14. # CCACHE recompile (from scratch):
  15. # # make clean
  16. # # time ./build.sh
  17.  
  18. # Gives:
  19. # real 0m27.620s
  20. # user 0m43.744s
  21. # sys 0m4.766s
  22.  
  23. # 1/7 of the original compile time!
  24. # When more you do it, more ccache will cache, default is limited to use 1GB storage
  25.  
  26. echo "The OTX Server build script - "
  27.  
  28. # Enable CCache
  29. if test -x `which ccache`; then
  30. echo "Using ccache"
  31. if [ -f /usr/lib/ccache/bin ]; then
  32. export PATH=/usr/lib/ccache/bin/:$PATH
  33. echo "CCache binaries located in /usr/lib/ccache/bin"
  34. else
  35. export PATH=/usr/lib/ccache/:$PATH
  36. echo "CCache binaries located in /usr/lib/ccache"
  37. fi
  38. else
  39. echo "Warning: NOT using ccache, increase build time"
  40. fi
  41.  
  42. # Get number cores
  43. CORES=`grep processor /proc/cpuinfo | wc -l`
  44. # Set make processes - 1 + number of cores
  45. MAKEOPT=$(($CORES + 1))
  46. echo ""
  47. echo "Start building on $CORES cores, using $MAKEOPT processes"
  48. echo ""
  49. make V=0 -j $MAKEOPT
Advertisement
RAW Paste Data Copied
Advertisement