# Use PackageCompiler to produce EXE on non-VM, execute on VM gives "ERROR: Unable to find compatible target in system image"

**URL:** <https://discourse.julialang.org/t/use-packagecompiler-to-produce-exe-on-non-vm-execute-on-vm-gives-error-unable-to-find-compatible-target-in-system-image/23521>\
**Category:** General Usage\
**Created:** [April 25, 2019, 4:24pm UTC](https://discourse.julialang.org/t/use-packagecompiler-to-produce-exe-on-non-vm-execute-on-vm-gives-error-unable-to-find-compatible-target-in-system-image/23521 "2019-04-25T16:24:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonbarkerlondon](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jonbarkerlondon](https://discourse.julialang.org/u/jonbarkerlondon)\
**Post date:** [April 25, 2019, 4:24pm UTC](https://discourse.julialang.org/t/use-packagecompiler-to-produce-exe-on-non-vm-execute-on-vm-gives-error-unable-to-find-compatible-target-in-system-image/23521/1 "2019-04-25T16:24:56Z")

</div>

1. Compile on my win10 x64 desktop,
2. Copy the .EXE to WinServer2012 x64 VM
3. Execute the EXE on the VM I receive the error above.

I guess this is due to different CPU features or something between the 2 computers.  
Any recommendations? I could probably execute LD.exe on the VM targetting the .A file generated by PackageCompiler but trying to just copy the .EXE/.DLL directly.

Thanks

---

<div class="post-metadata">

**Author:** ![nodrygo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nodrygo/32/2443_2.png) [@nodrygo](https://discourse.julialang.org/u/nodrygo)\
**Post date:** [April 25, 2019, 4:41pm UTC](https://discourse.julialang.org/t/use-packagecompiler-to-produce-exe-on-non-vm-execute-on-vm-gives-error-unable-to-find-compatible-target-in-system-image/23521/2 "2019-04-25T16:41:34Z")

</div>

> [@jonbarkerlondon](#):
>
> receive the error above

got the same problem with 2 Linux computers but one icore7 and other with AMD Athlon dual 64b

programs compiled with either Racket or Go have not this problem  
more Julia need lot of shared lib where Go is unique stand alone bin  
and Julia eat lot Memory compared to Go  
(by the way I have tested the 3 dev. lang. [here](https://github.com/nodrygo/GoClock) with stupid and useless appli. 😉

I really like Julia language but it need a big improvement for AOT binaries

---

<div class="post-metadata">

**Author:** ![jonbarkerlondon](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jonbarkerlondon](https://discourse.julialang.org/u/jonbarkerlondon)\
**Post date:** [April 25, 2019, 5:00pm UTC](https://discourse.julialang.org/t/use-packagecompiler-to-produce-exe-on-non-vm-execute-on-vm-gives-error-unable-to-find-compatible-target-in-system-image/23521/3 "2019-04-25T17:00:15Z")

</div>

Should have spent more time researching. Found this

> <https://github.com/JuliaLang/PackageCompiler.jl/issues/118>
>
> I would like to generate a compiled sysimg for a wider target architecture than …the default choice. Currently I have modified \`compile\_package\` \[here\](https://github.com/JuliaLang/PackageCompiler.jl/blob/d7726d2386437ec38bc8aa05fa8a01cd00406b44/src/PackageCompiler.jl#L136) to pass the desired \`cpu\_target\`, but it would be good to have this supported in the main package. 
> 
> I would file a PR but I am not sure which flags you would think to expose or the best way to organize it.

> [@Static julia compilation with own package](https://discourse.julialang.org/t/static-julia-compilation-with-own-package/1435/3):
>
> @ihnorton I finally prepared a reproducible example on [How correct open and close Julia DLL in C++?](https://discourse.julialang.org/t/how-correct-open-and-close-julia-dll/3877)

Fixed it by adding the parameter **cpu\_target=“core2”** or **–cpu-target=core2** depending on how you execute PackageCreator.
