blob: 4f97bf2ea3ead6ccf477679c17e7b5cbcef6d9ca [file] [log] [blame] [view]
andybons8c02a1f2015-09-04 17:02:321# Linux-specific build instructions
andybons3322f762015-08-24 21:37:092
brettwc25693b32016-05-26 01:11:523## Common checkout instructions
andybons3322f762015-08-24 21:37:094
brettwc25693b32016-05-26 01:11:525This page covers Linux-specific setup and configuration. The
6[general checkout
7instructions](http://dev.chromium.org/developers/how-tos/get-the-code) cover
8installing depot tools and checking out the code via git.
andybons8c02a1f2015-09-04 17:02:329
andybons3322f762015-08-24 21:37:0910## Overview
andybonsad92aa32015-08-31 02:27:4411
brettwc25693b32016-05-26 01:11:5212Due its complexity, Chromium uses a set of custom tools to check out and build
13rather than configure/make like most projects. You _must_ use gclient and
14ninja, and there is no "install" step provided.
andybonsad92aa32015-08-31 02:27:4415
brettwc25693b32016-05-26 01:11:5216### System requirements
andybons3322f762015-08-24 21:37:0917
brettwc25693b32016-05-26 01:11:5218* **64-bits**: x86 builds are not supported on Linux.
19* **Memory**: >16GB is highly recommended.
20* **Disk space**: Expect a full checkout and build to take nearly 100GB.
21* **Distribution**: You should be able to build Chromium on any reasonably modern Linux
22 distribution, but there are a lot of distributions and we sometimes break
23 things on one or another. Internally, our development platform has been a
24 variant of Ubuntu 14.04 (Trusty Tahr); we expect you will have the most
25 luck on this platform.
andybons3322f762015-08-24 21:37:0926
brettwc25693b32016-05-26 01:11:5227## Software setup
andybonsad92aa32015-08-31 02:27:4428
brettwc25693b32016-05-26 01:11:5229Non-Ubuntu distributions are not officially supported for building and the
30instructions below might be outdated.
andybons3322f762015-08-24 21:37:0931
brettwc25693b32016-05-26 01:11:5232### Ubuntu
andybonsad92aa32015-08-31 02:27:4433
brettwc25693b32016-05-26 01:11:5234Once you have checked out the code, run
35[build/install-build-deps.sh](/build/install-build-deps.sh) The script only
36supports current releases as listed on https://wiki.ubuntu.com/Releases.
37This script is used to set up the canonical builders, and as such is the most
38up to date reference for the required prerequisites.
andybonsad92aa32015-08-31 02:27:4439
brettwc25693b32016-05-26 01:11:5240### Debian
andybons3322f762015-08-24 21:37:0941
brettwc25693b32016-05-26 01:11:5242Follow the Ubuntu instructions above. If you want to install the build-deps
43manually, note that the original packages are for Ubuntu. Here are the Debian
44equivalents:
andybonsad92aa32015-08-31 02:27:4445
brettwc25693b32016-05-26 01:11:5246* libexpat-dev -> libexpat1-dev
47* freetype-dev -> libfreetype6-dev
48* libbzip2-dev -> libbz2-dev
49* libcupsys2-dev -> libcups2-dev
andybons3322f762015-08-24 21:37:0950
brettwc25693b32016-05-26 01:11:5251Additionally, if you're building Chromium components for Android, you'll need to
52install the package: lib32z1
andybonsad92aa32015-08-31 02:27:4453
brettwc25693b32016-05-26 01:11:5254### openSUSE
andybonsad92aa32015-08-31 02:27:4455
brettwc25693b32016-05-26 01:11:5256For openSUSE 11.0 and later, see
57[Linux openSUSE Build Instructions](linux_open_suse_build_instructions.md).
andybons3322f762015-08-24 21:37:0958
brettwc25693b32016-05-26 01:11:5259### Fedora
andybonsad92aa32015-08-31 02:27:4460
brettwc25693b32016-05-26 01:11:5261Recent systems:
andybons3322f762015-08-24 21:37:0962
brettwc25693b32016-05-26 01:11:5263 su -c 'yum install subversion pkgconfig python perl gcc-c++ bison flex \
64 gperf nss-devel nspr-devel gtk2-devel glib2-devel freetype-devel atk-devel \
65 pango-devel cairo-devel fontconfig-devel GConf2-devel dbus-devel \
66 alsa-lib-devel libX11-devel expat-devel bzip2-devel dbus-glib-devel \
67 elfutils-libelf-devel libjpeg-devel mesa-libGLU-devel libXScrnSaver-devel \
68 libgnome-keyring-devel cups-devel libXtst-devel libXt-devel pam-devel httpd \
69 mod_ssl php php-cli wdiff'
andybons3322f762015-08-24 21:37:0970
brettwc25693b32016-05-26 01:11:5271The msttcorefonts packages can be obtained by following the instructions
72present [here](http://www.fedorafaq.org/#installfonts). For the optional
73packages:
andybons3322f762015-08-24 21:37:0974
brettwc25693b32016-05-26 01:11:5275* php-cgi is provided by the php-cli package
76* wdiff doesn't exist in Fedora repositories, a possible alternative would be
77 dwdiff
78* sun-java6-fonts doesn't exist in Fedora repositories, needs investigating
andybons3322f762015-08-24 21:37:0979
brettwc25693b32016-05-26 01:11:5280### Arch Linux
andybons3322f762015-08-24 21:37:0981
brettwc25693b32016-05-26 01:11:5282Most of these packages are probably already installed since they're often used,
83and the parameter --needed ensures that packages up to date are not reinstalled.
andybons3322f762015-08-24 21:37:0984
brettwc25693b32016-05-26 01:11:5285 sudo pacman -S --needed python perl gcc gcc-libs bison flex gperf pkgconfig \
86 nss alsa-lib gconf glib2 gtk2 nspr ttf-ms-fonts freetype2 cairo dbus \
87 libgnome-keyring
andybonsad92aa32015-08-31 02:27:4488
brettwc25693b32016-05-26 01:11:5289For the optional packages on Arch Linux:
andybonsad92aa32015-08-31 02:27:4490
brettwc25693b32016-05-26 01:11:5291* php-cgi is provided with pacman
92* wdiff is not in the main repository but dwdiff is. You can get wdiff in
93 AUR/yaourt
94* sun-java6-fonts do not seem to be in main repository or AUR.
andybons3322f762015-08-24 21:37:0995
brettwc25693b32016-05-26 01:11:5296### Mandriva
andybonsad92aa32015-08-31 02:27:4497
brettwc25693b32016-05-26 01:11:5298 urpmi lib64fontconfig-devel lib64alsa2-devel lib64dbus-1-devel \
99 lib64GConf2-devel lib64freetype6-devel lib64atk1.0-devel lib64gtk+2.0_0-devel \
100 lib64pango1.0-devel lib64cairo-devel lib64nss-devel lib64nspr-devel g++ python \
101 perl bison flex subversion gperf
andybonsad92aa32015-08-31 02:27:44102
brettwc25693b32016-05-26 01:11:52103* msttcorefonts are not available, you will need to build your own (see
104instructions, not hard to do, see
105[mandriva_msttcorefonts.md](mandriva_msttcorefonts.md)) or use drakfont to
106import the fonts from a windows installation
107* These packages are for 64 bit, to download the 32 bit packages,
108substitute lib64 with lib
109* Some of these packages might not be explicitly necessary as they come as
110 dependencies, there is no harm in including them however.
andybons3322f762015-08-24 21:37:09111
brettwc25693b32016-05-26 01:11:52112### Gentoo
andybonsad92aa32015-08-31 02:27:44113
brettwc25693b32016-05-26 01:11:52114 emerge www-client/chromium
andybons8c02a1f2015-09-04 17:02:32115
brettwc25693b32016-05-26 01:11:52116## Troubleshooting
andybons3322f762015-08-24 21:37:09117
118### Linker Crashes
andybonsad92aa32015-08-31 02:27:44119
andybons3322f762015-08-24 21:37:09120If, during the final link stage:
andybonsad92aa32015-08-31 02:27:44121
brettwc25693b32016-05-26 01:11:52122 LINK out/Debug/chrome
andybonsad92aa32015-08-31 02:27:44123
andybons3322f762015-08-24 21:37:09124You get an error like:
andybons3322f762015-08-24 21:37:09125
brettwc25693b32016-05-26 01:11:52126 collect2: ld terminated with signal 6 Aborted terminate called after throwing an
127 instance of 'std::bad_alloc'
andybonsad92aa32015-08-31 02:27:44128
brettwc25693b32016-05-26 01:11:52129 collect2: ld terminated with signal 11 [Segmentation fault], core dumped
andybonsad92aa32015-08-31 02:27:44130
brettwc25693b32016-05-26 01:11:52131you are probably running out of memory when linking. You *must* use a 64-bit
132system to build. Try the following build settings (see [GN build
133configuration](https://www.chromium.org/developers/gn-build-configuration) for
134setting):
andybonsad92aa32015-08-31 02:27:44135
brettwc25693b32016-05-26 01:11:52136* Build in release mode (debugging symbols require more memory).
137 `is_debug = false`
138* Turn off symbols. `symbol_level = 0`
139* Build in component mode (this is for developers only, it will be slower and
140 may have broken functionality). `is_component_build = true`
andybons3322f762015-08-24 21:37:09141
brettwc25693b32016-05-26 01:11:52142## More links
andybons3322f762015-08-24 21:37:09143
brettwc25693b32016-05-26 01:11:52144* [Faster builds on Linux](linux_faster_builds.md)
145* Information about [building with Clang](clang.md).
146* You may want to
147 [use a chroot](using_a_linux_chroot.md) to
148 isolate yourself from versioning or packaging conflicts (or to run the
149 layout tests).
andybonsad92aa32015-08-31 02:27:44150* Cross-compiling for ARM? See [LinuxChromiumArm](linux_chromium_arm.md).
151* Want to use Eclipse as your IDE? See
152 [LinuxEclipseDev](linux_eclipse_dev.md).
153* Built version as Default Browser? See
154 [LinuxDevBuildAsDefaultBrowser](linux_dev_build_as_default_browser.md).
andybons3322f762015-08-24 21:37:09155
156## Next Steps
andybonsad92aa32015-08-31 02:27:44157
158If you want to contribute to the effort toward a Chromium-based browser for
159Linux, please check out the [Linux Development page](linux_development.md) for
160more information.