Overview of julia’s build process
make O=julia-wsl configure
make -C julia-wsl/ -j4 # build all things
We build julia in the folder
Build the order of targets
You can build these targets one by one, making it easy to observe each step of the action.
make -C julia-wsl/ julia-deps
make -C julia-wsl/deps/.
Most of the
deps\Makefile file is making conditional judgments about whether to use the system’s, or julia’s compiled dependencies.
There are a number of
includes at the end of the makefile, and each individually imported
.mk file is responsible for building a given dependency.
In general, most of the dependencies are pre-compiled in advance by
BinaryBuilder.jl. When executing
make, most of the dependencies are simply downloaded as pre-compiled artifacts, while the remaining few dependencies need to be compiled.
BinaryBuilder pre-compiled dependencies are downloaded and unpacked directly to
The compilation script used for precompilation is found in the BB compilation configuration repo by the dependency name: GitHub - JuliaPackaging/Yggdrasil: Collection of builder repositories for BinaryBuilder.jl
Source code compilation
Dependencies that need to be compiled from source code:
make -C julia-wsl/ julia-stdlib
make -C julia-wsl/stdlib/
Many of the julia standard libraries have been moved out of the main julia repo, so they need to be downloaded.
There are also some standard libraries that have binary dependencies and need to be downloaded.
There are two types of julia packages
- The normal source-only packages, with
.jl as a suffix
- thin wrappers of binary dependencies, usually automatically generated, with
_jll.jl as a suffix.
Standard libraries to be downloaded
Print the list of standard libraries to be downloaded:
make -C julia-wsl/stdlib/ print-STDLIBS_EXT
Pkg Statistics LibCURL Downloads ArgTools Tar NetworkOptions SuiteSparse SparseArrays SHA
- The version number (commit) is specified by the corresponding
- Download cache path:
- Installation path:
JLL binary dependencies to be downloaded
Print all JLL packages:
make -C julia-wsl/stdlib/ print-JLL_NAMES
MozillaCACerts_jll dSFMT_jll GMP_jll LibCURL_jll LibGit2_jll libLLVM_jll LibSSH2_jll LibUV_jll MbedTLS_jll MPFR_jll nghttp2_jll libblastrampoline_jll OpenBLAS_jll OpenLibm_jll p7zip_jll PCRE2_jll SuiteSparse_jll Zlib_jll LLVMLibUnwind_jll CompilerSupportLibraries_jll LibUnwind_jll
- The corresponding thin wrapper is already located in the
- The version number is specified by the corresponding
- Download and unpack and install it to
make -C julia-wsl/ julia-base
make -C julia-wsl/base/
A number of symbolic links are created, generating a number of
.jl files containing constants.
make -C julia-wsl/ julia-cli-release
make -C julia-wsl/cli/ release
make -C julia-wsl/ julia-src-release
make -C julia-wsl/src/ release
Build the core of julia.
Folder build order:
make -C julia-wsl/ julia-sysimg-release
Warn: I don’t know much about this step, so I may not be describing it accurately.
sysimage.mk to build the system image.
.jl file into a binary.
This step also generates the REPL pre-compilation statements and executes them.
make -C julia-wsl/ julia-base-cache
Write the sys source cache in format readable by Base._read_dependency_src
You can run
make -C julia-wsl/ -j4. It will build two more test targets.
After that you can execute
. /julia to open the julia REPL.