From b666d5f8d67cda707879cbc2cbfcd7ad476f9869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sun, 18 Jun 2023 17:17:16 +0100 Subject: [PATCH 1/3] [devdocs] Improve documentation about building external forks of LLVM --- Make.inc | 4 ++++ doc/src/devdocs/build/build.md | 28 ++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Make.inc b/Make.inc index 301ee934320f6..9041b6f5aca17 100644 --- a/Make.inc +++ b/Make.inc @@ -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 diff --git a/doc/src/devdocs/build/build.md b/doc/src/devdocs/build/build.md index ad3871c2e70f0..a206a209f20ce 100644 --- a/doc/src/devdocs/build/build.md +++ b/doc/src/devdocs/build/build.md @@ -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 @@ -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 = ... +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 From 5d8b6c66788f906265fb636440ca28dee8773283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sun, 18 Jun 2023 17:57:14 +0100 Subject: [PATCH 2/3] [devdocs] Document special `print-*` Make rules for debugging --- doc/src/devdocs/build/build.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/src/devdocs/build/build.md b/doc/src/devdocs/build/build.md index a206a209f20ce..1b16f5657d4dc 100644 --- a/doc/src/devdocs/build/build.md +++ b/doc/src/devdocs/build/build.md @@ -62,6 +62,14 @@ To run julia from anywhere you can: 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-` for printing the value of variables, replacing `` 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 From d6ddaac924110fdf2548c83636f3d21f71df3c06 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 31 Oct 2023 16:55:41 -0400 Subject: [PATCH 3/3] Update build.md --- doc/src/devdocs/build/build.md | 36 ++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/doc/src/devdocs/build/build.md b/doc/src/devdocs/build/build.md index 1b16f5657d4dc..c915c669f2c5e 100644 --- a/doc/src/devdocs/build/build.md +++ b/doc/src/devdocs/build/build.md @@ -259,21 +259,37 @@ You can build a different version of LLVM from a remote Git repository with the # Force source build of LLVM USE_BINARYBUILDER_LLVM = 0 # Use Git for fetching LLVM source code +# this is either `1` to get all of them 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 = ... -LLVM_SHA1 = $(LLVM_BRANCH) +# or a space-separated list of specific dependencies to download with git +DEPS_GIT = llvm # 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 +#URL of the Git repository you want to obtain LLVM from: +# LLVM_GIT_URL = ... +#Name of the alternate branch to clone from git +# LLVM_BRANCH = julia-16.0.6-0 +#SHA hash of the alterate commit to check out automatically +# LLVM_SHA1 = $(LLVM_BRANCH) +#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 +# CMAKE_GENERATOR=Ninja +# LLVM_ASSERTIONS=1 +# LLVM_DEBUG=Symbols ``` +The various build phases are controlled by specific files: + * `deps/llvm.version` : touch or change to checkout a new version, `make get-llvm check-llvm` + * `deps/srccache/llvm/source-extracted` : result of `make extract-llvm` + * `deps/llvm/build_Release*/build-configured` : result of `make configure-llvm` + * `deps/llvm/build_Release*/build-configured` : result of `make compile-llvm` + * `usr-staging/llvm/build_Release*.tgz` : result of `make stage-llvm` (regenerate with `make reinstall-llvm`) + * `usr/manifest/llvm` : result of `make install-llvm` (regenerate with `make uninstall-llvm`) + * `make version-check-llvm` : runs every time to warn the user if there are local modifications + Though Julia can be built with newer LLVM versions, support for this should be regarded as experimental and not suitable for packaging. ### libuv