• Home
  • Raw
  • Download

Lines Matching +full:cmake +full:- +full:3

11 `CMake <http://www.cmake.org/>`_ is a cross-platform build-generator tool. CMake
16 :doc:`CMake` pages. This page is intended for users doing more complex builds.
18 Many of the examples below are written assuming specific CMake Generators.
19 Unless otherwise explicitly called out these commands should work with any CMake
25 The Clang CMake build system supports bootstrap (aka multi-stage) builds. At a
26 high level a multi-stage build is a chain of builds that pass data from one
30 In a simple two-stage bootstrap build, we build clang using the system compiler,
31 then use that just-built clang to build clang again. In CMake this simplest form
35 .. code-block:: console
37 $ cmake -G Ninja -DCLANG_ENABLE_BOOTSTRAP=On <path to source>
41 configurations for each stage. The next series of examples utilize CMake cache
47 general a stage*n* build is built using the output from stage*n-1*.
53 bootstrapping scenario. Apple Clang is built using a 2-stage build.
55 The stage1 compiler is a host-only compiler with some options set. The stage1
60 configuration the Apple Clang build settings are contained in CMake Cache files.
63 .. code-block:: console
65 $ cmake -G Ninja -C <path to clang>/cmake/caches/Apple-stage1.cmake <path to source>
66 $ ninja stage2-distribution
68 This CMake invocation configures the stage1 host compiler, and sets
69 CLANG_BOOTSTRAP_CMAKE_ARGS to pass the Apple-stage2.cmake cache script to the
72 When you build the stage2-distribution target it builds the minimal stage1
74 based on the settings in Apple-stage2.cmake.
80 Multi-stage PGO
83 Profile-Guided Optimizations (PGO) is a really great way to optimize the code
84 clang generates. Our multi-stage PGO builds are a workflow for generating PGO
91 you use llvm-profdata to merge the files into a single profdata file that you
94 Our PGO.cmake cache script automates that whole process. You can use it by
97 .. code-block:: console
99 $ cmake -G Ninja -C <path_to_clang>/cmake/caches/PGO.cmake <source dir>
100 $ ninja stage2-instrumented-generate-profdata
104 and you *must* have compiler-rt in your build tree.
106 This process uses any source files under the perf-training directory as training
107 data as long as the source files are marked up with LIT-style RUN lines.
109 After it finishes you can use “find . -name clang.profdata” to find it, but it
112 .. code-block:: console
114 <build dir>/tools/clang/stage2-instrumented-bins/utils/perf-training/clang.profdata
120 multi-stage builds. It generates three stages; stage1, stage2-instrumented, and
125 **stage2-instrumented**
126 Builds a stage1 x86 compiler, runtime, and required tools (llvm-config,
127 llvm-profdata) then uses that compiler to build an instrumented stage2 compiler.
129 **stage2-instrumented-generate-profdata**
130 Depends on "stage2-instrumented" and will use the instrumented compiler to
131 generate profdata based on the training files in <clang>/utils/perf-training
134 Depends of "stage2-instrumented-generate-profdata" and will use the stage1
135 compiler with the stage2 profdata to build a PGO-optimized compiler.
137 **stage2-check-llvm**
138 Depends on stage2 and runs check-llvm using the stage2 compiler.
140 **stage2-check-clang**
141 Depends on stage2 and runs check-clang using the stage2 compiler.
143 **stage2-check-all**
144 Depends on stage2 and runs check-all using the stage2 compiler.
146 **stage2-test-suite**
147 Depends on stage2 and runs the test-suite using the stage3 compiler (requires
148 in-tree test-suite).
150 3-Stage Non-Determinism
153 In the ancient lore of compilers non-determinism is like the multi-headed hydra.
161 this, you have a stage2 and stage3 compiler that should be bit-for-bit
164 You can perform one of these 3-stage builds with LLVM & clang using the
167 .. code-block:: console
169 $ cmake -G Ninja -C <path_to_clang>/cmake/caches/3-stage.cmake <source dir>
173 setup `here <http://lab.llvm.org:8011/builders/clang-3stage-ubuntu>`_ that runs