doc: update build docs

This commit is contained in:
Sebastian Ullrich 2019-11-29 11:23:42 +01:00
parent 27aa0938c8
commit 21ac37378e

View file

@ -18,10 +18,10 @@ Platform-Specific Setup
Generic Build Instructions
--------------------------
Setting up a basic release build using `make`:
Setting up a basic release build:
```bash
git clone https://github.com/leanprover/lean
git clone https://github.com/leanprover/lean4
cd lean
mkdir -p build/release
cd build/release
@ -29,10 +29,10 @@ cmake ../../src
make
```
Setting up a basic debug build using `make`:
Setting up a basic debug build:
```bash
git clone https://github.com/leanprover/lean
git clone https://github.com/leanprover/lean4
cd lean
mkdir -p build/debug
cd build/debug
@ -45,14 +45,6 @@ Useful CMake Configuration Settings
Pass these along with the `cmake ../../src` command.
* `-G Ninja`\
CMake 2.8.11 supports the [Ninja](https://ninja-build.org/) build system.
[Some people report][ninja_work] that using
Ninja can reduce the build time, esp when a build is
incremental. Call `ninja` instead of `make` to build the project.
[ninja_work]: https://plus.google.com/108996039294665965197/posts/SfhrFAhRyyd
* `-D CMAKE_BUILD_TYPE=`\
Select the build type. Valid values are `RELEASE` (default), `DEBUG`,
`RELWITHDEBINFO`, and `MINSIZEREL`.
@ -82,7 +74,7 @@ building Lean itself - which is needed to again build those parts. Building the
code versioned in `stage0/` (via a CMake `ExternProject`). The C++ code is a
previous version of the code in `src/`, while the C code was extracted from
the Lean stdlib of the same commit.
* Using this executable, the stdlib contained in `library/` is compiled to
* Using this executable, the stdlib contained in `src/Init/` is compiled to
`.olean` object files as well as extracted to C in `src/stage1` by the target
`make_stdlib`.
* The static libraries `leanstdlib` and `leanstatic` are built from the extracted
@ -100,7 +92,7 @@ Development Workflows
C++ change. The `lean` target can be used to build the same binary without copying
it to `bin/`, which can be useful for quickly building a debug version without
changing the binary used by the editor. The `LEAN_PATH` variable may need to be set
to the location of `library/` manually in this case.
to the location of `src/Init` manually in this case.
* Changes in the frontend or compiler do not immediately affect the stdlib because of
the staged build until stage0 is updated by making the `update-stage0` target, after
which the stdlib can be updated appropriately if necessary.
@ -108,18 +100,7 @@ Development Workflows
Troubleshooting
---------------
* The `Makefile` at `library/` does not need to be invoked directly. However,
we may want to do it while investigating problems, e.g., Lean is looping while
compiling a file. To manually invoke this `Makefile`, we should use:
```bash
cd library/
STAGE1_OUT=<build_dir_path>/stage1 make <build_dir_path>/stage1/libleanstdlib.a
```
For example, if our build directory is located at `build/release/`, the command above should be
```bash
cd library/
STAGE1_OUT=../build/release/stage1 make ../build/release/stage1/libleanstdlib.a
```
* Call `make` with an additional `VERBOSE=1` argument to print executed commands.
Further Information
-------------------