Skip to content

Commit

Permalink
[devdocs] Improve documentation about building external forks of LLVM
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano committed Jun 18, 2023
1 parent 9501540 commit ac04e2b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ USE_MLIR := 0
# Options to use RegionVectorizer
USE_RV := 0

# Use `ccache` for speeding up recompilation of the C/C++ part of Julia.
# Requires the `ccache` executable to be in the `PATH` environment variable.
USECCACHE := 0

# Cross-compile
#XC_HOST := i686-w64-mingw32
#XC_HOST := x86_64-w64-mingw32
Expand Down
28 changes: 26 additions & 2 deletions doc/src/devdocs/build/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ To run julia from anywhere you can:

- write `prefix=/path/to/install/folder` into `Make.user` and then run `make install`. If there is a version of Julia already installed in this folder, you should delete it before running `make install`.

Some of the options you can set to control the build of Julia are listed and documented at the beginning of the file `Make.inc`, but you should never edit it for this purpose, use `Make.user` instead.

Now you should be able to run Julia like this:

julia
Expand Down Expand Up @@ -239,10 +241,32 @@ For packaging Julia with LLVM, we recommend either:
- bundling a Julia-only LLVM library inside the Julia package, or
- adding the patches to the LLVM package of the distribution.
* A complete list of patches is available in on [Github](https://github.com/JuliaLang/llvm-project) see the `julia-release/15.x` branch.
* The only Julia-specific patch is the lib renaming (`llvm-symver-jlprefix.patch`), which should _not_ be applied to a system LLVM.
* The only Julia-specific patch is the lib renaming (`llvm7-symver-jlprefix.patch`), which should _not_ be applied to a system LLVM.
* The remaining patches are all upstream bug fixes, and have been contributed into upstream LLVM.

Using an unpatched or different version of LLVM will result in errors and/or poor performance. Though Julia can be built with newer LLVM versions, support for this should be regarded as experimental and not suitable for packaging.
Using an unpatched or different version of LLVM will result in errors and/or poor performance.
You can build a different version of LLVM from a remote Git repository with the following options in the `Make.user` file:

```make
# Force source build of LLVM
USE_BINARYBUILDER_LLVM = 0
# Use Git for fetching LLVM source code
DEPS_GIT = 1
# URL of the Git repository you want to obtain LLVM from:
LLVM_GIT_URL = ...
# Name of the branch to check out automatically
LLVM_BRANCH = standalone_rel_15_x
LLVM_SHA1 = $(LLVM_BRANCH)
# Other useful options:
# List of LLVM targets to build. It is strongly recommended to keep at least all the
# default targets listed in `deps/llvm.mk`, even if you don't necessarily need all of them.
# LLVM_TARGETS = ...
# Use ccache for faster recompilation in case you need to restart a build.
# USECCACHE = 1
```

Though Julia can be built with newer LLVM versions, support for this should be regarded as experimental and not suitable for packaging.

### libuv

Expand Down

0 comments on commit ac04e2b

Please sign in to comment.