Step by step building guides for different platforms - HISTORICAL

From Apache OpenOffice Wiki
Jump to: navigation, search


This page is intended as a collection of simple historical step-by-step recipes to build Apache OpenOffice from source code.

Ubuntu 14.04

Ubuntu 14.04 is our secondary build platform for our complimentary community Linux 32 and 64 bit platforms, CentOS7 being our primary. 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:

 g++ -v
 gcc -v

if not, you've to download them.

 sudo apt-get install g++-4.8
 cd /usr/bin
 rm gcc
 rm g++
 ln -s gcc-4.8 gcc
 ln -s g++-4.8 g++
  • Updated Install requirements. In addition to those listed for Ubuntu 12.04:
 sudo apt-get install openjdk-7-jdk fakeroot
  • Failed to find ./solver/420/unxlngx6.pro/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 error.
 cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 ./solver/420/unxlngx6.pro/lib/
 rm ./solver/420/unxlngx6.pro/lib/libstdc++.so.6
 ln -s ./solver/420/unxlngx6.pro/lib/libstdc++.so.6.0.20 ./solver/420/unxlngx6.pro/lib/libstdc++.so.6
  • No such file or directory - connectivity/virtualdbtools.hxx while building svx.

if you get an error like this, then that means connectivity is not built properly. Build connectivity using build --all:connectivity and this error will go away.

Build and Packaging tools

Download, configure, build and install dmake and epm

$ wget https://github.com/jimjag/dmake/archive/dmake-4.12.3.tar.gz
$ tar -xzf dmake-4.12.3.tar.gz
$ cd dmake-dmake-4.12.3
$ ./configure --prefix=/usr/local
$ sudo make install


$ wget https://github.com/jimjag/epm/archive/v5.0.0/epm-5.0.0.tar.gz
$ tar -xzf epm-5.0.0.tar.gz
$ cd epm-5.0.0
$ ./configure --prefix=/usr/local
$ sudo make install

Ubuntu 12.04

  • Setup VirtualBox with Ubuntu 12.04 64 bit on Windows7 64bit host. A native installation is of course fine, too.
  • Let updater update ca. 380 packages. Restart.
  • Get the source. You can start with the source release or by checking out from SVN:
Source release SVN
Build from source release if you want to build OpenOffice once but don't want to do any development. Build from SVN if you want to development work with OpenOffice.
  • Download AOO 4.1.3 source tarball from

https://www.apache.org/dyn/closer.lua/openoffice/4.1.3/source/apache-openoffice-4.1.3-r1761381-src.tar.bz2

  • Optional: Download signature from

https://archive.apache.org/dist/openoffice/4.1.3/source/apache-openoffice-4.1.3-r1761381-src.tar.bz2.asc

and verify the source tarball with

gpg --verify apache-openoffice-4.1.3-r1761381-src.tar.bz2.asc \
             apache-openoffice-4.1.3-r1761381-src.tar.bz2

Note that you have to have the keys already imported to your key chain. The keys can be found on the download page:

https://www.apache.org/dist/openoffice/KEYS

  • Unpack source:
 cd /tmp
 tar -xjf ~/Downloads/apache-openoffice-4.1.3-r1761381-src.tar.bz2
 cd aoo-4.1.3/main
  • Start with creating a parent directory for the source code. Don't use /tmp because that is deleted on every boot:
 sudo mkdir /source
 sudo chown <your-user-name> /source
 cd /source
  • Install subversion and checkout the source:
 sudo apt-get install subversion
 svn co https://svn.apache.org/repos/asf/openoffice/trunk aoo-trunk
 cd aoo-trunk/main
  • Install git and checkout the source (since 2019-08-03:
 sudo apt install git
 git clone https://gitbox.apache.org/repos/asf/openoffice.git aoo
 cd aoo/main
  • Install requirements (this will also install packages that are not listed):
 sudo apt-get install g++ gcc bison flex libarchive-zip-perl libcups2-dev \
      libpam0g-dev gperf libfreetype6-dev libxaw7-dev libfontconfig1-dev \
      libxrandr-dev patch libgconf2-dev libgnomevfs2-dev ant libgtk2.0-dev \
      junit junit4 libidl-dev liborbit2-dev openjdk-6-jdk libwww-perl \
      libxml-parser-perl autoconf libssl-dev libpam-dev libgstreamer\*


  • Run autoconf to generate configure script:
 autoconf
  • Configure (see the building guide section on configuration for further options):
 ./configure \
     --with-dmake-url=https://sourceforge.net/projects/oooextras.mirror/files/dmake-4.12.tar.bz2 \
     --with-epm-url=https://sourceforge.net/projects/oooextras.mirror/files/epm-3.7.tar.gz \
     --disable-odk \
     --disable-binfilter
  • Finish configuration and download missing tarballs and extensions:
 ./bootstrap
  • Include the configured environment:
 source LinuxX86-64Env.Set.sh
  • Build:
 cd instsetoo_native/
 build --all

This may take a while to complete. Several hours are not uncommon. To speed things up you may want to run 'build' like this

 build --all -P<n> -- -P<n>

to start a parallel build. Replace <n> with the number of CPU cores.

  • Install:
 sudo dpkg -i unxlngx6.pro/Apache_OpenOffice/deb/install/en-US/DEBS/*.deb
 sudo dpkg -i unxlngx6.pro/Apache_OpenOffice/deb/install/en-US/DEBS/desktop-integration/openoffice4.2-debian-menus_4.2-9800_all.deb
  • Start Apache OpenOffice:
 /opt/openoffice4/program/soffice

Fedora 21

Autoconf

Work directory

/share/linux2/aoo/trunk/main/

You need to create the "configure" command in order to start:

$ autoconf

Configure the build options

You need to configure the build options to tell the build command what to use or to ignore:

$ ./configure \
--with-dmake-url=https://sourceforge.net/projects/oooextras.mirror/files/dmake-4.12.tar.bz2 \
--with-epm-url=https://sourceforge.net/projects/oooextras.mirror/files/epm-3.7.tar.gz \
--disable-odk \
--disable-gconf \
--disable-gnome-vfs \
--with-package-format="installed"

Bootstrap the build

You need to prepare the build environment. This will download missing source code tar balls of external libraries, download missing external dictionary extensions and pre-build needed tools:

$ ./bootstrap

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).

Build breaker

1. Module "svx"
2. Module "dbaccess"

The file main/svx/source/fmcomp/fmgridif.cxx and main/dbaccess/source/ui/uno/ColumnControl.cxx should be compiled with enabled compiler optimization. However, this doesn't work on the Intel x86-64 platform due to this GCC 4.9.3 bug (should be fixed with 5.0): https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58678 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65009

The workaround is to disable the optimization for both files in the respective makefiles main/svx/Library_svxcore.mk and main/dbaccess/source/ui/uno/makefile.mk. The following short patch should work:

1. Makefile "main/svx/Library_svxcore.mk"

<patch start>

--- Library_svxcore.mk.orig 2016-09-04 15:32:07.305410023 +0200
+++ Library_svxcore.mk.new 2016-09-05 20:16:33.411649496 +0200
@@ -121,7 +121,6 @@
svx/source/engine3d/viewpt3d2 \
svx/source/fmcomp/dbaexchange \
svx/source/fmcomp/fmgridcl \
- svx/source/fmcomp/fmgridif \
svx/source/fmcomp/gridcell \
svx/source/fmcomp/gridcols \
svx/source/fmcomp/gridctrl \
@@ -452,6 +451,23 @@
))
endif

+# the following source file can't be compiled with "-Os" by gcc 4.9 as it
+# because of a bug in devirtualization optimization (#i125475#):
+# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58678>
+# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65009>
+# Compiling with "-O2" or
+# "-Os -fno-devirtualize -fno-devirtualize-speculatively" is sufficient to fix.
+ifeq ($(COM),GCC)
+$(eval $(call gb_Library_add_cxxobjects,svxcore,\
+ svx/source/fmcomp/fmgridif \
+ , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
+))
+else
+$(eval $(call gb_Library_add_exception_objects,svxcore,\
+ svx/source/fmcomp/fmgridif \
+))
+endif
+
$(eval $(call gb_SdiTarget_SdiTarget,svx/sdi/svxslots,svx/sdi/svx))

$(eval $(call gb_SdiTarget_set_include,svx/sdi/svxslots,\

</patch end>

2. Makefile "main/dbaccess/Library_dbui.mk"


<patch start>

--- Library_dbui.mk.orig 2016-09-04 15:28:55.200594932 +0200
+++ Library_dbui.mk.new 2016-09-06 00:34:05.241638508 +0200
@@ -260,7 +260,6 @@
dbaccess/source/ui/tabledesign/TableRowExchange \
dbaccess/source/ui/tabledesign/TableUndo \
dbaccess/source/ui/uno/AdvancedSettingsDlg \
- dbaccess/source/ui/uno/ColumnControl \
dbaccess/source/ui/uno/ColumnModel \
dbaccess/source/ui/uno/ColumnPeer \
dbaccess/source/ui/uno/DBTypeWizDlg \
@@ -313,4 +312,21 @@
))
endif

+# the following source file can't be compiled with "-Os" by gcc 4.9 as it
+# because of a bug in devirtualization optimization (#i125475#):
+# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58678>
+# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65009>
+# Compiling with "-O2" or
+# "-Os -fno-devirtualize -fno-devirtualize-speculatively" is sufficient to fix.
+ifeq ($(COM),GCC)
+$(eval $(call gb_Library_add_cxxobjects,dbui,\
+ dbaccess/source/ui/uno/ColumnControl \
+ , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
+))
+else
+$(eval $(call gb_Library_add_exception_objects,dbui,\
+ dbaccess/source/ui/uno/ColumnControl \
+))
+endif
+
# vim: set noet sw=4 ts=4:

</patch end>

Needed packages

The following packages (incl. their dependencies) that need to be available or installed additionally:

  • ant
  • autoconf
  • bison
  • cups-devel
  • flex
  • gcc
  • gcc++
  • gperf
  • gtk2
  • gtk2-devel
  • hamcreast
  • java-1.8.0-openjdk
  • java-1.8.0-openjdk-devel
  • junit
  • libtiff
  • libXt-devel
  • make
  • ORBit
  • pam-devel
  • patch
  • perl-CPAN
  • perl-Env
  • rpm
  • rpm-build

Important
Java 1.8 JDK has to be installed due to dependencies for ant, hamcreast and junit.

Building a release version

Additional things that need to done when building a release version out of a SVN branch (e.g., AOO 4.1.3 from "AOO413").

Packages

The following packages (incl. their dependencies) that need to be available or installed additionally:

  • dpkg
  • dbus-glib-devel
  • GConf2-devel
  • gnome-vfs2
  • gnome-vfs2-devel
  • gstreamer-devel
  • gstreamer-plugins-base-devel
  • mesa-libGLU-devel
  • ORBit2
  • ORBit2-devel
  • perl-Archive-Zip
  • perl-Crypt-SSLeay
  • perl-Digest-MD5
  • perl-Digest-SHA
  • perl-libwww-perl
  • perl-LWP-Protocol-https
  • perl-XML-Parser

Configure

The configure options for a release build can be found here:

http://svn.apache.org/viewvc/openoffice/devtools/build-scripts/4.1.3/unxlngix6/build_aoo64bit_on_centos5.sh

Performance results

  • Intel Core i7-4710HQ 2.5 GHz (8 cores)
  • 16 GB RAM, 256 GB SSD
  • Fedora 21 x86-64 (Kernel 4.1.13-100.fc21.x86_64, glibc 2.20-8)

Trunk

  • Build command:
 $ build --all -P8 -- -P8
  • Time for a full build: 01h 05m 41s (as of 2016-10-09

AOO413 branch

  • Build command (with P8 and only "de en-US fr ja pt" as languages):
 $ build_aoo64bit_on_centos5.sh
  • Time for a full build: 00h 50m 32s (as of 2016-10-09)

Fedora 19 and 20

Build Instructions

The build procedure is the same as for other Linux systems.

Required packages:

$ yum install tcsh perl-Archive-Zip gcc gcc-c++ cups-devel \
              pam-devel java-1.7.0-openjdk-devel gperf freetype-devel \
              gtk2-devel libIDL-devel libXaw-devel bison patch GConf2-devel \
              gnome-vfs2-devel ant make tar rpm-build flex junit4 \
              perl-LWP-UserAgent-Determined perl-XML-Parser \
              perl-Digest-SHA ORBit2-devel perl-LWP-Protocol-https

Build notes:

  • The perl-Digest-SHA dependency is not caught until bootstrap
  • The ORBit2-devel dependency is not caught until building the "shell" module
  • Build breaks in "hsqldb": to build with Java7, you need to apply the patch at https://issues.apache.org/ooo/attachment.cgi?id=80961&action=diff
  • Build breaks in "moz": configure with --disable-mozilla to work around it.

Fedora 10 and 14

Build Instructions

The build procedure is the same as for other Linux systems.

Required packages:

$ yum install tcsh perl-Archive-Zip gcc gcc-c++ cups-devel \
              pam-devel java-1.6.0-openjdk-devel gperf freetype-devel \
              gtk2-devel libIDL-devel libXaw-devel bison patch GConf2-devel \
              gnome-vfs2-devel ant make

Quick start guide

Still valid?

$ yum -y install mono-devel perl-Archive-Zip ant bison \

        flex pam-devel cups-devel gperf libxslt-devel openldap-devel \
        firefox-devel xorg-x11-devel gstreamer-devel \
        gstreamer-plugins-base-devel db4-devel unixODBC-devel \
        xml-commons-jaxp-1.3-apis xalan-j2 boost-devel \
        unixODBC-devel qt-devel subversion autoconf automake \
        gtk2-devel gcc-c++  gnome-vfs2-devel rpm-build \
        expat-devel python-devel curl-devel

$ ./autogen.sh -with-distro=SUSE \

        --with-jdk-home=/usr/lib/jvm/java-1.5.0-gcj \
        --with-ant-home=/usr/share/ant \
        --with-system-mozilla=firefox \
        --disable-Xaw \
        --disable-kde \
        --disable-mono \
        --enable-opengl --enable-ogltrans \
        --disable-neon \
        --enable-debug

Another list:

Blog about building ooo-build on Fedora 7:

Fedora packaging

Fedora 14

The Fedora 14 spec file can be found at http://koji.fedoraproject.org/koji/buildinfo?buildID=276232 (download the srpm, and uncompress it (rpm2cpio <file> | cpio -idv) ); you'll see the single spec file openoffice.org.spec ; note that it doesn't build cleanly, you need to apply the patch from https://issues.apache.org/ooo/show_bug.cgi?id=114999

Fedora 19

Personal tools