you can also use the existing sys.ji image to bootstrap the next one, no need to run it twice
cd base && julia --build <output file without extension> -J sys.ji sysimg.jl then you can use the output file with julia -J <path to sys.ji> this really should be better documented, since it isn’t really that complicated On Fri, Oct 24, 2014 at 6:46 PM, Isaiah Norton <[email protected]> wrote: > It is necessary to run --build twice to get a fully-inferred version. sys0 > is just an intermediate stage and can go anywhere (unless there are still > some hard-coded paths). Something like this (from julia/base): > > julia --build /tmp/sys0 sysimg.jl > julia --build /usr/lib/x86_64-linux-gnu/julia/sys.so -J /tmp/sys0 > sysimg.jl # cache everything > > (The PPA doesn't distribute sys0 because it is unnecessary in a compiled > distribution) > > On Fri, Oct 24, 2014 at 11:24 AM, Daniel Carrera <[email protected]> > wrote: > >> Ok. I have had a really hard time finding a solution. I have found many >> posts claiming that it is possible to pre-compile modules, but very few >> posts that actually try to help you do it. That said, I think I have pieced >> together some of the steps: >> >> >> -------------------------- >> >> $ cd /usr/share/julia/base >> >> $ sudo vi userimg.jl # Insert lines like require("PyCall") >> >> $ sudo julia --build ../usr/lib/julia/sys0 sysimg.jl >> ... >> Cannot open system image file "../usr/lib/julia/sys0.ji" for writing. >> -------------------------- >> >> This obviously fails because ../usr does not exist. There is no file in >> my system (Ubuntu) called sys9.ji but there are files called >> >> /usr/lib/x86_64-linux-gnu/julia/sys.so >> /usr/lib/x86_64-linux-gnu/julia/sys.ji >> >> >> After backing up /usr/lib/x86_64-linux-gnu/julia/, I tried the command >> >> $ sudo julia --build /usr/lib/x86_64-linux-gnu/julia/sys sysimg.jl >> >> >> This gave no compile-time errors, but now Julia dies with a seg fault: >> >> $ julia >> zsh: segmentation fault (core dumped) julia >> >> >> This happens even if userimg.jl has nothing bug comments... I can recover >> Julia from the backup, but if anyone can see an obvious error that I can >> just fix, I would like to hear it. >> >> Cheers, >> Daniel. >> >> >> >> >> >> On 24 October 2014 15:59, Isaiah Norton <[email protected]> wrote: >> >>> It is not strictly necessary to build from source - try searching this >>> list for "sysimg" and look for the "--build" incantation for PPA installs >>> (I'm pretty sure it has come up before). >>> >>> >>> >>> On Fri, Oct 24, 2014 at 9:53 AM, Daniel Carrera <[email protected]> >>> wrote: >>> >>>> Oh, and I now figured out why I can't get Julia to pre-compile the >>>> modules I want. Apparently you have to be building it from source... >>>> >>>> Now I'll go and give that a try. >>>> >>>> Cheers, >>>> Daniel. >>>> >>>> >>>> >>>> On Friday, 24 October 2014 15:47:58 UTC+2, Daniel Carrera wrote: >>>>> >>>>> Yes, it seems to work. Apparently my Julia directory is >>>>> "/usr/bin/../share/julia/base/", so that's one problem solved. >>>>> Thanks! >>>>> >>>>> Cheers, >>>>> Daniel. >>>>> >>>>> On 24 October 2014 14:53, Till Ehrengruber <[email protected]> >>>>> wrote: >>>>> >>>>>> You cuold look where your julia base library is located for example by >>>>>> >>>>>> functionloc(push!) >>>>>> ("/usr/local/Cellar/julia/0.3.1/bin/../share/julia/base/array.jl",464 >>>>>> ) >>>>>> >>>>>> >>>>>> I'm on OS X but it should work on Ubuntu as well >>>>>> >>>>>> Am Freitag, 24. Oktober 2014 14:31:32 UTC+2 schrieb Daniel Carrera: >>>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> I am running Ubuntu with Julia 0.3.1 installed from PPA. I want to >>>>>>> figure out where my Julia base directory is so I can create a userimg.jl >>>>>>> file so I can pre-compile some modules that I use often. I got the >>>>>>> idea from here: >>>>>>> >>>>>>> https://github.com/JuliaLang/Gtk.jl/blob/master/doc/precompi >>>>>>> lation.md >>>>>>> >>>>>>> The problem is that I cannot figure out where my jula/base directory >>>>>>> is. It appears to be nowhere. I have two candidate directories: >>>>>>> >>>>>>> /usr/share/julia >>>>>>> /usr/local/julia >>>>>>> >>>>>>> My Julia version is 0.3.1. The file /usr/share/julia/VERSION says it >>>>>>> is 0.3.0-prerelease. On the other hand, /var/lib/dpkg/info/julia.list >>>>>>> seems to say that /usr/share/julia is the correct directory. So that >>>>>>> doesn't make sense. The other directory --- /usr/local/julia --- >>>>>>> does not have any VERSION file or anything that I could that would tell >>>>>>> me >>>>>>> what version of Julia it is for. I tried adding the "userimg.jl" >>>>>>> file to both directories, but that didn't do anything. Even more >>>>>>> strangely, neither >>>>>>> directory one seems to be required for Julia to run. Look: >>>>>>> >>>>>>> >>>>>>> $ sudo mv /usr/share/julia $HOME/usr-share-julia >>>>>>> $ sudo mv /usr/local/julia $HOME/usr-local-julia >>>>>>> $ >>>>>>> $ julia --version >>>>>>> julia version 0.3.1 >>>>>>> $ >>>>>>> $ julia >>>>>>> _ >>>>>>> _ _ _(_)_ | A fresh approach to technical computing >>>>>>> (_) | (_) (_) | Documentation: http://docs.julialang.org >>>>>>> _ _ _| |_ __ _ | Type "help()" for help. >>>>>>> | | | | | | |/ _` | | >>>>>>> | | |_| | | | (_| | | Version 0.3.1 (2014-09-21 21:30 UTC) >>>>>>> _/ |\__'_|_|_|\__'_| | Official http://julialang.org release >>>>>>> |__/ | x86_64-linux-gnu >>>>>>> >>>>>>> julia> >>>>>>> >>>>>>> >>>>>>> In other words, neither of those directories seems to be needed to >>>>>>> run Julia. So, I am completely stuck. I have two "base" >>>>>>> directories, neither of which seems to do anything. >>>>>>> >>>>>>> Can anyone help me out? >>>>>>> >>>>>>> Cheers, >>>>>>> Daniel. >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>> >>>>> >>>>> -- >>>>> When an engineer says that something can't be done, it's a code phrase >>>>> that means it's not fun to do. >>>>> >>>> >>> >> >> >> -- >> When an engineer says that something can't be done, it's a code phrase >> that means it's not fun to do. >> > >
