BuildingMozCellML

This is a description Andre built up while setting up to build mozCellML from the CVS repository. It does, at some stage, need to be updated for mozCellML-0.2(at which point you need to build a number of other dependencies for the cmgui based graph drawing).

Get the source

  1. Download Mozilla 1.7.3 source tarball from "mozilla.org":http://www.mozilla.org/download-mozilla.html and extracted source archive into 'SOURCE_ROOT', or,

2. Checkout the current mozCellML source code from sorceforge with:

cvs -d :ext:username@cellml:/cvsroot/cellml co mozCellML

Alternatively, get a source tarball for a released version.

(The cellml host is just a ssh thing I have for accessing the sourceforge CVS repositories from behind the university firewall, check "ssh tunnels":/cms/CMISSFolder/Ssh for help).

Build Mozilla

Not sure yet whether mozilla needs to be built or not, but mozCellML uses 'pkg-config' to pick up the mozilla location for building against, so building it is one way to set this stuff up. Another option would be to edit the mozCellML makefile and set the required locations manually.

Using the online build configurator for mozilla, I use this as my $HOME/.mozconfig

#
# See http://www.mozilla.org/build/ for build instructions.
#

# Options for client.mk.
mk_add_options MOZ_CO_PROJECT=suite
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@

# Options for 'configure' (same as command-line options).
ac_add_options --prefix=MOZ_INSTALL_DIR
ac_add_options --enable-default-toolkit=gtk2
ac_add_options --enable-optimize
ac_add_options --enable-xft
ac_add_options --enable-application=suite
ac_add_options --disable-mailnews
ac_add_options --disable-calendar
ac_add_options --disable-composer
ac_add_options --enable-xpctools
ac_add_options --disable-tests
ac_add_options --disable-debug

And simply go 'cd SOURCE_ROOT/mozilla' followed by 'gmake -f client.mk build'. Seems the mozconfig options are only picked up if you leave the source in a directory called mozilla at the top level. I had to add the '--prefix' option as I don't have root access to the default '/usr/local' install location.

Following a successful make, do 'gmake -f client.mk install' to install the built mozilla into the 'MOZ_INSTALL_DIR'

Build mozCellML

  1. With the checked out source, you first need to run 'aclocal', which works with version 1.4 found at '/usr/bin/aclocal-1.4' on a Mandrake 10.0 Linux machine. Other versions of aclocal may also work.
  2. Then 'automake' needs to be run, and again version 1.4 is the one I use ('/usr/bin/automake-1.4').
  3. Followed by 'autoconf', version 2.13 ('/usr/bin/autoconf-2.13').
  4. Finally, we can run 'configure'. For 'pkg-config' to correctly pick up my Mozilla build from a non-standard location I first add the install directory to the 'PKG_CONFIG_PATH' environment variable.
  5. Once the preliminaries are done, we can build a mozCellML package suitable for installing into the mozilla we just built.

This is all summarised as:

cvs -d :ext:username@cellml:/cvsroot/cellml co mozCellML
cd mozCellML
/usr/bin/aclocal-1.4
/usr/bin/automake-1.4
/usr/bin/autoconf-2.13
setenv PKG_CONFIG_PATH MOZ_INSTALL_DIR/lib/pkgconfig
./configure
make packages

Which results in a package ('mozCellML/install/mozCellML.xpi') which can be installed into the browser by opening this file in mozilla.

Editing 'mozCellML/content/mozCellML/aboutMozCellML.html' let me add a comment to show that I succeeded in getting my version installed into the version of mozilla that I built.

You also need to check the compiler path in the mozCellML preferences to ensure that it is using the files installed into the correct version of mozilla. i.e. if you had installed mozCellML previously into one version of mozilla and now you want to use the one you just built, the compiler might still be pointing at the old install - simply delete the compiler path and the correct new one will be generated.