Development/GenericBuildingHints

Partition limitations
It's known that building on FAT(32)-formatted partitions don't work (the error is "Permission denied").

First Build
The first time make is invoked, it will download the other git repositories needed (if any) and other external packages to be downloaded.

Building the product can take  hours on a reasonably recent processor, and much more on Windows.

Although this will do, you might want to do a little more typing with This command is to save all the output of the make into a file (build.log), so that you can go back to it later to investigate if needed. Also with a fresh git clone, downloading and corresponding make might take some time. To avoid accidental killing of the process, one can use  make as follows:   which might nag. Then you can check progress with.

If your build fails, check that you have satisfied the dependencies mentioned at the top of this page.

Re-build
If you modify the sources, or pulled your git repositories with the lastest update, you can rebuild by simply running :

Sometimes, often because some header file got removed or renamed, it is necessary to do a full-blown rebuild.

Note that during the build process, absolute softlinks (with resolved links in the cwd) are formed inside the build tree. So if you want to duplicate compiled code, choose to preserve links or you will triplicate it instead (breaking the stuff). This, however, makes the copy attack the source when the copy is used/cleaned, so use a script that bends the links after such a copy.

Partial build
Of course, due to the time it takes, a full rebuild is not the first recourse. When something goes wrong in a specific module, you can also rebuild just that module.

Modules are normally named after their directory. To get a list of all modules run:

Single unit test run
If you need to run only a single test from a unit test module (including multiple tests), use this syntax:

Faster single unit test module runs
Running a global make just to run a single unit test can take time. Normally a unit test name contains the module it belongs to. You can speed up the lookup by explicitly stating its directory:

This will produce a more verbose output, but the result is the same.

Building without tests
does not perform any tests by default. Plain make should definitely not be used when building for the first time, because otherwise you may miss a problem with your setup that will give you a build with strange behavior that nobody else sees.

In the case when OpenCL tests (CppunitTest_sc_opencl_test) fail (e.g., due to faulty drivers on the development box), they may be disabled by setting the environment variable.

Verbose build
If you want to get verbose output during build:

Getting debug output
If you want to get the output of OSL_TRACE calls and other debug messages:

Getting debug symbols
If you want to enable symbols for profiling, debugging with gdb etc, but don't want to turn on debug outputs or change compiler optimization settings, run:

Partial debug build
Should you need to do a debug build of a module, to see more of the debugging messages during the LibreOffice run, you can add  as a build's parameter, like:

When you want to build the debug version for a fix set of modules you can use: For details see the description of  in the output of.

Improving subsequent build performance
For details on, see the OS-specific build instructions.

Fewer icon sets
Icon sets are recreated during each build (on Windows even before compiling the changed code(!)), thus disabling most of them saves time if there are only small code changes to compile otherwise.

Pick eg. the default theme on your system (like  or  ), and add the following parameter to your , then re-run  :

A partial build, eg. completely avoids rebuilding icon sets.

autogen help
To configure your build run:

There you can review a list of the build options. You can create a file called  to store these options permanently.

In the autogen.input file, give one option per line. You can temporarily comment out lines by adding # characters in front of them.

While some options in the autogen help are shown as taking values in quotes, the quotes are not used in autogen.input. So to provide a list of UI languages to build with in autogen.input, use

A typical autogen.input file intended for LibreOffice development work might look like this:

make help
To see other available options during partial module build, run:

Note that this is different from running make -h, which lists commands for the GNU make itself.

make fetch
For your first build, a lot of external tarballs get downloaded before the real build starts. If you want to build offline, you can do: before doing the build itself. This will download the other git repos and needed tar.gz packages. Note that make will do this step anyways if you don't do it manually, but doing a make fetch the first time allow you to monitor the download activity.

make distclean
To remove the files that `configure' created (so you can compile the package for a different distro or computer), type This can also be helpful if build starts failing after a major system upgrade.

Build system internals

 * See: Development/Build System