Julia and IJulia conflict precompile

I am using Julia v1.0.2 compiled (gcc8) with Intel-MKL and Intel-libm under RHEL 7. It seems this Julia and IJulia each precompile its own compiled.
(The generic binary, on the other hand, works perfectly).

Start with a clean .julia/compiled, it first precompile Revise.jl,

.julia ❯ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.2 (2018-11-08)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |

[ Info: Recompiling stale cache file /home/pshi/.julia/compiled/v1.0/Revise/M1Qoh.ji for Revise [295af30f-e4ad-537b-8983-00126c2a3abe]

Then I restart julia, everything’s fine,

.julia ❯ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.2 (2018-11-08)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |

julia> 

Then I start IJulia througth Jupyterlab and start a Julia kernel, then I switch back to terminal,

.julia ❯ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.2 (2018-11-08)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |

[ Info: Precompiling Revise [295af30f-e4ad-537b-8983-00126c2a3abe]
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for Revise [295af30f-e4ad-537b-8983-00126c2a3abe]
│   exception = Required dependency OrderedCollections [bac558e1-5e72-5ebc-8fee-abe8a469f55d] failed to load from a cache file.
└ @ Base loading.jl:969
[ Info: Recompiling stale cache file /home/pshi/.julia/compiled/v1.0/OrderedCollections/LtT3J.ji for OrderedCollections [bac558e1-5e72-5ebc-8fee-abe8a469f55d]
julia> 

It then start to re-recompile the package again. It is also noticed that both of them compile the package to its own kind and if I switch back and forth, they recompile everything on each own start (unless if I stick to use one of them).

I am not sure why it happens nor did I find a similar problem elsewhere. If you have any clues, please let me know. Thanks in advance.

This part is expected from the current implementation. That’s why I suggested Suggestion: Use different precompilation cache path for different system image by tkf · Pull Request #29914 · JuliaLang/julia · GitHub

1 Like

Maybe a silly question, according to the explanation in the above page, why Julia and IJulia are considered as two different systems? I though they were using the same head (version) of git. Thanks!

IJulia is a package so I think it should behave as any other packages. I’m not sure why you are seeing the behavior specific to IJulia. Did you build IJulia using the Julia executable with MKL? You can find the entry point in the file ~/.local/share/jupyter/kernels/julia-1.0/kernel.json. Make sure that it is using the executable you intended to use. If not, edit the file manually or re-build IJulia using the executable you want to use.

2 Likes

Thanks! That is where the problem is!