This page is intended as a collection of simple step-by-step recipes to build Apache OpenOffice from source code. A more thorough explanation of what the individual steps do and why they are necessary can be found in the building guide.

Ubuntu 14.04

The basic building steps under Ubuntu 12.04 (see below) are to be followed in Ubuntu 14.04 as well; however, there are some minor build issues that any developer, using this OS, needs to be aware of, if he gets stuck while building. The following is the list of issues, with their fixes, that a developer may face with:

As the BZ says, it is because of buggy toolchain g++4.9. So for now in Ubuntu Linux 14.04, build the source using g++4.8.2, gcc4.8.2; these are the default compilers in Ubuntu Linux 14.04 anyway; please check it using the following commands:

CentOS 5 for AOO 4.1.x

CentOS 5 is our reference environment for build through the 4.1.x series. As it is a very old environment, it is not recommended to use it for your first build. But is important to document how to build on CentOS 5 since this is where the release through 4.1.x are built.

Configure

CentOS 6 for AOO 4.2.x and later

Although CentOS 5 is our reference environment for build through the 4.1.x series, as it is a very old environment, it is not a viable system to use for building AOO 4.2.x and later. Not to say that you can't do so, but we have switched to CentOS 6 for our reference build. Other than that, the actual setups and builds for both OSs are strikingly similar.

Setup a VM

We have had good results installing CentOS 6 under both VirtualBox and VMware. Our community builds are actually done on a VMware Fusion VM. Build times are mostly sensitive to the number of CPUs and allocated RAM; our setup is a 6 core VM with 16GB of memory. We recommend CentOS 6.9

Source the environment

You need to setup environment variableas and other things in the terminal window where the build should run.

$ source LinuxX86-64Env.Set.sh

Important
It depends on the respective terminal window/tab. The build will not or unpredictable run in a different one.

Start building

Work directory
/share/linux2/aoo/trunk/main/instsetoo_native

The following command will use all available CPU cores to build most as possible in parallel:

$ build --all -P8 -- -P8

The following command build and redirect all output to stdout and stderr into a single log file. Perfect for forwarding to someone else in case of build problems:

$ build <options> > build_error_log_yyyy.mm.dd_hh.mm.txt 2>&1

The following can be used when you want to know how many hours the build took to complete:

$ time build <options>

The following is to clear things up when a project didn't build successfully before starting again:

$ build --prepare --from <prj_name>

When the same error occurs exactly again, then maybe the "--prepare" option doesn't work for projects that were changed to gbuild. Then the respective solver directory needs to be deleted manually. Either from the following directory or in another sub-dir. Example:

$ rm -rf main/solver/420/*.pro/workdir/CxxObject/<prj_name>

Cleanup the build tree

Work directory
/share/linux2/aoo/trunk/main/

The following command needs to be executed to cleanup all build artefacts to be able to start again a clean build:

$ dmake clean

Important
This will delete the "dmake" command itself. Therefore it's needed to run configure, bootstrap and source again (see above).

If you will use git, you need in addition from the Devel category the packages:

git, git-svn

(If you prefer to install packages with a Linux kind of touch, you can skip selecting the packages and instead select just the package lynx (enter lynx in the Search box and select the lynx entry in the Web/Default section). You would then install the other packages from the cygwin command line using lynx as explained ahead. However, selecting the packages from the Cygwin interface is recommended.)

Click Next to finish package selection.

Click Next to resolve dependencies.

After installation is finished click the Finish button to close the dialog.

Start Cygwin bash in a terminal

In Windows 7 and later you can just type "cygwin" into the Start Menu search bar and then click on the Cygwin App. Or you can:

(If you haven't installed the necessary packages from the Cygwin interface yet because you would prefer to install them using lynx from the Cygwin command line, then you should do so now. First install apt-cyg from the Github repository:)

(You must also provide to install the missing perl packages, for example with "cpan -i Archive::Zip LWP::UserAgent LWP::Protocol XML::Parser" etc. however there can be some dependency conflicts, the recommended method is installing the packages from the cygwin interface)

Replace symlinked awk with copy of gawk.exe:

rm /usr/bin/awk
mv /usr/bin/gawk.exe /usr/bin/awk.exe

Note that if the rm command fails then the mv is not necessary.

Install Java, 32-bit version

Choose between JDK or OpenJDK. Versions 1.7 and 1.8 are known to work.

(We need the 32-bit version because JNI requires the JVM's bitness to match the C/C++ bitness).

Download the zip archive (currently that is apache-ant-1.9.12-bin.zip or apache-ant-1.10.4-bin.zip). Note that Apache Ant 1.10.x will only work with Java 8.

Open downloaded archive in file explorer and unzip it to a location of your choice, eg c:\. Note that C:\Program Files (x86) will not work due to problems of quoting the spaces and parentheses.

Install Microsoft Windows SDK for Windows 7 and .NET Framework 3.5. SP1 (recommended by Microsoft. Note: later versions of the Windows SDK will not work. AOO can not be built with MSVC 2010 or 2012 - MSVC 2008 is needed and is found in the Windows 7 SDK)

Download winsdk_web.exe and run the web installer. You can use the default values in the installation dialog, except when prompted with the installation path use a path that has no spaces or parentheses (e.g. "C:\Microsoft_SDKs\Windows\v7.0"), because otherwise the build process will choke on those spaces or parentheses.

Download files vcredist_x86.exe and vcredist_x64.exe We need both 32 and 64-bit versions because we build 64-bit shell extensions. If you download the most recent version of Apache OpenOffice and unpack it, you will find the files vcredist_x86.exe and vcredist_x64.exe in folder redist. You can use them as well.

Download and run DXSDK_Jun10.exe. Choose to install to a custom path, and use a path that has neither spaces nor parentheses (e.g. C:\Microsoft_DirectX_SDK_June_2010), because otherwise the build will not be able to parse the path and will choke on the spaces or parentheses. (If you receive an S1023 error towards the end of the installation, the fix is simple. The issue occurs because a newer version of the Visual C++ 2010 Redistributable is present on the computer. The June 2010 DirectX SDK installs version 10.0.30319 of the Visual C++ Redistributable. To resolve this issue, you must uninstall all versions of the Visual C++ 2010 Redistributable before installing the June 2010 DirectX SDK. You may have one or more of the following products installed: Visual C++ 2010 Redistributable x86, Visual C++ 2010 Redistributable x64. You can use Add or Remove Programs in Control Panel to uninstall the products. Or, you can run the following commands from an administrator command prompt:

Download WDK 7.1.0 (is an ISO image). Cannot use later versions of Windows Driver Kit because they do not have ATL which is needed to build AOO with ActiveX. (I recommend to download using Internet Explorer, otherwise the install may fail a Windows Authenticity test, whereas this does not happen using Internet Explorer to download the ISO image.)

Download and run the installer (note that versions of NSIS >= 3.* are only compatible with branch 4.1.3 or later! otherwise you will have to install at most NSIS 2.51). Recommended to install to custom location, choose a path without any spaces (e.g. "C:\NSIS").

For Asian languages (ja, ko, zh-CN, zh-TW) the language files have to be edited, otherwise the graphics in the first installer windows don't fit. In "{NSISDIR}\Contrib\Language files\Japanese.nlf" (Korean.nlf, TradChinese.nlf, SimpChinese.nlf accordingly) change:

Font and size - dash (-) means default
{font-name}
{font-size}

to:

Font and size - dash (-) means default
-
-

Optional: Install the MozillaBuild tools. These are needed to build the NSS ("Network Security Services") module. Download from here. Install to a custom path without any spaces, such as C:\mozilla-build. MozillaBuild tools version 3.0 or newer require a 64-bit Windows. When building on 32-bit Windows it is recommended to use version 2.2.0 or older.

Get AOO source code. You can use the source release or check out from SVN. Build from source release if you want to build OpenOffice once but don't want to contribute patches. If you will contribute patches, you need to generate them against an actual version of trunk. In this case check out from SVN to be able to rebase before generating patches. You can work with subversion or with git-svn. Do not use a tool that changes line endings, such as the default configuration of TortoiseSVN. NOTE: Do not place the source directory under the Cygwin file system. This means that placing it, for example, at '/home/aoo/source' is not recommended.

For those paths that do have spaces, use the cygpath tool to get a shortened version without any spaces, which you can then use in the configuration directives without any trouble (adapt paths as necessary):

If you have installed the optional DirectX SDK then you can add the switch:

--with-directx-home="C:/Microsoft_DirectX_SDK_June_2010"

If you have installed Windows Driver Kit 7.1.0 and would like to build with ATL and ActiveX functionality then remove the --disable-activex and the --disable-atl directives, and add the atl home directives: