|
| 1 | +<!---{ |
| 2 | +"title": "Building quick-lint-js on Linux from source", |
| 3 | +"navTitle": "Linux build" |
| 4 | +}---> |
| 5 | + |
| 6 | +<!DOCTYPE html> |
| 7 | +<!-- Copyright (C) 2020 Matthew "strager" Glazar --> |
| 8 | +<!-- See end of file for extended copyright information. --> |
| 9 | +<html> |
| 10 | + <head> |
| 11 | + <%- await include("../../../common-head.ejs.html") %> |
| 12 | + <link href="../../../main.css" rel="stylesheet" /> |
| 13 | + </head> |
| 14 | + <body class="side-bar-nav"> |
| 15 | + <header><%- await include("../../../common-nav.ejs.html") %></header> |
| 16 | + |
| 17 | + <main> |
| 18 | + <h2><%= meta.title %></h2> |
| 19 | + |
| 20 | + <p> |
| 21 | + On Linux, you can build quick-lint-js using one of the following build |
| 22 | + systems: |
| 23 | + </p> |
| 24 | + <ul> |
| 25 | + <li><a href="#ninja">CMake & Ninja</a> (recommended)</li> |
| 26 | + <li><a href="../nix/">Nix</a> (Nix users only)</li> |
| 27 | + <li> |
| 28 | + <a href="../#single-command-build">Single-command build</a> (not |
| 29 | + recommended) |
| 30 | + </li> |
| 31 | + </ul> |
| 32 | + |
| 33 | + <section id="ninja"> |
| 34 | + <h3>Build with CMake & Ninja</h3> |
| 35 | + |
| 36 | + <h4>0. Install build dependencies</h4> |
| 37 | + |
| 38 | + <p> |
| 39 | + Before building quick-lint-js, install the following third-party |
| 40 | + dependencies: |
| 41 | + </p> |
| 42 | + |
| 43 | + <ul> |
| 44 | + <li><a href="https://gcc.gnu.org/">GCC</a> version 8.3 or newer</li> |
| 45 | + <li><a href="https://cmake.org/">CMake</a> version 3.10 or newer</li> |
| 46 | + <li><a href="https://ninja-build.org/">Ninja</a></li> |
| 47 | + </ul> |
| 48 | + |
| 49 | + <p> |
| 50 | + For <strong>Debian</strong>, <strong>Ubuntu</strong>, and |
| 51 | + <strong>Linux Mint</strong>, run the following command to install all |
| 52 | + necessary dependencies: |
| 53 | + </p> |
| 54 | + <blockquote> |
| 55 | + <pre><code class="shell-session"><kbd>sudo apt-get update && sudo apt-get install cmake g++ ninja-build</kbd></code></pre> |
| 56 | + </blockquote> |
| 57 | + |
| 58 | + <p> |
| 59 | + For <strong>Ubuntu 18.04 Bionic</strong>, run the following command to |
| 60 | + install all necessary dependencies: |
| 61 | + </p> |
| 62 | + <blockquote> |
| 63 | + <pre><code class="shell-session"><kbd>sudo apt-get update && sudo apt-get install cmake g++-8 ninja-build</kbd></code></pre> |
| 64 | + </blockquote> |
| 65 | + |
| 66 | + <p> |
| 67 | + For <strong>CentOS</strong>, run the following command to install all |
| 68 | + necessary dependencies: |
| 69 | + </p> |
| 70 | + <blockquote> |
| 71 | + <pre><code class="shell-session"><kbd>sudo dnf --enablerepo=powertools install cmake gcc-c++ ninja-build</kbd></code></pre> |
| 72 | + </blockquote> |
| 73 | + |
| 74 | + <p> |
| 75 | + For <strong>Fedora</strong>, run the following command to install all |
| 76 | + necessary dependencies: |
| 77 | + </p> |
| 78 | + <blockquote> |
| 79 | + <pre><code class="shell-session"><kbd>sudo dnf install cmake gcc-c++ ninja-build</kbd></code></pre> |
| 80 | + </blockquote> |
| 81 | + |
| 82 | + <p> |
| 83 | + For <strong>Arch Linux</strong>, run the following command to install |
| 84 | + all necessary dependencies: |
| 85 | + </p> |
| 86 | + <blockquote> |
| 87 | + <pre><code class="shell-session"><kbd>sudo pacman -Syy cmake gcc ninja</kbd></code></pre> |
| 88 | + </blockquote> |
| 89 | + |
| 90 | + <h4>1. Configure with CMake</h4> |
| 91 | + |
| 92 | + <p> |
| 93 | + Run the following command to create a directory called |
| 94 | + <code>build</code>: |
| 95 | + </p> |
| 96 | + <blockquote> |
| 97 | + <pre><code class="shell-session"><span class="long-shell-command-line"><kbd>mkdir build ; cd build ; cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Debug .. ; cd "$OLDPWD"</kbd></span></code></pre> |
| 98 | + </blockquote> |
| 99 | + |
| 100 | + <p>For Ubuntu 18.04 Bionic, instead run the following command:</p> |
| 101 | + <blockquote> |
| 102 | + <pre><code class="shell-session"><span class="long-shell-command-line"><kbd>mkdir build ; cd build ; CC=gcc-8 CXX=g++-8 cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Debug .. ; cd "$OLDPWD"</kbd></span></code></pre> |
| 103 | + </blockquote> |
| 104 | + |
| 105 | + <h4>2. Build</h4> |
| 106 | + |
| 107 | + <p> |
| 108 | + Run the following command to build the quick-lint-js executable, |
| 109 | + quick-lint-js’ tests, and quick-lint-js’ benchmarks: |
| 110 | + </p> |
| 111 | + <blockquote> |
| 112 | + <pre><code class="shell-session"><kbd>ninja -C build</kbd></code></pre> |
| 113 | + </blockquote> |
| 114 | + |
| 115 | + <p>If you only want to build the quick-lint-js executable:</p> |
| 116 | + <blockquote> |
| 117 | + <pre><code class="shell-session"><kbd>ninja -C build quick-lint-js</kbd></code></pre> |
| 118 | + </blockquote> |
| 119 | + |
| 120 | + <p>If you only want to build quick-lint-js’ tests:</p> |
| 121 | + <blockquote> |
| 122 | + <pre><code class="shell-session"><kbd>ninja -C build quick-lint-js-test</kbd></code></pre> |
| 123 | + </blockquote> |
| 124 | + |
| 125 | + <h4>3. Run</h4> |
| 126 | + <p>Run the following command to run quick-lint-js’ test suite:</p> |
| 127 | + <blockquote> |
| 128 | + <pre><code class="shell-session"><kbd>./build/test/quick-lint-js-test</kbd></code></pre> |
| 129 | + </blockquote> |
| 130 | + |
| 131 | + <p>If you want to run the quick-lint-js program:</p> |
| 132 | + <blockquote> |
| 133 | + <pre><code class="shell-session"><kbd>./build/quick-lint-js --help</kbd></code></pre> |
| 134 | + </blockquote> |
| 135 | + </section> |
| 136 | + </main> |
| 137 | + |
| 138 | + <footer><%- await include("../../../common-footer-nav.ejs.html") %></footer> |
| 139 | + </body> |
| 140 | +</html> |
| 141 | + |
| 142 | +<!-- |
| 143 | +quick-lint-js finds bugs in JavaScript programs. |
| 144 | +Copyright (C) 2020 Matthew "strager" Glazar |
| 145 | +
|
| 146 | +This file is part of quick-lint-js. |
| 147 | +
|
| 148 | +quick-lint-js is free software: you can redistribute it and/or modify |
| 149 | +it under the terms of the GNU General Public License as published by |
| 150 | +the Free Software Foundation, either version 3 of the License, or |
| 151 | +(at your option) any later version. |
| 152 | +
|
| 153 | +quick-lint-js is distributed in the hope that it will be useful, |
| 154 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 155 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 156 | +GNU General Public License for more details. |
| 157 | +
|
| 158 | +You should have received a copy of the GNU General Public License |
| 159 | +along with quick-lint-js. If not, see <https://www.gnu.org/licenses/>. |
| 160 | +--> |
0 commit comments