common/autoconf/build-performance.m4
changeset 26131 311b5e288cf5
parent 23985 39f417e8c59f
child 26907 da70acacfe57
equal deleted inserted replaced
26130:2ea1262921e0 26131:311b5e288cf5
   129   AC_ARG_WITH(jobs, [AS_HELP_STRING([--with-jobs],
   129   AC_ARG_WITH(jobs, [AS_HELP_STRING([--with-jobs],
   130       [number of parallel jobs to let make run @<:@calculated based on cores and memory@:>@])])
   130       [number of parallel jobs to let make run @<:@calculated based on cores and memory@:>@])])
   131   if test "x$with_jobs" = x; then
   131   if test "x$with_jobs" = x; then
   132     # Number of jobs was not specified, calculate.
   132     # Number of jobs was not specified, calculate.
   133     AC_MSG_CHECKING([for appropriate number of jobs to run in parallel])
   133     AC_MSG_CHECKING([for appropriate number of jobs to run in parallel])
   134     # Approximate memory in GB, rounding up a bit.
   134     # Approximate memory in GB.
   135     memory_gb=`expr $MEMORY_SIZE / 1100`
   135     memory_gb=`expr $MEMORY_SIZE / 1024`
   136     # Pick the lowest of memory in gb and number of cores.
   136     # Pick the lowest of memory in gb and number of cores.
   137     if test "$memory_gb" -lt "$NUM_CORES"; then
   137     if test "$memory_gb" -lt "$NUM_CORES"; then
   138       JOBS="$memory_gb"
   138       JOBS="$memory_gb"
   139     else
   139     else
   140       JOBS="$NUM_CORES"
   140       JOBS="$NUM_CORES"
   289     FOUND_VERSION=`$SJAVAC_SERVER_JAVA -version 2>&1 | grep " version \""`
   289     FOUND_VERSION=`$SJAVAC_SERVER_JAVA -version 2>&1 | grep " version \""`
   290     if test "x$FOUND_VERSION" = x; then
   290     if test "x$FOUND_VERSION" = x; then
   291       AC_MSG_ERROR([Could not execute server java: $SJAVAC_SERVER_JAVA])
   291       AC_MSG_ERROR([Could not execute server java: $SJAVAC_SERVER_JAVA])
   292     fi
   292     fi
   293   else
   293   else
   294     SJAVAC_SERVER_JAVA=""
   294     SJAVAC_SERVER_JAVA="$JAVA"
   295     # Hotspot specific options.
       
   296     ADD_JVM_ARG_IF_OK([-verbosegc],SJAVAC_SERVER_JAVA,[$JAVA])
       
   297     # JRockit specific options.
       
   298     ADD_JVM_ARG_IF_OK([-Xverbose:gc],SJAVAC_SERVER_JAVA,[$JAVA])
       
   299     SJAVAC_SERVER_JAVA="$JAVA $SJAVAC_SERVER_JAVA"
       
   300   fi
   295   fi
   301   AC_SUBST(SJAVAC_SERVER_JAVA)
   296   AC_SUBST(SJAVAC_SERVER_JAVA)
   302 
   297 
   303   if test "$MEMORY_SIZE" -gt "2500"; then
   298   if test "$MEMORY_SIZE" -gt "3000"; then
   304     ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
   299     ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
   305     if test "$JVM_ARG_OK" = true; then
   300     if test "$JVM_ARG_OK" = true; then
   306       JVM_64BIT=true
   301       JVM_64BIT=true
   307       JVM_ARG_OK=false
   302       JVM_ARG_OK=false
   308     fi
   303     fi
   309   fi
   304   fi
   310 
   305 
       
   306   MX_VALUE=`expr $MEMORY_SIZE / 2`
   311   if test "$JVM_64BIT" = true; then
   307   if test "$JVM_64BIT" = true; then
   312     if test "$MEMORY_SIZE" -gt "17000"; then
   308     # Set ms lower than mx since more than one instance of the server might
   313       ADD_JVM_ARG_IF_OK([-Xms10G -Xmx10G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
   309     # get launched at the same time before they figure out which instance won.
   314     fi
   310     MS_VALUE=512
   315     if test "$MEMORY_SIZE" -gt "10000" && test "$JVM_ARG_OK" = false; then
   311     if test "$MX_VALUE" -gt "2048"; then
   316       ADD_JVM_ARG_IF_OK([-Xms6G -Xmx6G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
   312       MX_VALUE=2048
   317     fi
   313     fi
   318     if test "$MEMORY_SIZE" -gt "5000" && test "$JVM_ARG_OK" = false; then
   314   else
   319       ADD_JVM_ARG_IF_OK([-Xms1G -Xmx3G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
   315     MS_VALUE=256
   320     fi
   316     if test "$MX_VALUE" -gt "1500"; then
   321     if test "$MEMORY_SIZE" -gt "3800" && test "$JVM_ARG_OK" = false; then
   317       MX_VALUE=1500
   322       ADD_JVM_ARG_IF_OK([-Xms1G -Xmx2500M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
   318     fi
   323     fi
   319   fi
   324   fi
   320   if test "$MX_VALUE" -lt "512"; then
   325   if test "$MEMORY_SIZE" -gt "2500" && test "$JVM_ARG_OK" = false; then
   321     MX_VALUE=512
   326     ADD_JVM_ARG_IF_OK([-Xms1000M -Xmx1500M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
   322   fi
   327   fi
   323   ADD_JVM_ARG_IF_OK([-Xms${MS_VALUE}M -Xmx${MX_VALUE}M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
   328   if test "$MEMORY_SIZE" -gt "1000" && test "$JVM_ARG_OK" = false; then
   324 
   329     ADD_JVM_ARG_IF_OK([-Xms400M -Xmx1100M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
       
   330   fi
       
   331   if test "$JVM_ARG_OK" = false; then
       
   332     ADD_JVM_ARG_IF_OK([-Xms256M -Xmx512M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
       
   333   fi
       
   334 
       
   335   AC_MSG_CHECKING([whether to use sjavac])
       
   336   AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac],
   325   AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac],
   337       [use sjavac to do fast incremental compiles @<:@disabled@:>@])],
   326       [use sjavac to do fast incremental compiles @<:@disabled@:>@])],
   338       [ENABLE_SJAVAC="${enableval}"], [ENABLE_SJAVAC='no'])
   327       [ENABLE_SJAVAC="${enableval}"], [ENABLE_SJAVAC='no'])
       
   328   if test "x$JVM_ARG_OK" = "xfalse"; then
       
   329     AC_MSG_WARN([Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling sjavac])
       
   330     ENABLE_SJAVAC=no;
       
   331   fi
       
   332   AC_MSG_CHECKING([whether to use sjavac])
   339   AC_MSG_RESULT([$ENABLE_SJAVAC])
   333   AC_MSG_RESULT([$ENABLE_SJAVAC])
   340   AC_SUBST(ENABLE_SJAVAC)
   334   AC_SUBST(ENABLE_SJAVAC)
   341 
   335 
   342   if test "x$ENABLE_SJAVAC" = xyes; then
   336   if test "x$ENABLE_SJAVAC" = xyes; then
   343     SJAVAC_SERVER_DIR="$OUTPUT_ROOT/javacservers"
   337     SJAVAC_SERVER_DIR="$OUTPUT_ROOT/javacservers"