Skip to content

Instantly share code, notes, and snippets.

@mdavezac
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdavezac/8a23302f4b1da32e2038 to your computer and use it in GitHub Desktop.
Save mdavezac/8a23302f4b1da32e2038 to your computer and use it in GitHub Desktop.
create julia image for specific virtual env
#! /home/mdavezac/usr/src/julia-cb9bcae93a/bin/julia
packages = ["Gadfly", "IJulia", "ZMQ", "Winston", "Tk", "Cairo",
"ProfileView", "ImageView"]
syspath = joinpath(expanduser("~"), ENV["VIRTUAL_ENV"], "share", "julia")
ispath(syspath) || mkdir(syspath)
isdir(syspath) || error(syspath, " is not a directory")
include(joinpath(JULIA_HOME, Base.DATAROOTDIR, "julia", "build_sysimg.jl"))
Pkg.update()
for package in packages
Pkg.add(package)
end
path, io = mktemp()
try
for package in packages
println(io, "using ", package)
end
close(io)
build_sysimg(joinpath(syspath, "image"), "native", path, force=true)
finally
rm(path)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment