Personal tools
You are here: Home / cm / Wiki / cm build speed enhancements through use of local hard drive
Navigation
Log in


Forgot your password?
 

cm build speed enhancements through use of local hard drive

Its a good idea to keep your source tree on the server (currently /usr/people/username) to keep it all safely backed-up. The default method of building all versions of cm is to create directories under the directory containing the makefile to store all the compiled objects and linked executables.

If you're storing this generated files on the server, not only are you using precious space on esu1 but its really slow to compile and link cm. A way to get around this slowness is to store just your source on the server and then keep the generated files on your machine's local hard drive. The following procedure describes how to do this.

NOTE: If you use this method you might have trouble when go to a different machine from the one you set it up on. If you build static executables you can copy these to other similar machines and use them.

If you're starting with a fresh cm tree, you can do this:

cvs checkout cm/Makefile
cd cm
mkdir -p /var/tmp/username/mycmiss/cm/generated
mkdir -p /var/tmp/username/mycmiss/cm/dso
mkdir -p /var/tmp/username/mycmiss/cm/bin
ln -s /var/tmp/username/mycmiss/cm/generated .
ln -s /var/tmp/username/mycmiss/cm/dso .
ln -s /var/tmp/username/mycmiss/cm/bin .

and then you can do your usual 'make' command or checkout some source. If you have already built your version of cmiss before, then there is just a slightly different procedure so you don't lose the objects you have already built:

cd your/cm/directory
mkdir -p /var/tmp/username/mycmiss/cm
mv generated /var/tmp/username/mycmiss/cm
mv dso /var/tmp/username/mycmiss/cm
mv bin /var/tmp/username/mycmiss/cm
ln -s /var/tmp/username/mycmiss/cm/generated .
ln -s /var/tmp/username/mycmiss/cm/dso .
ln -s /var/tmp/username/mycmiss/cm/bin .

The 'dso' directory is only useful if you're building a non-static shared object version of cm, currently not supported by default under Linux machines. I use the '/var/tmp/username/...' directory so that if you start using a new machine you just need to make the directories in '/var/tmp/username/mycmiss/cm/' and all the symbolic links continue to work.

The above will speed up compilation of the cm objects, the linking a static executable will still take a long time as all the static archives are pulled off the server from the various sources in '/product/cmiss'. To dramiatically improve link time you need to move all the archives to your local diak and use them from there. Luckily the cm makefile checks a local lib directory first before going to the server sources so its pretty easy to set this up. The following assumes you're on a normal 'i686-linux' machine, but you can easily change this for other machine types:

cd your/cm/directory
mkdir -p /var/tmp/username/cmiss_root/lib/i686-linux
ln -s /var/tmp/username/cmiss_root/lib .
cd lib/i686-linux
cp /product/cmiss/linear_solvers/lib/i686-linux/*.a .
cp /product/cmiss/cellml/lib/i686-linux/*.a .
cp /product/cmiss/gx/lib/i686-linux/*.a .
cp /product/cmiss/lsoda/lib/i686-linux/*.a .
cp /product/cmiss/perl_interpreter/lib/i686-linux/*.a .
cp /product/cmiss/sqp/lib/i686-linux/*.a .
cp /product/cmiss/wormhole/lib/i686-linux/*.a .
cp /product/cmiss/cm/lib/i686-linux/libunemap.a .

Here I use a different top level directory on the local disk since these libraries are most likely going to be the same for all the different cm source trees you might have.

Similar cross-linking can be done for most things you build where you want to keep the source on the server but don't want all the generated files backed-up (LaTeX, the cm libraries, cmgui, etc.).