Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: docs/linux_build_instructions.md

Issue 2544793004: More edits to the linux build instructions. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Checking out and building Chromium on Linux 1 # Checking out and building Chromium on Linux
2 2
3 There are instructions for other platforms linked from the 3 There are instructions for other platforms linked from the
4 [get the code](get_the_code.md) page. 4 [get the code](get_the_code.md) page.
5 5
6 ## Instructions for Google Employees 6 ## Instructions for Google Employees
7 7
8 Are you a Google employee? See 8 Are you a Google employee? See
9 [go/building-chrome](https://goto.google.com/building-chrome) instead. 9 [go/building-chrome](https://goto.google.com/building-chrome) instead.
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 ```shell 70 ```shell
71 $ cd src 71 $ cd src
72 ``` 72 ```
73 73
74 ### Install additional build dependencies 74 ### Install additional build dependencies
75 75
76 Once you have checked out the code, and assuming you're using Ubuntu, run 76 Once you have checked out the code, and assuming you're using Ubuntu, run
77 [build/install-build-deps.sh](/build/install-build-deps.sh) 77 [build/install-build-deps.sh](/build/install-build-deps.sh)
78 78
79 You may need to adjust the build dependencies for other distros. There are
80 some [notes](#notes) at the end of this document, but we make no guarantees
81 for their accuracy.
82
79 Here are some instructions for what to do instead for 83 Here are some instructions for what to do instead for
80 84
81 * [Debian](linux_debian_build_instructions.md) 85 * [Debian](linux_debian_build_instructions.md)
82 * [Fedora](linux_fedora_build_instructions.md) 86 * [Fedora](linux_fedora_build_instructions.md)
83 * [Arch Linux](linux_arch_build_instructions.md) 87 * [Arch Linux](linux_arch_build_instructions.md)
84 * [Open SUSE](linux_open_suse_build_instrctions.md) 88 * [Open SUSE](linux_open_suse_build_instrctions.md)
85 * [Mandriva](linux_mandriva_build_instrctions.md) 89 * [Mandriva](linux_mandriva_build_instrctions.md)
86 90
87 For Gentoo, you can just run `emerge www-client/chromium`. 91 For Gentoo, you can just run `emerge www-client/chromium`.
88 92
(...skipping 29 matching lines...) Expand all
118 it should be a subdirectory of `out`. 122 it should be a subdirectory of `out`.
119 * For other build arguments, including release settings, see [GN build 123 * For other build arguments, including release settings, see [GN build
120 configuration](https://www.chromium.org/developers/gn-build-configuration). 124 configuration](https://www.chromium.org/developers/gn-build-configuration).
121 The default will be a debug component build matching the current host 125 The default will be a debug component build matching the current host
122 operating system and CPU. 126 operating system and CPU.
123 * For more info on GN, run `gn help` on the command line or read the 127 * For more info on GN, run `gn help` on the command line or read the
124 [quick start guide](../tools/gn/docs/quick_start.md). 128 [quick start guide](../tools/gn/docs/quick_start.md).
125 129
126 ### Faster builds 130 ### Faster builds
127 131
132 This section contains some things you can change to speed up your builds,
133 sorted so that the things that make the biggest difference are first.
134
135 #### Disable NaCl
136
137 By default, the build includes support for
138 [Native Client (NaCl)](https://developer.chrome.com/native-client), but
139 most of the time you won't need it. You can set the GN argument
140 `enable_nacl=false` and it won't be built.
141
142 #### Include fewer debug symbols
143
144 By default GN produces a build with all of the debug assertions enabled
145 (`is_debug=true`) and including full debug info (`symbol_level=2`). Setting
146 `symbol_level=1` will produce enough information for stack traces, but not
147 line-by-line debugging. Setting `symbol_level=0` will include no debug
148 symbols at all. Either will speed up the build compared to full symbols.
149
128 See [faster builds on Linux](linux_faster_builds.md) for various tips and 150 See [faster builds on Linux](linux_faster_builds.md) for various tips and
129 settings that may speed up your build. 151 settings that may speed up your build.
130 152
153 #### Disable debug symbols for Blink
154
155 Due to its extensive use of templates, the Blink code produces about half
156 of our debug symbols. If you don't ever need to debug Blink, you can set
157 the GN arg `remove_webcore_debug_symbols=true`.
158
159 #### Use Icecc
160
161 [Icecc](https://github.com/icecc/icecream) is the distributed compiler with a
162 central scheduler to share build load. Currently, many external contributors use
163 it. e.g. Intel, Opera, Samsung (Googlers use an internal system called Goma).
164
165 In order to use `icecc`, set the following GN args:
166
167 ```
168 linux_use_bundled_binutils=false
169 use_debug_fission=false
170 is_clang=false
171 use_sysroot=false
172 ```
173
174 See these links for more on the
175 [bundled_binutils limitation](https://github.com/icecc/icecream/commit/b2ce5b9cc 4bd1900f55c3684214e409fa81e7a92),
176 the [debug fission limitation](http://gcc.gnu.org/wiki/DebugFission).
177
178 Using the system linker may also be necessary when using glibc 2.21 or newer.
179 See [related bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808181).
180
181 #### ccache
182
183 You can use [ccache](https://ccache.samba.org) to speed up local builds (again,
184 this is not useful if you're using a Googler using Goma).
185
186 Increase your ccache hit rate by setting `CCACHE_BASEDIR` to a parent directory
187 that the working directories all have in common (e.g.,
188 `/home/yourusername/development`). Consider using
189 `CCACHE_SLOPPINESS=include_file_mtime` (since if you are using multiple working
190 directories, header times in svn sync'ed portions of your trees will be
191 different - see
192 [the ccache troubleshooting section](http://ccache.samba.org/manual.html#_troubl eshooting)
193 for additional information). If you use symbolic links from your home directory
194 to get to the local physical disk directory where you keep those working
195 development directories, consider putting
196
197 alias cd="cd -P"
198
199 in your `.bashrc` so that `$PWD` or `cwd` always refers to a physical, not
200 logical directory (and make sure `CCACHE_BASEDIR` also refers to a physical
201 parent).
202
203 If you tune ccache correctly, a second working directory that uses a branch
204 tracking trunk and is up to date with trunk and was gclient sync'ed at about the
205 same time should build chrome in about 1/3 the time, and the cache misses as
206 reported by `ccache -s` should barely increase.
207
208 This is especially useful if you use `git-new-workdir` and keep multiple local
209 working directories going at once.
210
211 #### Using tmpfs
212
213 You can use tmpfs for the build output to reduce the amount of disk writes
214 required. I.e. mount tmpfs to the output directory where the build output goes:
215
216 As root:
217
218 mount -t tmpfs -o size=20G,nr_inodes=40k,mode=1777 tmpfs /path/to/out
219
220 *** note
221 **Caveat:** You need to have enough RAM + swap to back the tmpfs. For a full
222 debug build, you will need about 20 GB. Less for just building the chrome target
223 or for a release build.
224 ***
225
226 Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores
227 hyperthreaded, 12 GB RAM)
228
229 * With tmpfs:
230 * 12m:20s
231 * Without tmpfs
232 * 15m:40s
233
131 ## Build Chromium 234 ## Build Chromium
132 235
133 Build Chromium (the "chrome" target) with Ninja using the command: 236 Build Chromium (the "chrome" target) with Ninja using the command:
134 237
135 ```shell 238 ```shell
136 $ ninja -C out/Default chrome 239 $ ninja -C out/Default chrome
137 ``` 240 ```
138 241
139 You can get a list of all of the other build targets from GN by running `gn ls 242 You can get a list of all of the other build targets from GN by running `gn ls
140 out/Default` from the command line. To compile one, pass the GN label to Ninja 243 out/Default` from the command line. To compile one, pass the GN label to Ninja
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 313
211 * Information about [building with Clang](clang.md). 314 * Information about [building with Clang](clang.md).
212 * You may want to [use a chroot](using_a_linux_chroot.md) to 315 * You may want to [use a chroot](using_a_linux_chroot.md) to
213 isolate yourself from versioning or packaging conflicts. 316 isolate yourself from versioning or packaging conflicts.
214 * Cross-compiling for ARM? See [LinuxChromiumArm](linux_chromium_arm.md). 317 * Cross-compiling for ARM? See [LinuxChromiumArm](linux_chromium_arm.md).
215 * Want to use Eclipse as your IDE? See 318 * Want to use Eclipse as your IDE? See
216 [LinuxEclipseDev](linux_eclipse_dev.md). 319 [LinuxEclipseDev](linux_eclipse_dev.md).
217 * Want to use your built version as your default browser? See 320 * Want to use your built version as your default browser? See
218 [LinuxDevBuildAsDefaultBrowser](linux_dev_build_as_default_browser.md). 321 [LinuxDevBuildAsDefaultBrowser](linux_dev_build_as_default_browser.md).
219 322
220 ### Next Steps 323 ## Next Steps
221 324
222 If you want to contribute to the effort toward a Chromium-based browser for 325 If you want to contribute to the effort toward a Chromium-based browser for
223 Linux, please check out the [Linux Development page](linux_development.md) for 326 Linux, please check out the [Linux Development page](linux_development.md) for
224 more information. 327 more information.
328
329 ## Notes for other distros <a name="notes"></a>
330
331 ### Arch Linux
332
333 Instead of running `install-build-deps.sh` to install build dependencies, run:
334
335 ```shell
336 $ sudo pacman -S --needed python perl gcc gcc-libs bison flex gperf pkgconfig \
337 nss alsa-lib gconf glib2 gtk2 nspr ttf-ms-fonts freetype2 cairo dbus \
338 libgnome-keyring
339 ```
340
341 For the optional packages on Arch Linux:
342
343 * `php-cgi` is provided with `pacman`
344 * `wdiff` is not in the main repository but `dwdiff` is. You can get `wdiff`
345 in AUR/`yaourt`
346 * `sun-java6-fonts` do not seem to be in main repository or AUR.
347
348 ### Debian
349
350 You may need to update the package names in `install-build-deps.sh`:
Tom (Use chromium acct) 2016/12/02 01:42:38 You can't run install-build-deps.sh on Debian, it'
Dirk Pranke 2016/12/02 01:56:45 Okay ... how would a user figure out which package
Tom (Use chromium acct) 2016/12/02 02:09:45 Last time I built on Debian, I manually edited the
351
352 * `libexpat-dev` → `libexpat1-dev`
353 * `freetype-dev` → `libfreetype6-dev`
354 * `libbzip2-dev` → `libbz2-dev`
355 * `libcupsys2-dev` → `libcups2-dev`
356
357 ### Fedora
358
359 Instead of running `build/install-build-deps.sh`, run:
360
361 ```shell
362 su -c 'yum install git python bzip2 tar pkgconfig atk-devel alsa-lib-devel \
363 bison binutils brlapi-devel bluez-libs-devel bzip2-devel cairo-devel \
364 cups-devel dbus-devel dbus-glib-devel expat-devel fontconfig-devel \
365 freetype-devel gcc-c++ GConf2-devel glib2-devel glibc.i686 gperf \
366 glib2-devel gtk2-devel gtk3-devel java-1.*.0-openjdk-devel libatomic \
367 libcap-devel libffi-devel libgcc.i686 libgnome-keyring-devel libjpeg-devel \
368 libstdc++.i686 libX11-devel libXScrnSaver-devel libXtst-devel \
369 libxkbcommon-x11-devel ncurses-compat-libs nspr-devel nss-devel pam-devel \
370 pango-devel pciutils-devel pulseaudio-libs-devel zlib.i686 httpd mod_ssl \
371 php php-cli python-psutil wdiff'
372 ```
373
374 The `msttcorefonts` packages can be obtained by following [these
375 instructions](http://www.fedorafaq.org/#installfonts). For the optional
376 packages:
377
378 * `php-cgi` is provided by the `php-cli` package.
379 * `sun-java6-fonts` doesn't exist in Fedora repositories, needs investigating.
380
381 ### Mandriva
382
383 Instead of running `build/install-build-deps.sh`, run:
384
385 ```shell
386 urpmi lib64fontconfig-devel lib64alsa2-devel lib64dbus-1-devel \
387 lib64GConf2-devel lib64freetype6-devel lib64atk1.0-devel lib64gtk+2.0_0-devel \
388 lib64pango1.0-devel lib64cairo-devel lib64nss-devel lib64nspr-devel g++ python \
389 perl bison flex subversion gperf
390 ```
391
392 * `msttcorefonts` are not available, you will need to build your own (see
393 instructions, not hard to do, see
394 [mandriva_msttcorefonts.md](mandriva_msttcorefonts.md)) or use `drakfont` to
395 import the fonts from a Windows installation.
396
397 ### OpenSUSE
398
399 Use `zypper` command to install dependencies:
400
401 (openSUSE 11.1 and higher)
402
403 ```shell
404 sudo zypper in subversion pkg-config python perl \
405 bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \
406 wdiff lighttpd gcc gcc-c++ gconf2-devel mozilla-nspr \
407 mozilla-nspr-devel php5-fastcgi alsa-devel libexpat-devel \
408 libjpeg-devel libbz2-devel
409 ```
410
411 For 11.0, use `libnspr4-0d` and `libnspr4-dev` instead of `mozilla-nspr` and
412 `mozilla-nspr-devel`, and use `php5-cgi` instead of `php5-fastcgi`. And need
413 `gtk2-devel`.
414
415 (openSUSE 11.0)
416
417 ```shell
418 sudo zypper in subversion pkg-config python perl \
419 bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \
420 libnspr4-0d libnspr4-dev wdiff lighttpd gcc gcc-c++ libexpat-devel \
421 php5-cgi gconf2-devel alsa-devel gtk2-devel jpeg-devel
422 ```
423
424 The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used .
425 Since this package requires Java as a prerequisite anyway, we can do the same
426 thing by just installing the equivalent openSUSE Sun Java package:
427
428 ```shell
429 sudo zypper in java-1_6_0-sun
430 ```
431
432 WebKit is currently hard-linked to the Microsoft fonts. To install these using ` zypper`
433
434 ```shell
435 sudo zypper in fetchmsttfonts pullin-msttf-fonts
436 ```
437
438 To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
439 create symlinks to the appropriate locations:
440
441 ```shell
442 sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts
443 sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcor efonts/Arial.ttf
444 sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttc orefonts/Arial_Bold.ttf
445 sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttc orefonts/Arial_Bold_Italic.ttf
446 sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttco refonts/Arial_Italic.ttf
447 sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcor efonts/Comic_Sans_MS.ttf
448 sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttc orefonts/Comic_Sans_MS_Bold.ttf
449 sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcore fonts/Courier_New.ttf
450 sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttco refonts/Courier_New_Bold.ttf
451 sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttco refonts/Courier_New_Bold_Italic.ttf
452 sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcor efonts/Courier_New_Italic.ttf
453 sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttco refonts/Impact.ttf
454 sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcor efonts/Times_New_Roman.ttf
455 sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttc orefonts/Times_New_Roman_Bold.ttf
456 sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttc orefonts/Times_New_Roman_Bold_Italic.ttf
457 sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttco refonts/Times_New_Roman_Italic.ttf
458 sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttc orefonts/Verdana.ttf
459 sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/mstt corefonts/Verdana_Bold.ttf
460 sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/mstt corefonts/Verdana_Italic.ttf
461 sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/mstt corefonts/Verdana_Bold_Italic.ttf
462 ```
463
464 The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used .
465 Since this package requires Java as a prerequisite anyway, we can do the same
466 thing by just installing the equivalent openSUSE Sun Java package:
467
468 ```shell
469 sudo zypper in java-1_6_0-sun
470 ```
471
472 WebKit is currently hard-linked to the Microsoft fonts. To install these using ` zypper`
473
474 ```shell
475 sudo zypper in fetchmsttfonts pullin-msttf-fonts
476 ```
477
478 To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
479 create symlinks to the appropriate locations:
480
481 ```shell
482 sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts
483 sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcor efonts/Arial.ttf
484 sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttc orefonts/Arial_Bold.ttf
485 sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttc orefonts/Arial_Bold_Italic.ttf
486 sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttco refonts/Arial_Italic.ttf
487 sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcor efonts/Comic_Sans_MS.ttf
488 sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttc orefonts/Comic_Sans_MS_Bold.ttf
489 sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcore fonts/Courier_New.ttf
490 sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttco refonts/Courier_New_Bold.ttf
491 sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttco refonts/Courier_New_Bold_Italic.ttf
492 sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcor efonts/Courier_New_Italic.ttf
493 sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttco refonts/Impact.ttf
494 sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcor efonts/Times_New_Roman.ttf
495 sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttc orefonts/Times_New_Roman_Bold.ttf
496 sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttc orefonts/Times_New_Roman_Bold_Italic.ttf
497 sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttco refonts/Times_New_Roman_Italic.ttf
498 sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttc orefonts/Verdana.ttf
499 sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/mstt corefonts/Verdana_Bold.ttf
500 sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/mstt corefonts/Verdana_Italic.ttf
501 sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/mstt corefonts/Verdana_Bold_Italic.ttf
502 ```
503
504 And then for the Java fonts:
505
506 ```shell
507 sudo mkdir -p /usr/share/fonts/truetype/ttf-lucida
508 sudo find /usr/lib*/jvm/java-1.6.*-sun-*/jre/lib -iname '*.ttf' -print \
509 -exec ln -s {} /usr/share/fonts/truetype/ttf-lucida \;
510 ```
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698