Changeset 30a5316 in rtems-testing for rtems


Ignore:
Timestamp:
Jan 8, 2013, 8:37:49 PM (7 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
c9c3217
Parents:
4659dc5
Message:

bit_all_bsps: Add support for GNU parallel driven builds

This was a significant rework which added command line arguments
and a dependency on GNU parallel if the -p option is used. This allows
a build machine to be fully utilized while building all BSPs in a
particular configuration.

Location:
rtems
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • rtems/bit_all_bsps

    r4659dc5 r30a5316  
    33#  Test build all the tool configurations
    44#
     5
     6#  Checks the status returned by executables and exits if it is non-zero.
     7check_fatal()
     8{
     9  if [ $1 -eq 0 ] ; then
     10    return
     11  fi
     12  shift
     13  echo "ERROR: $*" >&2
     14  exit $?
     15}
    516
    617# Include user configurable information
     
    920. ./user.cfg
    1021
    11 #
    12 #  Set up variables which control the scripts behavior
    13 verbose=yes
    14 testing=no
    15 quit_on_error=yes
    16 do_barebsps=no
    17 if [ "x${BSP}" = "x" ]; then
    18   BSP=all
    19 fi
    20 
    21 
    22 #
    23 #  Now get started
    24 #
    25 start=`date`
    26 
    2722# Verify that the environment is correct
    2823if [ ! -d log ] ; then
     
    3025  exit 1
    3126fi
     27
     28usage()
     29{
     30  echo "$0: arguments"
     31  echo "  where arguments are:"
     32  echo "    -t                     enable test mode (default=no)"
     33  echo "    -p                     execute builds with GNU parallel"
     34  echo "                             default is sequential"
     35  echo "    -j N                   when parallel, number of jobs"
     36  echo "    -v                     disable verbose mode"
     37}
     38
     39toggle()
     40{
     41  if [ $1 = "no" ] ; then
     42    echo "yes"
     43    return
     44  fi
     45  echo "no"
     46}
     47
     48#  Set up variables which control the scripts behavior
     49verbose=yes
     50testing=no
     51do_parallel=no
     52jobs=NOT_SET
     53
     54while getopts j:ptv OPT
     55do
     56  case "$OPT" in
     57    t) testing=`toggle ${testing}` ;;
     58    j) jobs="${OPTARG}" ;;
     59    p) do_parallel=`toggle ${do_parallel}` ;;
     60    v) verbose=`toggle ${verbose}` ;;
     61    *) usage ; exit 1 ;;
     62  esac
     63done
     64
     65shiftcount=`expr $OPTIND - 1`
     66shift $shiftcount
     67
     68if [ ${do_parallel} = "yes" ] ; then
     69  parallel --version 2>&1 | grep "GNU Parallel" >/dev/null
     70  check_fatal $? "GNU parallel is not installed"
     71
     72  JOBS=
     73  case ${jobs} in
     74    NOT_SET)
     75      JOBS=""
     76      ;;
     77    ''|*[!0-9]*)
     78      check_fatal 1 "Number of jobs (${jobs}) specified is not a number"
     79      ;;
     80    *)
     81      JOBS="-j ${jobs}"
     82      ;;
     83  esac
     84fi
     85
     86#
     87#  Now get started
     88#
     89start=`date`
    3290
    3391# Determine the list of CPUs to build
     
    3896  CPUs=
    3997  for c in arm avr bfin h8300 i386 lm32 m32c m32r m68k mips \
    40            powerpc sh sparc sparc64
     98           powerpc sh sparc sparc64 v850
    4199  do
    42100    if [ -r ${RTEMS}/cpukit/score/cpu/${c} ] ; then
     
    70128      bfin)    all_bsps="eZKit533 bf537Stamp" ;;
    71129      arm)     all_bsps="csb336 csb337 csb637 edb7312 gba gp32 nds"
    72                all_bsps="${all_bsps} rtl22xx rtl22xx_t smdk2410"
    73                all_bsps="${all_bsps} lpc2478 gumstix" ;;
     130               all_bsps="${all_bsps} rtl22xx rtl22xx_t smdk2410"
     131               all_bsps="${all_bsps} lpc2478 gumstix" ;;
    74132      h8300)   all_bsps="h8sim" ;;
    75133      i386)    all_bsps="i386ex pc386 pc386dx pc486 pc586 pc686"
    76                all_bsps="${all_bsps} ts_386ex" ;;
     134               all_bsps="${all_bsps} ts_386ex" ;;
    77135      lm32)    all_bsps="lm32_evr" ;;
    78136      m32c)    all_bsps="m32csim" ;;
    79137      m32r)    all_bsps="m32rsim" ;;
    80138      m68k)    all_bsps="gen68360 gen68360_040 mvme136 mvme147 mvme147s"
    81                all_bsps="${all_bsps} mvme162 mvme162lx mvme167 ods68302"
    82                all_bsps="${all_bsps} sim68000 mcf5206elite "
    83                all_bsps="${all_bsps} uC5282 mcf52235 mcf5329"
    84                all_bsps="${all_bsps} gen68302 csb360 simcpu32 mrm332 av5282"
    85                all_bsps="${all_bsps} gen68340 mcf5235 idp pgh360"
    86                all_bsps="${all_bsps} m5484FireEngine" ;;
     139               all_bsps="${all_bsps} mvme162 mvme162lx mvme167 ods68302"
     140               all_bsps="${all_bsps} sim68000 mcf5206elite "
     141               all_bsps="${all_bsps} uC5282 mcf52235 mcf5329"
     142               all_bsps="${all_bsps} gen68302 csb360 simcpu32 mrm332 av5282"
     143               all_bsps="${all_bsps} gen68340 mcf5235 idp pgh360"
     144               all_bsps="${all_bsps} m5484FireEngine" ;;
    87145      mips)    all_bsps="jmr3904 genmongoosev csb350 hurricane"
    88                all_bsps="${all_bsps} rbtx4925 rbtx4938" ;;
     146               all_bsps="${all_bsps} rbtx4925 rbtx4938" ;;
    89147      nios2)   all_bsps="nios2_iss" ;;
    90148      powerpc) all_bsps="psim score603e mcp750 mvme2100 mvme2307 mvme3100"
    91                all_bsps="${all_bsps} mpc8260ads ss555 mvme5500 ep1a"
    92                all_bsps="${all_bsps} pm520_cr825 pm520_ze30"
    93                all_bsps="${all_bsps} mbx821_001 mbx821_002 mbx821_002b"
    94                all_bsps="${all_bsps} mbx860_1b mbx860_001b mbx860_002"
    95                all_bsps="${all_bsps} mbx860_005b mtx603e brs5l icecube"
    96                all_bsps="${all_bsps} virtex mpc8349eamds hsc_cm01 haleakala"
    97                all_bsps="${all_bsps} mpc8313erdb mpc5566evb"
    98                all_bsps="${all_bsps} pghplus tqm8xx_stk8xx" ;;
     149               all_bsps="${all_bsps} mpc8260ads ss555 mvme5500 ep1a"
     150               all_bsps="${all_bsps} pm520_cr825 pm520_ze30"
     151               all_bsps="${all_bsps} mbx821_001 mbx821_002 mbx821_002b"
     152               all_bsps="${all_bsps} mbx860_1b mbx860_001b mbx860_002"
     153               all_bsps="${all_bsps} mbx860_005b mtx603e brs5l icecube"
     154               all_bsps="${all_bsps} virtex mpc8349eamds hsc_cm01 haleakala"
     155               all_bsps="${all_bsps} mpc8313erdb mpc5566evb"
     156               all_bsps="${all_bsps} pghplus tqm8xx_stk8xx" ;;
    99157      sh)      all_bsps="gensh1 gensh2 gensh4"
    100                all_bsps="${all_bsps} simsh1 simsh2 simsh4" ;;
     158               all_bsps="${all_bsps} simsh1 simsh2 simsh4" ;;
    101159      sparc)   all_bsps="sis erc32 leon2 leon3" ;;
    102160      sparc64) all_bsps="usiii niagara" ;;
     
    104162      unix)    all_bsps="posix"
    105163
    106         supported=no
    107         # check to see if this host has a simulator port
    108         case `${RTEMS}/config.guess` in
    109           i[3456]86-pc-linux*)  supported=yes ;;
    110           sparc-sun-solaris*)   supported=yes ;;
    111           i[3456]86-*freebsd2*) supported=yes ;;
    112           *hpux*)
    113              echo "You are on a platform which needs to be tested".
    114              echo "HPUX has not been tested with the autoconf configuration."
    115              exit 0
    116              ;;
    117         esac
    118         ;;
     164        supported=no
     165        # check to see if this host has a simulator port
     166        case `${RTEMS}/config.guess` in
     167          i[3456]86-pc-linux*)  supported=yes ;;
     168          sparc-sun-solaris*)   supported=yes ;;
     169          i[3456]86-*freebsd2*) supported=yes ;;
     170          *hpux*)
     171             echo "You are on a platform which needs to be tested".
     172             echo "HPUX has not been tested with the autoconf configuration."
     173             exit 0
     174             ;;
     175        esac
     176        ;;
    119177      *)
    120         echo "UNKNOWN CPU ${CPU} -- add to bit_all"
    121         ;;
     178        echo "UNKNOWN CPU ${CPU} -- add to bit_all"
     179        ;;
    122180    esac
    123181
     
    134192}
    135193
     194if [ ${do_parallel} = "yes" ] ; then
     195  cp /dev/null parallel_bsps.tmp
     196fi
    136197
    137198# Now cycle through all the CPUs selected
    138199for CPU in ${CPUS}
    139200do
    140 
    141 
    142201  #
    143202  #  Decide to cycle over all the BSPs
    144203  #
    145   if [ ${BSP} = "all" ] ; then
    146     get_bsps
    147     BSPS_TO_TEST="${ALL_BSPS}"
    148   else
    149     BSPS_TO_TEST="${BSP}"
    150   fi
    151 
    152   if [ "X${BSPS_TO_TEST}" != "X" ] ; then
    153     for BSP_TO_TEST in ${BSPS_TO_TEST}
    154     do
    155       echo "Building RTEMS targetting ${CPU} for the ${BSP_TO_TEST} board"
    156       logfile=log/${CPU}-${BSP_TO_TEST}.log
     204  get_bsps
     205
     206  for BSP_TO_TEST in ${ALL_BSPS}
     207  do
     208    logfile=log/${CPU}-${BSP_TO_TEST}.log
     209    CMD="./bit_rtems $CPU $BSP_TO_TEST"
     210
     211    # build the BSPs serially
     212    if [ ${do_parallel} = no ] ; then
    157213      if [ ${verbose} = yes ] ; then
    158          echo "./bit_rtems $CPU $BSP_TO_TEST >${logfile} 2>&1"
     214        echo "Building RTEMS targetting ${CPU} for the ${BSP_TO_TEST} board"
    159215      fi
    160       if [ ${testing} = no ] ; then
    161         BUILDDIR=build-${CPU}-${BSP_TO_TEST}-rtems
    162         ./bit_rtems $CPU $BSP_TO_TEST >${logfile} 2>&1
    163         mv ${BUILDDIR}/${BSP_TO_TEST}/test*/*.log log 2>/dev/null
    164         du -s -k ${BUILDDIR}
    165         rm -rf ${BUILDDIR}
     216
     217      # echo the command which will be used to build the BSP
     218      if [ ${testing} = yes ] ; then
     219        echo "${CMD} >${logfile} 2>&1"
     220        continue
    166221      fi
    167     done
    168   fi
    169 
     222
     223      ${CMD} >${logfile} 2>&1
     224      continue
     225    fi
     226
     227    # generate parallel script
     228    echo "${CMD} >${logfile} 2>&1" >>parallel_bsps.tmp
     229
     230  done
    170231done
     232
     233if [ ${do_parallel} = yes ] ; then
     234  if [ ${verbose} = yes ] ; then
     235    echo "Initiating parallel build of `wc -l parallel_bsps.tmp` RTEMS BSPs"
     236    echo "  parallel_bsps.tmp is the script being executed"
     237  fi
     238  if [ ${testing} = no ] ; then
     239    cat parallel_bsps.tmp | parallel --verbose
     240  fi
     241   
     242fi
    171243
    172244# Now we are done
  • rtems/bit_rtems

    r4659dc5 r30a5316  
    1 #! /bin/sh -x
     1#! /bin/sh
    22#
    33#  Shell script to configure and build rtems
  • rtems/common.sh

    r4659dc5 r30a5316  
    6767case ${CPU} in
    6868  a29k)        ;;
    69   arm)         ;;
     69  #arm)         ;;
     70  arm)
     71    # Cover up some insanity
     72    CPU=arm
     73    type arm-rtemseabi4.11-gcc >/dev/null 2>&1
     74    if [ $? -eq 0 ] ; then
     75      target=arm-rtemseabi4.11
     76    fi
     77    ;;
    7078  avr)         ;;
    7179  bfin)         ;;
Note: See TracChangeset for help on using the changeset viewer.