trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: September 2010

ccache

From: Darrell Anderson <humanreadable@...>
Date: Thu, 23 Sep 2010 06:57:31 -0700 (PDT)
I'm wrapping my head around something new.

In the past I have been copying the svn package contents to tmpfs and working there with my compiles. That habit came from being accustomed to building packages from a source tarball. The source tarball is unpacked to a temporary working area and then compiled. With svn, something to which I am new, I maintained that habit by copying the package contents.

Trinity is huge and compiling the entire core package suite requires 6 hours even on a dual core system. I could live with that if I knew the packages always compiled 100% of the time. That is a normal expectation with tarballs, but is not the case in a dynamic svn environment. There always is some degree of breakage. Hence a previous suggestion to use ccache.

I have compiled kernels for many years. Being new to svn I did not understand that, much like the kernel, I don't have to image package sources from the svn tree but can work directly in that directory. Like the kernel I need only use 'make clean' to restore the svn tree. I then can use ccache to create compiling caches, which should dramatically reduce compile times.

If I understand correctly, then in my build scripts I need to do the following:

================================
WAS:

(snippet from arts package build script)

echo "Copying $PRGNAM source files to $TMP..."
cp -a $SVN_SOURCES/dependencies/$PRGNAM $TMP/ || exit 1
cd $PRGNAM || exit 1
echo
echo "Building make and config files..."
echo
echo "Package will be stored at $OUTPUT."
echo
cp -p "$LIBTOOLM4" admin/libtool.m4.in
cp -p "$LTMAINSH" admin/ltmain.sh
make -f admin/Makefile.common
echo
echo "Finished building make and config files."
echo
chown -R root:root .
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
./configure \
  --prefix=${PREFIX} \
  --sysconfdir=${SYSCONFDIR} \
  --libdir=${LIBDIR} \
  --disable-debug \
  --program-prefix="" \
  --program-suffix="" \
  --build=$ARCH-slackware-linux

make $NUMJOBS || exit 1
make install DESTDIR=$PKG

================================
CHANGE TO:

echo "Changing to $PRGNAM source files in SVN..."
cd $SVN_SOURCES/dependencies/$PRGNAM || exit 1
echo
echo "Building make and config files..."
echo
echo "Package will be stored at $OUTPUT."
echo
cp -p "$LIBTOOLM4" ./admin/libtool.m4.in
cp -p "$LTMAINSH" ./admin/ltmain.sh
make -f ./admin/Makefile.common
echo
echo "Finished building make and config files."
echo
chown -R root:root .
make clean
if [ -x /usr/bin/ccache ]; then
  CC="ccache gcc"
  echo "Using ccache. Unless configured otherwise, the cache is stored in $HOME/.ccache."
  echo
else
  CC="gcc"
fi
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
$CC ./configure \
  --prefix=${PREFIX} \
  --sysconfdir=${SYSCONFDIR} \
  --libdir=${LIBDIR} \
  --disable-debug \
  --program-prefix="" \
  --program-suffix="" \
  --build=$ARCH-slackware-linux

make $NUMJOBS || exit 1
make install DESTDIR=$PKG

================================

Do I have the correct idea?

Thanks much!

Darrell