configure.svn-base 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #!/bin/bash
  2. #
  3. # Copyright 2010 Intel Corporation
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. PID=$$
  18. if [ $# -lt 1 ]; then
  19. echo "Usage: $0 emulator"
  20. echo " $0 SCC_LINUX"
  21. echo " $0 SCC_LINUX ADD_POWER_API"
  22. echo " $0 SCC_BAREMETAL"
  23. echo "See README for power management options"
  24. exit
  25. fi
  26. if [ "$1" = "SCC_LINUX" ] || [ "$1" = "SCC_BAREMETAL" ]; then
  27. if [ "$1" = "SCC_LINUX" ]; then BAREMETAL=0; else BAREMETAL=1; fi
  28. OMP_EMULATOR=0
  29. MAKE_MPB="make mpb"
  30. else
  31. MAKE_MPB=""
  32. PSSH_MPB_C=""
  33. PSSH_MPB_CL=""
  34. if [ "$1" = "emulator" ]; then
  35. OMP_EMULATOR=1
  36. else
  37. echo Incorrect platform: $1
  38. exit 1
  39. fi
  40. fi
  41. POWERPARS="0"
  42. if [ $# -eq 2 ] && [ "$2" = "ADD_POWER_API" ]; then
  43. POWERPARS="0 1"
  44. fi
  45. ROOT=`pwd`
  46. COMFILE=common/symbols
  47. echo "#########################################################" > $COMFILE
  48. echo "# DO NOT EDIT BY HAND!! This file gets overwritten each #" >> $COMFILE
  49. echo "# time the configure script is run. Insert any changes #" >> $COMFILE
  50. echo "# in file common/symbols.in instead. #" >> $COMFILE
  51. echo "#########################################################" >> $COMFILE
  52. echo "" >> $COMFILE
  53. #note: must use colon for sed separator; slash conflicts with symbol(s) in path
  54. cat $COMFILE.in | sed "s:_INSERT_BMVAL_INSERT_:${BAREMETAL}:" | \
  55. sed "s:_INSERT_ROOTDIR_INSERT_:${ROOT}:" | \
  56. sed "s:_INSERT_EMVAL_INSERT_:${OMP_EMULATOR}:" >> $COMFILE
  57. RUNFILE=utils/rccerun
  58. cat $RUNFILE.in | sed "s:_INSERT_ROOTDIR_INSERT_:${ROOT}:" | \
  59. sed "s:_INSERT_BINDIR_INSERT_:$1:" | \
  60. sed "s:_INSERT_EMVAL_INSERT_:${OMP_EMULATOR}:" > $RUNFILE
  61. chmod u+x $RUNFILE
  62. mv $RUNFILE .
  63. MAKEALL=utils/makeall
  64. cat $MAKEALL.in | sed "s:_INSERT_POWERPARS_INSERT_:${POWERPARS}:" | \
  65. sed "s:_INSERT_MAKE_MPB_:${MAKE_MPB}:" > $MAKEALL
  66. chmod u+x $MAKEALL
  67. mv $MAKEALL .
  68. #create scripts for killing processes on the cores and the MCPC containing a user specified string
  69. #note: this only makes sense on the SCC platform itself, not the emulator
  70. if [ "$OMP_EMULATOR" -eq 0 ]; then
  71. SHARED=/shared/`whoami`
  72. if [ ! \( -d $SHARED \) ]; then
  73. echo Creating directory $SHARED
  74. mkdir $SHARED
  75. fi
  76. KILLIT=utils/killit
  77. cat $KILLIT.in | sed "s:_INSERT_SHAREDDIR_INSERT_:${SHARED}:" > $KILLIT
  78. KILLCORE=utils/killcorePIDs
  79. cat $KILLCORE.in | sed "s:_INSERT_SHAREDDIR_INSERT_:${SHARED}:" > $KILLCORE
  80. chmod u+x $KILLIT $KILLCORE
  81. ALLHOSTS=utils/allhosts
  82. mv $KILLIT $KILLCORE $SHARED
  83. cp $ALLHOSTS $SHARED
  84. fi