Skip to content

Instantly share code, notes, and snippets.

@mdavezac

mdavezac/create_image.jl

Last active Aug 29, 2015
Embed
What would you like to do?
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