I need to install Julia to a Windows environment that does not have an internet connection. I can prepare the installation outside of this environment but then need to transfer the installation to the space. I wanted to install the following packages prior to moving it into the space:
DataFrames
BenchmarkTools
PyCall
Revise
TerminalPager
CSV
XLSX
OhMyREPL
Does anyone have any suggestions on how I can accomplish both preparing a Julia installation, installing the packages in the default Julia environment, and then moving Julia into the Windows space?
I had to do something similar recently and made use of PackageCompiler.jl with a lot of success.
You will have to configure your package dependencies (in VSCode activate the parent directory then do Pkg.add in the repl). before running the PackageCompiler commands but the outcome is an .exe with all the dependencies as .dlls. I did have to run it a few times, modifying for every missing package (some core dependencies like xtsd_jll were missing for some reason).
This suited my needs to distribute Julia without Julia and provided fully compiled code. The only drawback was that it doesn’t yet support setting the number of threads; but this is mitigated with environment variables.
PackageCompiler.jl’s create_sysimage() is great for this! You can just swap out Julia’s default sysimage and have a fully-featured Julia session with whatever packages you need. Most packages nowadays are fully relocatable, and this should only require a single compilation, though packages with lazy-loading need to be specified manually. I’ve written a tutorial on this, and while I’ve never tried setting up a Windows environment this way, it seems possible, and this could be useful to others.
In theory this should “just work” and I love this solution. However, what becomes the problem is targeting the target architecture where the sysimage will be actually run. Like creating a sysimage on OSX architecture does not automatically permit it to run on a windows machine. Did you get aruond that issue? Also, didn’t realize you were at BCBI @Ashlin_Harris ! Great to see more Julians popping up in the Biomedical spaces!
You’re right, the sysimage is built based on Manifest.toml, so it needs to be done on a computer with the same architecture. This approach works best for secure systems that also have a build server.
Well, that’s not so bad – I wonder if we have a staging/build environment. If so, this may quite possibly be a very powerful and great solution. Thanks for sharing thoughts here, this is really great frankly speaking!