1
1
# Environment Variables
2
2
3
- Julia may be configured with a number of environment variables, either in the
4
- usual way of the operating system, or in a portable way from within Julia.
5
- Suppose you want to set the environment variable ` JULIA_EDITOR ` to
6
- ` vim ` , then either type ` ENV["JULIA_EDITOR"] = "vim" ` for instance in the REPL
7
- to make this change on a case by case basis, or add the same to the user
8
- configuration file ` ~/.julia/config/startup.jl ` in the user's home directory to have
9
- a permanent effect. The current value of the same environment variable is
3
+ Julia can be configured with a number of environment variables, set either in
4
+ the usual way for each operating system, or in a portable way from within Julia.
5
+ Supposing that you want to set the environment variable ` JULIA_EDITOR ` to ` vim ` ,
6
+ you can type ` ENV["JULIA_EDITOR"] = "vim" ` ( for instance, in the REPL) to make
7
+ this change on a case by case basis, or add the same to the user configuration
8
+ file ` ~/.julia/config/startup.jl ` in the user's home directory to have a
9
+ permanent effect. The current value of the same environment variable can be
10
10
determined by evaluating ` ENV["JULIA_EDITOR"] ` .
11
11
12
12
The environment variables that Julia uses generally start with ` JULIA ` . If
13
- [ ` InteractiveUtils.versioninfo ` ] ( @ref ) is called with ` verbose ` equal to ` true ` , then the
13
+ [ ` InteractiveUtils.versioninfo ` ] ( @ref ) is called with the keyword ` verbose= true` , then the
14
14
output will list defined environment variables relevant for Julia, including
15
15
those for which ` JULIA ` appears in the name.
16
16
17
17
!!! note
18
18
19
- Some variables, such as `JULIA_NUM_THREADS` and `JULIA_PROJECT` need to be set before Julia
19
+ Some variables, such as `JULIA_NUM_THREADS` and `JULIA_PROJECT`, need to be set before Julia
20
20
starts, therefore adding these to `~/.julia/config/startup.jl` is too late in the startup process.
21
- These must either be set manually before launching Julia through bash with
22
- `export JULIA_NUM_THREADS=4` etc. or added to `-/.bashrc` and/or `~/.bash_profile` to achieve persistence.
21
+ In Bash, environment variables can either be set manually by running, e.g.,
22
+ `export JULIA_NUM_THREADS=4` before starting Julia, or by adding the same command to
23
+ `-/.bashrc` or `~/.bash_profile` to set the variable each time Bash is started.
23
24
24
25
## File locations
25
26
@@ -76,7 +77,7 @@ and a global configuration search path of
76
77
77
78
A directory path that points to the current Julia project. Setting this
78
79
environment variable has the same effect as specifying the ` --project ` start-up
79
- option, but ` --project ` has higher precedence. If the variable is set to ` @. ` ,
80
+ option, but ` --project ` has higher precedence. If the variable is set to ` @. ` then
80
81
Julia tries to find a project directory that contains ` Project.toml ` or
81
82
` JuliaProject.toml ` file from the current directory and its parents. See also
82
83
the chapter on [ Code Loading] ( @ref ) .
@@ -88,8 +89,8 @@ the chapter on [Code Loading](@ref).
88
89
### ` JULIA_LOAD_PATH `
89
90
90
91
A separated list of absolute paths that are to be appended to the variable
91
- [ ` LOAD_PATH ` ] ( @ref ) . (In Unix-like systems, the path separator is ` : ` ; in
92
- Windows systems, the path separator is ` ; ` .) The ` LOAD_PATH ` variable is where
92
+ [ ` LOAD_PATH ` ] ( @ref ) . (In Unix-like systems, ` : ` is the path separator; in
93
+ Windows systems, ` ; ` is the path separator.) The ` LOAD_PATH ` variable is where
93
94
[ ` Base.require ` ] ( @ref ) and ` Base.load_in_path() ` look for code; it defaults to
94
95
the absolute path
95
96
` $JULIA_HOME/../share/julia/stdlib/v$(VERSION.major).$(VERSION.minor) ` so that,
@@ -185,7 +186,7 @@ affinitized. Otherwise, Julia lets the operating system handle thread policy.
185
186
Environment variables that determine how REPL output should be formatted at the
186
187
terminal. Generally, these variables should be set to [ ANSI terminal escape
187
188
sequences] ( http://ascii-table.com/ansi-escape-sequences.php ) . Julia provides
188
- a high-level interface with much of the same functionality: see the section on
189
+ a high-level interface with much of the same functionality; see the section on
189
190
[ The Julia REPL] ( @ref ) .
190
191
191
192
### ` JULIA_ERROR_COLOR `
@@ -283,11 +284,10 @@ event listener for just-in-time (JIT) profiling.
283
284
284
285
This environment variable only has an effect if Julia was compiled with JIT
285
286
profiling support, using either
286
-
287
- * Intel's [ VTune™ Amplifier] ( https://software.intel.com/en-us/intel-vtune-amplifier-xe )
288
- (` USE_INTEL_JITEVENTS ` set to ` 1 ` in the build configuration), or
289
- * [ OProfile] ( http://oprofile.sourceforge.net/news/ ) (` USE_OPROFILE_JITEVENTS ` set to ` 1 `
290
- in the build configuration).
287
+ * Intel's [VTune™ Amplifier](https://software.intel.com/en-us/intel-vtune-amplifier-xe)
288
+ (`USE_INTEL_JITEVENTS` set to `1` in the build configuration), or
289
+ * [OProfile](http://oprofile.sourceforge.net/news/) (`USE_OPROFILE_JITEVENTS` set to `1`
290
+ in the build configuration).
291
291
292
292
### ` JULIA_LLVM_ARGS `
293
293
0 commit comments