Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[devdocs] Improve documentation about building external forks of LLVM #50207

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
36 changes: 34 additions & 2 deletions doc/src/devdocs/build/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ 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.

Julia's Makefiles define convenient automatic rules called `print-<VARNAME>` for printing the value of variables, replacing `<VARNAME>` with the name of the variable to print the value of.
For example
```console
$ make print-JULIA_PRECOMPILE
JULIA_PRECOMPILE=1
```
These rules are useful for debugging purposes.

Now you should be able to run Julia like this:

julia
Expand Down Expand Up @@ -239,10 +249,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
vtjnash marked this conversation as resolved.
Show resolved Hide resolved
# URL of the Git repository you want to obtain LLVM from:
LLVM_GIT_URL = ...
# Name of the branch to check out automatically
LLVM_BRANCH = ...
LLVM_SHA1 = $(LLVM_BRANCH)
vtjnash marked this conversation as resolved.
Show resolved Hide resolved

# 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