#!/bin/sh # # Copyright (c) 2005 Daichi GOTO # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF # THE POSSIBILITY OF SUCH DAMAGE. # author: Daichi GOTO (daichi@FreeBSD.org) # first edition: Thu Jan 13 16:40:12 2005 # last modified: Fri Oct 10 10:58:00 2008 # ooo-build-bench.sh # OOo build benchmark script # # usage: # ooo-build-bench.sh # check required command # check the required command installed # usage: # check_required_command command ports_directory # check_required_command ( ) { if ! type "${1}" > /dev/null then echo "error:" >&2 echo " you need ${1}" >&2 echo " install it from ${2}." >&2 exit 1 fi return 0 } check_required_command ccache /usr/ports/devel/ccache/ cat /var/run/dmesg.boot | head -n 16 | tail -n 13 echo export CCACHE_DIR=/work/ccache date=`date "+%Y%m%d-%H%M"` rm -r -f $CCACHE_DIR > /dev/null 2>&1 mkdir -p $CCACHE_DIR > /dev/null 2>&1 make deinstall > /dev/null 2>&1 make clean > /dev/null 2>&1 ccache -C > /dev/null ccache -M 4G > /dev/null echo no cache build echo number of proceses for parallel build: $1 /usr/bin/time -h make NUMOFPROCESSES=$1 MAXPROCESSES=$1 MAXMODULES=$1 -DWITH_CCACHE install package deinstall clean \ > OOo.noccache.$date.log 2>&1 tail -n 1 OOo.noccache.$date.log make deinstall > /dev/null 2>&1 make clean > /dev/null 2>&1 echo full cache build echo number of proceses for parallel build: $1 /usr/bin/time -h make NUMOFPROCESSES=$1 MAXPROCESSES=$1 MAXMODULES=$1 -DWITH_CCACHE install package deinstall clean \ > OOo.ccache.$date.log 2>&1 tail -n 1 OOo.ccache.$date.log echo OOo version make -V RELEASE_NR make -V MILESTONE echo uname uname -a