To compile packages using PackageCompiler.jl I found the following steps to be helpful
Update PakcageCompiler to latest using ]dev https://github.com/JuliaLang/PackageCompiler.jl.git
If you have compiled packages before then take care to restore to initial state by copying the sys.dll from C:\Users\UserName\.julia\dev\PackageCompiler\sysimg\backup to C:\Users\UserName\AppData\Local\Julia-1.1.0\lib\julia. You may need to shut down Julia to achieve this. If you had run Jupyter lab, you need to restart the computer
using Pkg; pkg"up"; using PackageCompiler compile_incremental(:Pkg1, :Pkg2, force = false)
Once done, copy from C:\Users\UserName\.julia\dev\PackageCompiler\sysimg\sys.dllto C:\Users\UserName\AppData\Local\Julia-1.1.0\lib\julia\sys.dll
I’m not a Windows expert but I have dabbled with PackageCompiler on Windows and have had some success with build_executable. I would recommend looking at the example in the PackageCompiler repository examples folder. That helped me a lot. See if you can build that c program using PackageCompiler’s build_executable function.
The other thing to remember is that the executable will be standalone in the sense that you can run it without a working julia installation but you’ll still need all the julia dlls. Run build_executable with copy_julialibs = true to see which dlls you’ll need. If you want to run your executable on a machine without julia installed, you’ll have to copy all those dlls to the new machine as well as the exe file itself.
Here is my script to compile a Data Science super image on Windows. Unforutnately, CuArrays and DecisionTree don’t work yet. But the image covers most of my data science needs for now!
┌ Warning: QuartzImageIO.jl can only be used on Apple macOS. Suggested usage is
│ @static if Sys.isapple()
│ using QuartzImageIO
│ # QuartzImageIO specific code goes here
│ end
â”” @ QuartzImageIO C:\Users\xxx\.julia\packages\QuartzImageIO\9DhKg\src\QuartzImageIO.jl:723```