< prev index next >

common/autoconf/build-performance.m4

Print this page


   1 #
   2 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


  55   else
  56     AC_MSG_RESULT([could not detect number of cores, defaulting to 1])
  57     AC_MSG_WARN([This will disable all parallelism from build!])
  58   fi
  59 ])
  60 
  61 AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
  62 [
  63   AC_MSG_CHECKING([for memory size])
  64   # Default to 1024 MB
  65   MEMORY_SIZE=1024
  66   FOUND_MEM=no
  67 
  68   if test -f /proc/meminfo; then
  69     # Looks like a Linux (or cygwin) system
  70     MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print [$]2}'`
  71     MEMORY_SIZE=`expr $MEMORY_SIZE / 1024`
  72     FOUND_MEM=yes
  73   elif test -x /usr/sbin/prtconf; then
  74     # Looks like a Solaris or AIX system
  75     MEMORY_SIZE=`/usr/sbin/prtconf | grep "^Memory [[Ss]]ize" | awk '{ print [$]3 }'`
  76     FOUND_MEM=yes
  77   elif test -x /usr/sbin/sysctl; then
  78     # Looks like a MacOSX system
  79     MEMORY_SIZE=`/usr/sbin/sysctl -n hw.memsize`
  80     MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024`
  81     FOUND_MEM=yes
  82   elif test "x$OPENJDK_BUILD_OS" = xwindows; then
  83     # Windows, but without cygwin
  84     MEMORY_SIZE=`wmic computersystem get totalphysicalmemory -value | grep = | cut -d "=" -f 2-`
  85     MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024`
  86     FOUND_MEM=yes
  87   fi
  88 
  89   if test "x$FOUND_MEM" = xyes; then
  90     AC_MSG_RESULT([$MEMORY_SIZE MB])
  91   else
  92     AC_MSG_RESULT([could not detect memory size, defaulting to $MEMORY_SIZE MB])
  93     AC_MSG_WARN([This might seriously impact build performance!])
  94   fi
  95 ])


 243 
 244     CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR \
 245         CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$TOPDIR $CCACHE"
 246 
 247     if test "x$SET_CCACHE_DIR" != x; then
 248       mkdir -p $CCACHE_DIR > /dev/null 2>&1
 249       chmod a+rwxs $CCACHE_DIR > /dev/null 2>&1
 250     fi
 251   fi
 252 ])
 253 
 254 ################################################################################
 255 #
 256 # Runs icecc-create-env once and prints the error if it fails
 257 #
 258 # $1: arguments to icecc-create-env
 259 # $2: log file
 260 #
 261 AC_DEFUN([BPERF_RUN_ICECC_CREATE_ENV],
 262 [
 263   cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
 264       && ${ICECC_CREATE_ENV} $1 > $2 2>&1
 265   if test "$?" != "0"; then
 266     AC_MSG_NOTICE([icecc-create-env output:])
 267     cat $2
 268     AC_MSG_ERROR([Failed to create icecc compiler environment])
 269   fi
 270 ])
 271 
 272 ################################################################################
 273 #
 274 # Optionally enable distributed compilation of native code using icecc/icecream
 275 #
 276 AC_DEFUN([BPERF_SETUP_ICECC],
 277 [
 278   AC_ARG_ENABLE([icecc], [AS_HELP_STRING([--enable-icecc],
 279       [enable distribted compilation of native code using icecc/icecream @<:@disabled@:>@])])
 280 
 281   if test "x${enable_icecc}" = "xyes"; then
 282     BASIC_REQUIRE_PROGS(ICECC_CMD, icecc)
 283     old_path="$PATH"
 284 


   1 #
   2 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


  55   else
  56     AC_MSG_RESULT([could not detect number of cores, defaulting to 1])
  57     AC_MSG_WARN([This will disable all parallelism from build!])
  58   fi
  59 ])
  60 
  61 AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
  62 [
  63   AC_MSG_CHECKING([for memory size])
  64   # Default to 1024 MB
  65   MEMORY_SIZE=1024
  66   FOUND_MEM=no
  67 
  68   if test -f /proc/meminfo; then
  69     # Looks like a Linux (or cygwin) system
  70     MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print [$]2}'`
  71     MEMORY_SIZE=`expr $MEMORY_SIZE / 1024`
  72     FOUND_MEM=yes
  73   elif test -x /usr/sbin/prtconf; then
  74     # Looks like a Solaris or AIX system
  75     MEMORY_SIZE=`/usr/sbin/prtconf 2> /dev/null | grep "^Memory [[Ss]]ize" | awk '{ print [$]3 }'`
  76     FOUND_MEM=yes
  77   elif test -x /usr/sbin/sysctl; then
  78     # Looks like a MacOSX system
  79     MEMORY_SIZE=`/usr/sbin/sysctl -n hw.memsize`
  80     MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024`
  81     FOUND_MEM=yes
  82   elif test "x$OPENJDK_BUILD_OS" = xwindows; then
  83     # Windows, but without cygwin
  84     MEMORY_SIZE=`wmic computersystem get totalphysicalmemory -value | grep = | cut -d "=" -f 2-`
  85     MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024`
  86     FOUND_MEM=yes
  87   fi
  88 
  89   if test "x$FOUND_MEM" = xyes; then
  90     AC_MSG_RESULT([$MEMORY_SIZE MB])
  91   else
  92     AC_MSG_RESULT([could not detect memory size, defaulting to $MEMORY_SIZE MB])
  93     AC_MSG_WARN([This might seriously impact build performance!])
  94   fi
  95 ])


 243 
 244     CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR \
 245         CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$TOPDIR $CCACHE"
 246 
 247     if test "x$SET_CCACHE_DIR" != x; then
 248       mkdir -p $CCACHE_DIR > /dev/null 2>&1
 249       chmod a+rwxs $CCACHE_DIR > /dev/null 2>&1
 250     fi
 251   fi
 252 ])
 253 
 254 ################################################################################
 255 #
 256 # Runs icecc-create-env once and prints the error if it fails
 257 #
 258 # $1: arguments to icecc-create-env
 259 # $2: log file
 260 #
 261 AC_DEFUN([BPERF_RUN_ICECC_CREATE_ENV],
 262 [
 263   ( cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
 264       && ${ICECC_CREATE_ENV} $1 > $2 2>&1 )
 265   if test "$?" != "0"; then
 266     AC_MSG_NOTICE([icecc-create-env output:])
 267     cat $2
 268     AC_MSG_ERROR([Failed to create icecc compiler environment])
 269   fi
 270 ])
 271 
 272 ################################################################################
 273 #
 274 # Optionally enable distributed compilation of native code using icecc/icecream
 275 #
 276 AC_DEFUN([BPERF_SETUP_ICECC],
 277 [
 278   AC_ARG_ENABLE([icecc], [AS_HELP_STRING([--enable-icecc],
 279       [enable distribted compilation of native code using icecc/icecream @<:@disabled@:>@])])
 280 
 281   if test "x${enable_icecc}" = "xyes"; then
 282     BASIC_REQUIRE_PROGS(ICECC_CMD, icecc)
 283     old_path="$PATH"
 284 


< prev index next >