Compiling QuantumDynamics.jl

QuantumDynamics.compileMethod
QuantumDynamics.compile(; dir = "/home/runner/.julia/sysimages",
                   filename = "sys_qd.so")

Compile QuantumDynamics.jl with PackageCompiler. This will take some time, perhaps a few minutes.

This will create a system image containing the compiled version of QuantumDynamics located at dir/filename, by default /home/runner/.julia/sysimages/sys_qd.so.

You will be able to start Julia with a compiled version of QuantumDynamics using:

~ julia --sysimage /home/runner/.julia/sysimages/sys_qd.so

and you should see that the startup times and JIT compilation times are substantially improved when you are using QuantumDynamics.

In unix, you can create an alias with the Bash command:

~ alias julia_qd="julia --sysimage /home/runner/.julia/sysimages/sys_qd.so -e 'using QuantumDynamics' -i"

which you can put in your ~/.bashrc, ~/.zshrc, etc. This also executes using QuantumDynamics so that QuantumDynamics is loaded and ready to use, you can leave off -e 'using QuantumDynamics' -i if you don't want that. Then you can start Julia with a version of QuantumDynamics installed with the command:

~ julia_qd

Note that if you update QuantumDynamics to a new version, for example with using Pkg; Pkg.update("QuantumDynamics"), you will need to run the QuantumDynamics.compile() command again to recompile the new version of QuantumDynamics.

source