andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 1 | # Linux Build Instructions — Prerequisites |
| 2 | |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 3 | This page describes system requirements for building Chromium on Linux. |
| 4 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 5 | [TOC] |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 6 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 7 | ## System Requirements |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 8 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 9 | ### Linux distribution |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 10 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 11 | You should be able to build Chromium on any reasonably modern Linux |
| 12 | distribution, but there are a lot of distributions and we sometimes break things |
| 13 | on one or another. Internally, our development platform has been a variant of |
| 14 | Ubuntu 14.04 (Trusty Tahr); we expect you will have the most luck on this |
| 15 | platform, although directions for other popular platforms are included below. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 16 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 17 | ### Disk space |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 18 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 19 | It takes about 10GB or so of disk space to check out and build the source tree. |
| 20 | This number grows over time. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 21 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 22 | ### Memory space |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 23 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 24 | It takes about 8GB of swap file to link chromium and its tests. If you get an |
| 25 | out-of-memory error during the final link, you will need to add swap space with |
| 26 | swapon. It's recommended to have at least 4GB of memory available for building a |
| 27 | statically linked debug build. Dynamic linking and/or building a release build |
| 28 | lowers memory requirements. People with less than 8GB of memory may want to not |
| 29 | build tests since they are quite large. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 30 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 31 | ### 64-bit Systems |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 32 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 33 | Chromium can be compiled as either a 32-bit or 64-bit application. Chromium |
| 34 | requires several system libraries to compile and run. While it is possible to |
| 35 | compile and run a 32-bit Chromium on 64-bit Linux, many distributions are |
| 36 | missing the necessary 32-bit libraries, and will result in build or run-time |
| 37 | errors. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 38 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 39 | ### Depot tools |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 40 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 41 | Before setting up the environment, make sure you install the |
| 42 | [depot tools](http://dev.chromium.org/developers/how-tos/depottools) first. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 43 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 44 | ## Software Requirements |
| 45 | |
| 46 | ### Ubuntu Setup |
| 47 | |
nodir | a6074d4c | 2015-09-01 04:26:45 | [diff] [blame] | 48 | Run [build/install-build-deps.sh](/build/install-build-deps.sh) The script only |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 49 | supports current releases as listed on https://wiki.ubuntu.com/Releases. |
| 50 | |
| 51 | Building on Linux requires software not usually installed with the |
| 52 | distributions. |
| 53 | |
| 54 | The script attempts to automate installing the required software. This script is |
| 55 | used to set up the canonical builders, and as such is the most up to date |
| 56 | reference for the required prerequisites. |
| 57 | |
| 58 | ### Other distributions |
| 59 | |
| 60 | Note: Other distributions are not officially supported for building and the |
| 61 | instructions below might be outdated. |
| 62 | |
| 63 | #### Debian Setup |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 64 | |
| 65 | Follow the Ubuntu instructions above. |
| 66 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 67 | If you want to install the build-deps manually, note that the original packages |
| 68 | are for Ubuntu. Here are the Debian equivalents: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 69 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 70 | * libexpat-dev -> libexpat1-dev |
| 71 | * freetype-dev -> libfreetype6-dev |
| 72 | * libbzip2-dev -> libbz2-dev |
| 73 | * libcupsys2-dev -> libcups2-dev |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 74 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 75 | Additionally, if you're building Chromium components for Android, you'll need to |
| 76 | install the package: lib32z1 |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 77 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 78 | #### openSUSE Setup |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 79 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 80 | For openSUSE 11.0 and later, see |
| 81 | [Linux openSUSE Build Instructions](linux_open_suse_build_instructions.md). |
| 82 | |
| 83 | #### Fedora Setup |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 84 | |
| 85 | Recent systems: |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 86 | |
| 87 | ```shell |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 88 | su -c 'yum install subversion pkgconfig python perl gcc-c++ bison \ |
| 89 | flex gperf nss-devel nspr-devel gtk2-devel glib2-devel freetype-devel \ |
| 90 | atk-devel pango-devel cairo-devel fontconfig-devel GConf2-devel \ |
| 91 | dbus-devel alsa-lib-devel libX11-devel expat-devel bzip2-devel \ |
| 92 | dbus-glib-devel elfutils-libelf-devel libjpeg-devel \ |
| 93 | mesa-libGLU-devel libXScrnSaver-devel \ |
| 94 | libgnome-keyring-devel cups-devel libXtst-devel libXt-devel pam-devel' |
| 95 | ``` |
| 96 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 97 | The msttcorefonts packages can be obtained by following the instructions present |
| 98 | here: http://www.fedorafaq.org/#installfonts |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 99 | |
| 100 | For the optional packages: |
nodir | a6074d4c | 2015-09-01 04:26:45 | [diff] [blame] | 101 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 102 | * php-cgi is provided by the php-cli package |
| 103 | * wdiff doesn't exist in Fedora repositories, a possible alternative would be |
| 104 | dwdiff |
| 105 | * sun-java6-fonts doesn't exist in Fedora repositories, needs investigating |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 106 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 107 | su -c 'yum install httpd mod_ssl php php-cli wdiff' |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 108 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 109 | #### Arch Linux Setup |
| 110 | |
| 111 | Most of these packages are probably already installed since they're often used, |
| 112 | and the parameter --needed ensures that packages up to date are not reinstalled. |
| 113 | |
| 114 | ```shell |
nodir | a6074d4c | 2015-09-01 04:26:45 | [diff] [blame] | 115 | sudo pacman -S --needed python perl gcc gcc-libs bison flex gperf pkgconfig \ |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 116 | nss alsa-lib gconf glib2 gtk2 nspr ttf-ms-fonts freetype2 cairo dbus \ |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 117 | libgnome-keyring |
| 118 | ``` |
| 119 | |
| 120 | For the optional packages on Arch Linux: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 121 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 122 | * php-cgi is provided with pacman |
| 123 | * wdiff is not in the main repository but dwdiff is. You can get wdiff in |
| 124 | AUR/yaourt |
| 125 | * sun-java6-fonts do not seem to be in main repository or AUR. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 126 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 127 | For a successful build, add `'remove_webcore_debug_symbols': 1,` to the |
| 128 | variables-object in include.gypi. Tested on 64-bit Arch Linux. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 129 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 130 | TODO: Figure out how to make it build with the WebCore debug symbols. `make V=1` |
| 131 | can be useful for solving the problem. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 132 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 133 | #### Mandriva setup |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 134 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 135 | ```shell |
| 136 | urpmi lib64fontconfig-devel lib64alsa2-devel lib64dbus-1-devel \ |
| 137 | lib64GConf2-devel lib64freetype6-devel lib64atk1.0-devel lib64gtk+2.0_0-devel \ |
| 138 | lib64pango1.0-devel lib64cairo-devel lib64nss-devel lib64nspr-devel g++ python \ |
| 139 | perl bison flex subversion gperf |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 140 | ``` |
| 141 | |
nodir | a6074d4c | 2015-09-01 04:26:45 | [diff] [blame] | 142 | *** note |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 143 | Note 1: msttcorefonts are not available, you will need to build your own (see |
| 144 | instructions, not hard to do, see |
| 145 | [mandriva_msttcorefonts.md](mandriva_msttcorefonts.md)) or use drakfont to |
| 146 | import the fonts from a windows installation |
nodir | a6074d4c | 2015-09-01 04:26:45 | [diff] [blame] | 147 | *** |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 148 | |
nodir | a6074d4c | 2015-09-01 04:26:45 | [diff] [blame] | 149 | *** note |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 150 | Note 2: these packages are for 64 bit, to download the 32 bit packages, |
| 151 | substitute lib64 with lib |
nodir | a6074d4c | 2015-09-01 04:26:45 | [diff] [blame] | 152 | *** |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 153 | |
nodir | a6074d4c | 2015-09-01 04:26:45 | [diff] [blame] | 154 | *** note |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 155 | Note 3: some of these packages might not be explicitly necessary as they come as |
| 156 | dependencies, there is no harm in including them however. |
nodir | a6074d4c | 2015-09-01 04:26:45 | [diff] [blame] | 157 | *** |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 158 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 159 | #### Gentoo setup |
| 160 | |
| 161 | emerge www-client/chromium |