Sysimage incompatible between Intel and AMD x86_64?

I’m using PackageCompiler to provide colleagues with a batteries included package (Julia + pre-compiled Julia code) that they just unzip and run. This process worked perfectly so far for Intel based computers. Trying to run the package on a computer with AMD processor throws the error
ERROR: Unable to find compatible target in system image.
Julia is started like this: julia.exe -J "path\to\sysimage.dll".

Is this to be expected? sysimage.dll is compiled on an Intel i5-8265U. The error occurs on an AMD Ryzen 9 3900X based computer. Both are running Win10 64 bit.

PackageCompiler offers the option cpu_target, but I couldn’t find possible values. Is there a list somewhere? Would this be the right place to adjust the target architecture?

In the PackageCompiler code I found branches depending on 32bit, 64bit, arm, powerpc, but nothing Intel/AMD specific.

Would chances for success maybe be higher if I compiled on an Intel i7? (Unfortunately, I don’t have an AMD to test).

1 Like

You need to pass a cpu_target argument:
https://julialang.github.io/PackageCompiler.jl/dev/refs/
Julia’s documentation provides more details on JULIA_CPU_TARGET, and gives the options used for creating the official binaries:
https://docs.julialang.org/en/v1/devdocs/sysimg/

3 Likes

Which explicitly is

generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)

and also what is used if you use create_app in PackageCompiler. For sysimages, it is assumed you want to run it on your own machine so it defaults to native for the cpu target.

5 Likes

Setting cpu_target to

generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)

did the trick. Thanks also for the pointers to the docs @Elrod. I’m sure I read those pages already more than once but every new read discovers new things…