Skip to content

Commit a57528f

Browse files
authored
improve docs on modulefiles (#769)
1 parent 846c79d commit a57528f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

docs/src/configuration.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Preferences are merged across the Julia load path, such that it is feasible to p
7676
mpiexec = "/software/mpi/bin/mpiexec"
7777
```
7878

79-
2. Create a file called `Project.toml` or `JuliaProject.toml` in a central location, for example `/software/mpi/julia` or in the same directory as the MPI library module, and add the following contents:
79+
2. Create a file called `Project.toml` or `JuliaProject.toml` in a central location (for example `/software/mpi/julia`, or in the same directory as the MPI module file), and add the following contents:
8080

8181
```toml
8282
[extras]
@@ -94,12 +94,21 @@ Preferences are merged across the Julia load path, such that it is feasible to p
9494

9595
3. Append the directory containing the file to the [`JULIA_LOAD_PATH`](https://docs.julialang.org/en/v1/manual/environment-variables/#JULIA_LOAD_PATH) environment variable, with a colon (`:`) separator.
9696

97-
If this variable is _not_ already set, it should be prefixed with a colon to ensure correct
98-
behavior of the Julia load path, e.g. `JULIA_LOAD_PATH=":/software/mpi/julia"`.
97+
!!! note
98+
If this variable is _not_ already set, it should be prefixed with a colon to ensure correct
99+
behavior of the Julia load path (e.g. `JULIA_LOAD_PATH=":/software/mpi/julia"`)
100+
99101
If using environment modules, this can be achieved with
100102
```
101103
append-path -d {} JULIA_LOAD_PATH :/software/mpi/julia
102104
```
105+
or if using an older version of environment modules
106+
```
107+
if { ![info exists ::env(JULIA_LOAD_PATH)] } {
108+
append-path JULIA_LOAD_PATH ""
109+
}
110+
append-path JULIA_LOAD_PATH /software/mpi/julia
111+
```
103112
in the corresponding module file (preferably the module file for the MPI installation or for Julia).
104113

105114
The user can still provide differing MPI configurations for each Julia project

0 commit comments

Comments
 (0)