Last active
January 30, 2020 04:29
-
-
Save bicycle1885/8bcf9cb10b967af7e0950b97b803e002 to your computer and use it in GitHub Desktop.
Set up Julia packages for system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install packages in system | |
# ========================== | |
# License: Public Domain | |
# Usage: julia setup-system.jl package1 package2 ... | |
# Also, don't forget to add '@system' to your LOAD_PATH like this way: | |
# $ env JULIA_LOAD_PATH='@:@v#.#:@system:@stdlib' julia | |
using Pkg | |
packages = ARGS | |
popfirst!(DEPOT_PATH) # remove user's depot | |
Pkg.activate("system", shared = true) | |
Pkg.add(packages) | |
Pkg.precompile() | |
# make cache files readable to others (see | |
# https://github.com/JuliaLang/julia/issues/25971) | |
cachedir = joinpath(DEPOT_PATH[1], "compiled") | |
for cachefile in eachline(`find $(cachedir) -name '*.ji'`) | |
chmod(cachefile, 0o666) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment