# 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:** 1\
**Showing post:** 3

<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.

---

_[View the full topic](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)._
