Precompiled libraries


Where can I find a collection of precompiled libraries for Julia? The very long times I have to wait to compile libraries such as Flux and even BSON is getting to me. Thanks.

I don’t think packages are available precompiled form. You can do

pkg> precompile

in a given environment and get a coffee.

Which version of Julia are you using? Using 1.4 on a computer with an SSD compile times should be reasonable. From scratch (redownloading all artifacts etc), Flux takes me 3 minutes on a not-so-powerful laptop.


I am using version 1.3 on MacOsx in Atom. I have 1.4 installed but for some reason I am not using it (I guess I did not really understand what I was doing when I started out). But I tried your approach using “precompile” in Pkg> and it worked! I exited Atom, started it up again, and the speed of loading modules via the “using” command was maintained. Thank you very much!


1 Like

Ok, the approach worked. I assume that the precompiled packaged are stored somewhere under the ~/.julia folder. So now I exit Julia with an exit() command and get back in. And packages must recompile. Why would that be? Why can’t the precompiled files be simply loaded from somewhere under ~/.julia where they were stored. I really do not understand.

I have to quit and reenter julia to clear my workspace because Julia does not appear to have a mechanism to simply clear all variables. Why not by the way? Even Jupyter has this functionality.



That certainly shouldn’t be happening, probably something is accidentally invalidating the precompilation cache. Note that the cache is per-environment, are you switching between different environments with pkg> activate ... ? Also, can you verify you don’t accidentally have two copies of Julia installed, maybe even a different one on the command line vs. in Atom? That can sometimes cause them to keep invalidating each other’s caches. You can check by running Base.julia_cmd() in each Julia terminal and ensure its the same path.

Another pitfall may be that Atom keeps like 3 Julia’s started in the background, so when you kill one and restart it another one is already ready to go, but sometimes it might not pick up some changes to your environment or settings that you made. Not sure if that could be causing what you see here but you can turn that off to check from Atom -> packages -> julia-client -> settings -> change boot mode to basic.

1 Like

Wow! This is way beyond what I expected! I will perform some experiments. I also wish to investigate remote computing with Julia on remote servers with Cuda cards.


Also note that precompilation caching is constantly being improved, so unless you have a compelling reason not to use 1.4, you should.

Ok, will do. Thanks for the advice.