# Base packages for all users

**URL:** <https://discourse.julialang.org/t/base-packages-for-all-users/77262>\
**Category:** Package Management\
**Tags:** question\
**Created:** [March 1, 2022, 9:44pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262 "2022-03-01T21:44:58Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![RonRahaman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronrahaman/32/34216_2.png) [@RonRahaman](https://discourse.julialang.org/u/RonRahaman)\
**Post date:** [March 1, 2022, 9:44pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/1 "2022-03-01T21:44:58Z")

</div>

Hi all,

I’m an administrator of a shared compute cluster, and I’d like to provide a few packages in a sort of “base environment” for all users on the system. What’s the recommended workflow for this?

Specifically, I’d like to have MPI.jl and CUDA.jl pre-installed for all users, so I can make sure they’re configured correctly for our system.

Many thanks,  
Ron

* * *

Ron Rahaman  
Research Scientist II  
Partnership for an Advanced Computing Environment (PACE)  
Georgia Institute of Technology

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [March 1, 2022, 11:32pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/2 "2022-03-01T23:32:42Z")

</div>

Hi! Welcome!

At NERSC they have `JULIA_DEPOT_PATH` and `JULIA_LOAD_PATH` pointing to a place where they installed the packages. When you do `module load julia` these environment variables get defined, so when you use Julia you have access to those packages. They do it especifically for things like MPI.jl  
Unfortunately I am not familiar with the specifics.

> **[Julia - NERSC Documentation](https://docs.nersc.gov/development/languages/julia/)**
>
> NERSC Documentation

---

<div class="post-metadata">

**Author:** ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Post date:** [March 1, 2022, 11:39pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/3 "2022-03-01T23:39:24Z")

</div>

@RonRahaman - you are at GT?  
Cool, I am at GTRI.  
If you could DM me your email, we could set up a time to chat - happy to assist. 🙂

~ tcp 🌳

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [March 2, 2022, 7:10am UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/4 "2022-03-02T07:10:24Z")

</div>

Doesn’t DEPOT path cause compilation of packages like IJulia to error because they try to write to read-only path?

---

<div class="post-metadata">

**Author:** ![RonRahaman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronrahaman/32/34216_2.png) [@RonRahaman](https://discourse.julialang.org/u/RonRahaman)\
**Post date:** [March 2, 2022, 3:28pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/5 "2022-03-02T15:28:03Z")

</div>

Edit: Moved to PM

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [March 2, 2022, 4:49pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/6 "2022-03-02T16:49:47Z")

</div>

You can have multiple depots, and I seem to remember only the first one is supposed to be writable.

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [March 2, 2022, 6:38pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/7 "2022-03-02T18:38:10Z")

</div>

That would make sense. In nersc the first entry is the user depot.

```julia
julia> ENV["JULIA_DEPOT_PATH"]
"/global/homes/u/username.julia:/global/common/cori_cle7/software/julia/packages/intel/1.4.2/julia:/global/common/cori_cle7/software/julia/julia/1.4.2/local/share/julia:/global/common/cori_cle7/software/julia/julia/1.4.2/share/julia"

```

Is this documented anywhere?

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [March 2, 2022, 6:47pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/8 "2022-03-02T18:47:22Z")

</div>

> [@aramirezreyes](#):
>
> Is this documented anywhere?

[https://docs.julialang.org/en/v1/base/constants/#Base.DEPOT\_PATH](https://docs.julialang.org/en/v1/base/constants/#Base.DEPOT_PATH)

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [March 2, 2022, 6:48pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/9 "2022-03-02T18:48:56Z")

</div>

Ah! Thanks. I was reading this one [Environment Variables · The Julia Language](https://docs.julialang.org/en/v1/manual/environment-variables/#JULIA_DEPOT_PATH)

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [March 2, 2022, 6:51pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/10 "2022-03-02T18:51:15Z")

</div>

> [@RonRahaman](#):
>
> I’m an administrator of a shared compute cluster, and I’d like to provide a few packages in a sort of “base environment” for all users on the system. What’s the recommended workflow for this?

One problem I see with your goal is that most packages are in active development and they have new releases every few weeks. If you want to provide in the system depot only one version for each package, the odds that users will use precisely that one are very low.

---

<div class="post-metadata">

**Author:** ![RonRahaman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronrahaman/32/34216_2.png) [@RonRahaman](https://discourse.julialang.org/u/RonRahaman)\
**Post date:** [March 2, 2022, 6:55pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/11 "2022-03-02T18:55:51Z")

</div>

Thanks all! I think I understand `JULIA_LOAD_PATH` now. From [the docs](https://docs.julialang.org/en/v1/manual/environment-variables/#JULIA_LOAD_PATH), I see that setting `JULIA_LOAD_PATH` will prepend `JULIA_LOAD_PATH` to the default load path.

That’s not _exactly_ what I want, since I’d like the packages in `~/.julia` to have higher precedence than the site packages (in case the users want a different configuration than the site packages). But I can mess around with it.

---

<div class="post-metadata">

**Author:** ![RonRahaman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronrahaman/32/34216_2.png) [@RonRahaman](https://discourse.julialang.org/u/RonRahaman)\
**Post date:** [March 2, 2022, 6:58pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/12 "2022-03-02T18:58:26Z")

</div>

Yes, that about sums up my life as an admin. 🙂 The best solution IMO would be for `~/.julia` to take precedence over the directory for my site package. Looks like simply setting `JULIA_LOAD_PATH` and `JULIA_DEPOT_PATH` to my site directory will not establish my desired precedence, though.

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [March 2, 2022, 7:01pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/13 "2022-03-02T19:01:04Z")

</div>

Again, disclaimer: I am only a user in a cluster.

At NERSC I regularly don’t use the module so I use only my own installed packages. However, the time I used the module it works like this.

If I only do `using MPI` it will load the systemwide module.  
If I dare to do `]add MPI` and then `using MPI`, my locally installed package will have precedence.

If you are not interested in the systemwide modules you just can avoid loading the module julia.

Seems kind of what you want to do? But It is not ideal, to be honest. So far using the arctifacts have worked relatively well for me but I have not tested if using the systemwide installs of MPI, NetCDF etc would have better performance because those are linked to the vendor-optimized libraries.

---

<div class="post-metadata">

**Author:** ![RonRahaman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronrahaman/32/34216_2.png) [@RonRahaman](https://discourse.julialang.org/u/RonRahaman)\
**Post date:** [March 2, 2022, 7:10pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/14 "2022-03-02T19:10:49Z")

</div>

> So far using the arctifacts have worked relatively well for me but I have not tested if using the systemwide installs of MPI, NetCDF etc would have better performance because those are linked to the vendor-optimized libraries.

I think my primary concern is the burden on the users to configure it properly. It’s good to know that `]add MPI` works well for you.

I’m a little concerned with CUDA.jl, though. A manual installation could end up being a bad experience for the users: I would need to make sure that the users load the CUDA toolkit module correctly before they run `]add CUDA`, and the CUDA toolkit is not available on every node, and lots more nonsense. So I think **that** is definitely a good candidate for a systemwide install with properly managed modules and packages.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [March 2, 2022, 10:19pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/15 "2022-03-02T22:19:49Z")

</div>

> [@RonRahaman](#):
>
> Yes, that about sums up my life as an admin. 🙂

Contrary to some of the languages traditionally used in research computing environments (I’m thinking of C/C++ and Fortran), Julia actually comes with a decent package manager, so using versions of packages different from those provided by the environment is even more common.

> [@RonRahaman](#):
>
> The best solution IMO would be for `~/.julia` to take precedence over the directory for my site package. Looks like simply setting `JULIA_LOAD_PATH` and `JULIA_DEPOT_PATH` to my site directory will not establish my desired precedence, though.

I don’t think you want to touch `JULIA_LOAD_PATH` at all, but only the depot. For that,

```sh
export JULIA_DEPOT_PATH="${JULIA_DEPOT_PATH}:/foo/bar"

```

should achieve the desired effect.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [March 3, 2022, 1:12am UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/16 "2022-03-03T01:12:14Z")

</div>

Would it be possible for the admin to provide a Julia system image with Cuda and MPI compiled, and, perhaps, block the installation of different versions of these packages?

Of course users can still have their local Julia and do what they want, but having a sys image with those packages included in a HPC environment sounds practical.

---

<div class="post-metadata">

**Author:** ![RonRahaman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronrahaman/32/34216_2.png) [@RonRahaman](https://discourse.julialang.org/u/RonRahaman)\
**Post date:** [March 3, 2022, 2:17am UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/17 "2022-03-03T02:17:24Z")

</div>

I looked at the docs again, and I think I finally understand the behavior of `JULIA_DEPOT_PATH="${JULIA_DEPOT_PATH}:/foo/bar"` when `JULIA_DEPOT_PATH` is not defined. That does indeed seem to be what I want. Thanks again!

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [March 3, 2022, 3:14am UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/18 "2022-03-03T03:14:00Z")

</div>

Great question. If possible, can you mark a post as a solution to help others down the line? Thanks.

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [March 3, 2022, 7:39am UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/19 "2022-03-03T07:39:30Z")

</div>

Hopefully I add something to the debate here. We mention “traditional” HPC languages C/C++ and Fortran.  
texas TACC have developed XALT which tracks the executables and libraries which are REALLY being used in an HPC environment. If I recall, this works by prepending a library path when a job is run. Please have a look at it.

Something tells me that it probably does not work very well with a Julia environment - though I could be wrong.

[https://www.tacc.utexas.edu/research-development/tacc-projects/xalt](https://www.tacc.utexas.edu/research-development/tacc-projects/xalt)

---

<div class="post-metadata">

**Author:** ![paulmelis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paulmelis/32/35063_2.png) [@paulmelis](https://discourse.julialang.org/u/paulmelis)\
**Post date:** [March 3, 2022, 8:43am UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262/20 "2022-03-03T08:43:22Z")

</div>

> [@johnh](#):
>
> Something tells me that it probably does not work very well with a Julia environment - though I could be wrong.

Just like Python script will run under `python`, Julia scripts will run under `julia`. So XALT will not tell you much about the actual application being run, except if you also look at the arguments passed.

In general, at our HPC site most users run the precompiled packages we provide them (e.g. GROMACS), so that doesn’t really relate to the language used, as users themselves don’t pick it. We currently only see a trickle of Julia users, but I intend to look closer at the XALT stats on that in the near future.

[Next page](https://discourse.julialang.org/t/base-packages-for-all-users/77262.md?page=2)
