Running Julia on remote machine

Frequently I run code on a remote machine which means executing at the command line. But every time I run a code in Julia it’s going to recompile everything and so it takes longer. Is there a way to remember the compiled stuff from a previous execution so it’s faster the second time like it is when I run in the REPL?

Frequently I run code on a remote machine which means executing at the command line.

Why not using ssh capable editors like vscode or emacs ? If the CLI is mandatory, you may use PackageCompiler.

2 Likes

Good idea, but two-factor authentication makes that more challenging.

Can’t you leave the REPL running at the server? If you use gnu-screen or tmux you can even logout and leave it there.

5 Likes

This is a common issue. If you can’t keep the session open on the remote machine, you’ll have to use PackageCompiler.jl to build a custom system image, which basically serializes a session to a file. Or, you could wait for Julia v1.6, which does a much better job on JIT latency.

The easiest solution for me is to say into the headless machine which has byobu+tmux installed and then run emacs in the terminal in one of the byobu windows (are they called windows?). This wil work as long as you can ssh into the machine and the session stays open independent of connection.