Search code examples
kerneljuliajupyterjupyter-lab

Add Julia kernel with flag to JupyterLab


I'm using the package PackageCompiler.jl to create an image that already has some packages precompiled, such as Plots.jl. This speeds up a lot the process of starting a new notebook. The only thing I need to do is run

julia --sysimage ~/JuliaImages/sys_plots.so

Now, I want to add a new kernel to Jupyter that runs Julia with this additional flag. I know that to install different versions of julia kernels, one just needs to run the older Julia version and install the IJulia package. But this does not work for this case where I want to specify a flag.

Does anyone knows how to add this "custom" Julia kernel?


Solution

  • You have installkernel function for this:

    using IJulia
    installkernel("Julia MyImName", "--sysimage=/home/user/JuliaImages/sys_plots.so")
    

    Note that after running this command you will see to which file the kernel was actually installed. In this way you are still able to play with that file if needed to change some other things