Constants
#
Base.C_NULL
— Constant
C_NULL
The null pointer constant C, which is sometimes used when calling external code.
#
Base.VERSION
— Constant
VERSION
An object VersionNumber
, which describes the currently used version of Julia. See also Literals of version numbers.
#
Base.DEPOT_PATH
— Constant
DEPOT_PATH
The stack of "storage" locations, where the package manager, as well as Julia code download mechanisms, search for registries, installed packages, named environments, repository clones, cached compiled package images, and configuration files. By default, the stack includes:
-
~/.julia
, where~
is the main location of the user in the system; -
a shared system directory depending on the specific architecture, for example
/usr/local/share/julia
; -
a shared architecture-independent system directory, such as `/usr/share/julia'.
Thus, the DEPOT_PATH
can look like this:
[joinpath(homedir(), ".julia"), "/usr/local/share/julia", "/usr/share/julia"]
The first record is the "user’s storage", it is added by the current user and belongs to him. Registries are cloned in the user storage, new versions of packages are installed, named environments are created and updated, package repositories are cloned, newly compiled package image files are saved, log files are written, development packages are extracted by default, and global configuration data is saved. Subsequent entries in the storage path are considered read-only and are suitable for registries, packages, etc. installed and managed by system administrators.
The DEPOT_PATH
is filled in based on the environment variable JULIA_DEPOT_PATH
, if specified.
DEPOT_PATH content
Each entry in the DEPOT_PATH
is a directory path that contains nested directories used by Julia for various tasks. The following is an overview of some of the nested directories that may be located in the repository.:
-
`artifacts': The content used by packages whose installation is managed by Pkg.
-
clones': contains complete clones of package repositories. It is supported by `Pkg.jl
and is used as a cache. -
config
: contains Julia level configuration such as `startup.jl'. -
compiled
: contains precompiled files*.ji
for packages. It is supported in Julia. -
dev
: the default directory forPkg.develop'. It is supported by `Pkg.jl
and by the user. -
environments
: default package environments. For example, the global environment for a specific Julia version. 'Pkg.jl` is supported. -
logs': Contains logs of `Pkg
andREPL
operations.Pkg.jl
and `Julia' are supported. -
packages': Contains packages, some of which are explicitly installed, while others contain implicit dependencies. 'Pkg.jl
is supported. -
registers': contains the registers of packages. By default, only `General
. 'Pkg.jl` is supported. -
'scratchspaces': the contents that the package itself installs through the package https://github.com/JuliaPackaging/Scratch.jl [
Scratch.jl
]. 'Pkg.gc()` deletes content that is not known to be in use.
Packages that will save the contents must use the |
See also the description JULIA_DEPOT_PATH
and the section Code download.
#
Base.LOAD_PATH
— Constant
LOAD_PATH
An array of paths for the using
and import
statements, which should be considered project environments or package directories when loading code. Filled in based on the environment variable JULIA_LOAD_PATH
, if it is set; otherwise, the default value is ["@", "@v#.#", "@stdlib"]
. Entries starting with @
have a special meaning.:
-
The
@
refers to the "current active environment", the initial value of which is initially determined by the environment variableJULIA_PROJECT
or the command line parameter `--project'. -
'@stdlib` expands to the absolute directory path of the standard library for the installed Julia instance.
-
'@name` refers to the named environment that is stored in the repositories (see
JULIA_DEPOT_PATH'
) in the `environments subdirectory. The named user environments are stored in~/.julia/environments
, so@name
will refer to the environment in~/.julia/environments/name
if it exists and contains theProject.toml
file. If thename
contains the characters, they will be replaced by major, minor, and fix components according to the Julia version number. For example, if you are using Julia 1.2, then
@v.#
expands to@v1.2
and will search for the environment by this name, usually in~/.julia/environments/v1.2
.
The fully expanded value of LOAD_PATH
, which is searched for in projects and packages, can be viewed by calling the Base.load_path()
function.
See also the description of constants JULIA_LOAD_PATH
, JULIA_PROJECT
, JULIA_DEPOT_PATH
and the section Code download.
#
Base.Sys.BINDIR
— Constant
Sys.BINDIR::String
A string that contains the full path to the directory where the executable file `julia' is contained.
#
Base.Sys.CPU_THREADS
— Constant
Sys.CPU_THREADS::Int
The number of logical CPU cores available in the system, that is, the number of threads that the CPU can execute simultaneously. Please note that it is not necessary to keep in mind the number of CPU cores, for example, if there are https://en.wikipedia.org/wiki/Hyper-threading [hyperthreading].
For more information, including the number of physical cores, see the Hwloc.jl or CpuId.jl files.
#
Base.Sys.WORD_SIZE
— Constant
Sys.WORD_SIZE::Int
The standard word size on the current computer (in bits).
#
Base.Sys.KERNEL
— Constant
Sys.KERNEL::Symbol
A symbol representing the operating system name returned by the uname
of the build configuration.
#
Base.Sys.ARCH
— Constant
Sys.ARCH::Symbol
A symbol representing the architecture of the assembly configuration.
See also the description