Skip to content

Commit

Permalink
Add some comments to Make.inc that explicitly define what we mean w…
Browse files Browse the repository at this point in the history
…hen we say "assert build of Julia" (JuliaLang#43732)

* Add some comments to `Make.inc` that explicitly define what we mean when we say "assert build of Julia"
* Add a brief note to the devdocs with instructions on how to build an "assert build" of Julia
* Recommend putting the variables into the `Make.user` file
  • Loading branch information
DilumAluthge authored and LilithHafner committed Feb 22, 2022
1 parent 82dd88b commit df73e8d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
# Set to zero to turn off extra precompile (e.g. for the REPL)
JULIA_PRECOMPILE ?= 1

# Set FORCE_ASSERTIONS to 1 to enable assertions in the C and C++ portions
# of the Julia code base. You may also want to set LLVM_ASSERTIONS to 1,
# which will enable assertions in LLVM.
# An "assert build" of Julia is a build that has both FORCE_ASSERTIONS=1
# and LLVM_ASSERTIONS=1.
FORCE_ASSERTIONS ?= 0

# OPENBLAS build options
Expand Down Expand Up @@ -330,6 +335,7 @@ INSTALL_M := $(JULIAHOME)/contrib/install.sh 755
# LLVM Options
LLVMROOT := $(build_prefix)
# Set LLVM_ASSERTIONS to 1 to enable assertions in LLVM.
LLVM_ASSERTIONS := 0
LLVM_DEBUG := 0
# set to 1 to get clang and compiler-rt
Expand Down
13 changes: 13 additions & 0 deletions doc/src/devdocs/build/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,16 @@ If you need to build Julia from source with a Git checkout of a stdlib, then use
For example, if you need to build Julia from source with a Git checkout of Pkg, then use `make DEPS_GIT=Pkg` when building Julia. The `Pkg` repo is in `stdlib/Pkg`, and created initially with a detached `HEAD`. If you're doing this from a pre-existing Julia repository, you may need to `make clean` beforehand.

If you need to build Julia from source with Git checkouts of more than one stdlib, then `DEPS_GIT` should be a space-separated list of the stdlib names. For example, if you need to build Julia from source with a Git checkout of Pkg, Tar, and Downloads, then use `make DEPS_GIT='Pkg Tar Downloads'` when building Julia.

## Building an "assert build" of Julia

An "assert build" of Julia is a build that was built with both `FORCE_ASSERTIONS=1` and
`LLVM_ASSERTIONS=1`. To build an assert build, define both of the following variables
in your `Make.user` file:

```
FORCE_ASSERTIONS=1
LLVM_ASSERTIONS=1
```

Please note that assert builds of Julia will be slower than regular (non-assert) builds.

0 comments on commit df73e8d

Please sign in to comment.