Building OpenOffice.org

From Apache OpenOffice Wiki
Revision as of 10:29, 19 July 2009 by B michaelsen (Talk | contribs)

Jump to: navigation, search
Documentation caution.png This page is moved into the Building Guide please make sure to add new information there and make this page a redirect if it only contains duplicate information.

Compiling OpenOffice.org : the practice

Prerequisites And Dependencies

see Building Guide

Different Platforms

Some information for specific platforms is provided at tools.

Also for Mac OS X see AquaBuild ( Aqua version of OpenOffice.org) or MacOSXBuildInstructions ( deprecated X11 version ), for GNU/Linux Sparc see GNULinuxSparcPorting and for Windows see Windows.

Building a Milestone

see Building Guide

Hints

dmake first checks for depencies of the modules. If you have a fresh checkout you could get some errors:

Fetching dependencies for module swext from solver... failed...
Fetching from CVS...  failed

 WARNING! Project(s):
 swext
 
 not found and couldn't be built. Dependencies on that module(s)
 ignored. Maybe you should correct build 
 dmake:  Error code 1, while making 'check_modules'

You have to checkout the module swext by i.e.:
cvs co -r DEV300_m2 swext
(for DEV300_m22)
There are also failing depencies for modules apache-commons and tomcat. Check them out in the same way as swext above.
If you get the following error or something similar:

ERROR: /usr/lib/libcairo.so.2: undefined symbol: FT_Library_SetLcdFilter<br />
dmake:  Error code 1, while making '../unxlngi6.pro/lib/libeggtrayli.so'

your version of libcairo is too old. To solve this error install a newer version (i.e. libcairo.so.2.11.7). When building with cairo, you almost certainly need to specify --with-sytem-freetype, since the one that is in OOo's sources just is too old.
Actually, there is an error about ant, if you build swext/mediawiki:

BUILD FAILED
swext/mediawiki/build.xml:126: No supported regular expression matcher found: java.lang.ClassNotFoundException: org.apache.tools.ant.util.regexp.Jdk14RegexpMatcher

This error could be solved on Linux by installing a package called ant-optional or similar. There are some additional files for ant missing.

If you got an error like this

ERROR: Error 65280 occurred while making /work/ooovanillabuild/ucb/source/ucp/gvfs

look inside the output in your shell if there are something wrong with your glib-devel version. If you see inside the messages in the shell something like this:


/usr/include/glib-1.2/glib.h:2725:1: warning: this is the location of the previous definition
(...)
/usr/include/glib-2.0/glib/gthread.h:352:1: warning: "G_LOCK_NAME" redefined

you have to unistall one of the glib-devel version; mostly glib-devel version 1.

Tips and Tricks

Here are some tips that make your life easier or can accelerate the build

ccache

If possible, it is strongly recommended to install (and configure) ccache - this will greatly reduce build time on subsequent builds. Allow for a big cache and lots of files for the entire OOo build tree. If you're working on several CWSs simultaneously it pays to have separate caches, and also separate caches for non-/product builds within one CWS, e.g. after having sourced the environment execute the commands

export CCACHE_DIR="${YOUR_SOURCES}/$CWS_WORK_STAMP/.ccache_$INPATH"
ccache -M 2G -F 100000
export CC="ccache gcc"
export CXX="ccache g++"

in bash, respectively in tcsh

setenv CCACHE_DIR "${YOUR_SOURCES}/$CWS_WORK_STAMP/.ccache_$INPATH"
ccache -M 2G -F 100000
setenv CC "ccache gcc"
setenv CXX "ccache g++"

For Windows: download from here, do the following:

export CCACHE_DIR="some/place/with/space"
ccache -M 2G -F 10000
export CCACHE_CPP2=TRUE
export CXX="guw.pl ccache cl"
# export USE_PCH=  if you experience trouble with precompiled headers

in bash, respectively in 4NT:

set CCACHE_DIR="some/place/with/space"
ccache -M 2G -F 10000
set CXX=ccache cl
unset USE_PCH
# if you want to experient with precompiled headers (not recommended):
set CCACHE_CPP2=TRUE and keep USE_PCH=TRUE

See also this thread for background info on Windows ccache specifics.

set nodep=TRUE

If you set the environment variable nodep to TRUE, then dependendy information files are not created - the build finishes faster.

But only enable that on a clean build. Once you have built OOo and then made modifications, unset the variable again to be on the safe side.

set NO_HIDS=TRUE

Similar to the nodep variable, this one prevents the generation of HIDs (Help IDs) that are mainly used for automated testing - if you only want to build OOo, you don't need those.

use parallel builds

If you have a multiprocessor machine or similar, you can run a parallel build. There are two levels of parallelism - one operating on makefile level, the other one on module level

set MAXPROCESS=<numer or processes>

This is the makefile-parallelism. This tells dmake how many targets it is allowed to build in parallel

running parallel build.pl

For parallelism on the module level, you have to run build from <SRC_ROOT>/instsetoo_native with the -P<number> switch, for example:

build -P2

create prebuilt mozilla and use that instead of recompiling everytime

For the mozilla-components you have the choice to either build from mozilla sources, to use precompiled packages (the "official" ones can be obtained from tools.openoffice.org) or to use system-mozilla (the one installed on your buildsystem, not everything might work, depending on the version you got installed) You can easily create your own version of the prepacked binaries if you wish to do so (either because you cannot use the official ones because of mismatch of compiler version used to build them/other technical reasons or because you want to use stuff you didn't build yourself). To do so:

  • build the moz module from the mozilla sources
    (use --enable-build-mozilla when running configure and put the mozilla-source tarball to moz/download)
  • in moz run dmake zip to create the zip files
  • you'll find the zips in {unxlngi#,wntmsci#}.pro/zipped

Copy them to a location of your liking. Now instead of using --enable-build-mozilla, use --disable-build-mozilla and copy the zips you created or downloaded to moz/zipped and these will be used when compiling. This will greatly reduce build-time (you save the time that would otherwise be spent on compiling mozilla)

saving disk space by linking to the solver only

Use "--dlv_switch -link" when running build to tell deliver to only link the files instead of copying them:

build --dlv_switch -link

fixing epm 4 product name error

If you get "epm: Product names can only contain letters and numbers!" error, you must patch epm and comment out name check:

 /*
  * for (i = 0; prodname[i]; i ++)
  *   if (!isalnum(prodname[i] & 255))
  *   {
  *     puts("epm: Product names can only contain letters and numbers!");
  *     usage();
  *   }
 */

See also

Getting the source

Personal tools