common/autoconf/build-performance.m4

changeset 494
e64f2cb57d05
parent 478
2ba6f4da4bf3
child 512
582c696033f5
equal deleted inserted replaced
488:8a3fe0ae06a8 494:e64f2cb57d05
39 FOUND_CORES=yes 39 FOUND_CORES=yes
40 elif test -x /usr/sbin/system_profiler; then 40 elif test -x /usr/sbin/system_profiler; then
41 # Looks like a MacOSX system 41 # Looks like a MacOSX system
42 NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'` 42 NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'`
43 FOUND_CORES=yes 43 FOUND_CORES=yes
44 elif test -n "$NUMBER_OF_PROCESSORS"; then
45 # On windows, look in the env
46 NUM_CORES=$NUMBER_OF_PROCESSORS
47 FOUND_CORES=yes
44 fi 48 fi
45 49
46 # For c/c++ code we run twice as many concurrent build 50 # For c/c++ code we run twice as many concurrent build
47 # jobs than we have cores, otherwise we will stall on io. 51 # jobs than we have cores, otherwise we will stall on io.
48 CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2` 52 CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
49 53
50 if test "x$FOUND_CORES" = xyes; then 54 if test "x$FOUND_CORES" = xyes; then
51 AC_MSG_RESULT([$NUM_CORES]) 55 AC_MSG_RESULT([$NUM_CORES])
52 else 56 else
53 AC_MSG_RESULT([could not detect number of cores, defaulting to 1!]) 57 AC_MSG_RESULT([could not detect number of cores, defaulting to 1])
58 AC_MSG_WARN([This will disable all parallelism from build!])
54 fi 59 fi
55 60
56 ]) 61 ])
57 62
58 AC_DEFUN([BPERF_CHECK_MEMORY_SIZE], 63 AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
74 elif test -x /usr/sbin/system_profiler; then 79 elif test -x /usr/sbin/system_profiler; then
75 # Looks like a MacOSX system 80 # Looks like a MacOSX system
76 MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print [$]2}'` 81 MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print [$]2}'`
77 MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024` 82 MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024`
78 FOUND_MEM=yes 83 FOUND_MEM=yes
79 elif test "x$build_os" = xwindows; then 84 elif test "x$OPENJDK_BUILD_OS" = xwindows; then
80 # Windows, but without cygwin 85 # Windows, but without cygwin
81 MEMORY_SIZE=`systeminfo | grep 'Total Physical Memory:' | awk '{ print [$]4 }' | sed 's/,//'` 86 MEMORY_SIZE=`wmic computersystem get totalphysicalmemory -value | grep = | cut -d "=" -f 2-`
87 MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024`
82 FOUND_MEM=yes 88 FOUND_MEM=yes
83 fi 89 fi
84 90
85 if test "x$FOUND_MEM" = xyes; then 91 if test "x$FOUND_MEM" = xyes; then
86 AC_MSG_RESULT([$MEMORY_SIZE MB]) 92 AC_MSG_RESULT([$MEMORY_SIZE MB])
87 else 93 else
88 AC_MSG_RESULT([could not detect memory size defaulting to 1024 MB!]) 94 AC_MSG_RESULT([could not detect memory size, defaulting to 1024 MB])
95 AC_MSG_WARN([This might seriously impact build performance!])
89 fi 96 fi
90 ]) 97 ])
91 98
92 AC_DEFUN_ONCE([BPERF_SETUP_BUILD_CORES], 99 AC_DEFUN_ONCE([BPERF_SETUP_BUILD_CORES],
93 [ 100 [
121 128
122 AC_DEFUN([BPERF_SETUP_CCACHE], 129 AC_DEFUN([BPERF_SETUP_CCACHE],
123 [ 130 [
124 AC_ARG_ENABLE([ccache], 131 AC_ARG_ENABLE([ccache],
125 [AS_HELP_STRING([--disable-ccache], 132 [AS_HELP_STRING([--disable-ccache],
126 [use ccache to speed up recompilations @<:@enabled@:>@])], 133 [disable using ccache to speed up recompilations @<:@enabled@:>@])],
127 [ENABLE_CCACHE=${enable_ccache}], [ENABLE_CCACHE=yes]) 134 [ENABLE_CCACHE=${enable_ccache}], [ENABLE_CCACHE=yes])
128 if test "x$ENABLE_CCACHE" = xyes; then 135 if test "x$ENABLE_CCACHE" = xyes; then
129 AC_PATH_PROG(CCACHE, ccache) 136 AC_PATH_PROG(CCACHE, ccache)
130 else 137 else
131 AC_MSG_CHECKING([for ccache]) 138 AC_MSG_CHECKING([for ccache])
194 ############################################################################### 201 ###############################################################################
195 # 202 #
196 # Can the C/C++ compiler use precompiled headers? 203 # Can the C/C++ compiler use precompiled headers?
197 # 204 #
198 AC_ARG_ENABLE([precompiled-headers], [AS_HELP_STRING([--disable-precompiled-headers], 205 AC_ARG_ENABLE([precompiled-headers], [AS_HELP_STRING([--disable-precompiled-headers],
199 [use precompiled headers when compiling C++ @<:@enabled@:>@])], 206 [disable using precompiled headers when compiling C++ @<:@enabled@:>@])],
200 [ENABLE_PRECOMPH=${enable_precompiled-headers}], [ENABLE_PRECOMPH=yes]) 207 [ENABLE_PRECOMPH=${enable_precompiled-headers}], [ENABLE_PRECOMPH=yes])
201 208
202 USE_PRECOMPILED_HEADER=1 209 USE_PRECOMPILED_HEADER=1
203 if test "x$ENABLE_PRECOMPH" = xno; then 210 if test "x$ENABLE_PRECOMPH" = xno; then
204 USE_PRECOMPILED_HEADER=0 211 USE_PRECOMPILED_HEADER=0
226 233
227 234
228 AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC], 235 AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
229 [ 236 [
230 AC_ARG_WITH(sjavac-server-java, [AS_HELP_STRING([--with-sjavac-server-java], 237 AC_ARG_WITH(sjavac-server-java, [AS_HELP_STRING([--with-sjavac-server-java],
231 [use this java binary for running the sjavac background server and other long running java tasks in the build process, 238 [use this java binary for running the sjavac background server @<:@Boot JDK java@:>@])])
232 e.g. ---with-sjavac-server-java="/opt/jrockit/bin/java -server"])])
233 239
234 if test "x$with_sjavac_server_java" != x; then 240 if test "x$with_sjavac_server_java" != x; then
235 SJAVAC_SERVER_JAVA="$with_sjavac_server_java" 241 SJAVAC_SERVER_JAVA="$with_sjavac_server_java"
236 FOUND_VERSION=`$SJAVAC_SERVER_JAVA -version 2>&1 | grep " version \""` 242 FOUND_VERSION=`$SJAVAC_SERVER_JAVA -version 2>&1 | grep " version \""`
237 if test "x$FOUND_VERSION" = x; then 243 if test "x$FOUND_VERSION" = x; then

mercurial