Search code examples
packagejuliaread-eval-print-loopscientific-computing

Setting up a Centralized Julia Library repository


I would like to understand if there is a way for all users to use the installed Julia libraries? like, Can libraries be installed by a sudoer so that it is available for all other users? Otherwise, each user has to install their own set of libraries which are common to themselves and if all users install all libraries, it becomes tedious and consumes storage.

If anyone has tried out, Please fill in. This question is with respect to Linux only.


Solution

  • Most likely this should work:

    1. define JULIA_DEPOT_PATH environment variable pointing to some folder where sudoer has write access and everybody else has read

    2. Start Julia and install required packages (they will all end in the above path).

    3. Precompile all packages: using Pkg;pkg"precompile"

    4. Some packages that have PyCall dependencies are installing conda modules - install them all using Conda.add as the sudoer

    5. Make sure that every user sees the repository under exactly the same path as the sudoer (some packages unfortunately set fixed paths when building).

    The above should work, provided that each user of Julia installation is running on identical hardware.

    1. Additionally, consider having each user run their Julia session in their own virtual environment using Pkg;Pkg.activate("somefolder"). They will be able only to use packages defined by the sudoer.