# Embedding Julia : Error on init : Unable to find compatible target in cached code image. Target 0 (goldmont): Rejecting this target due to use of runtime-disabled features

**URL:** <https://discourse.julialang.org/t/embedding-julia-error-on-init-unable-to-find-compatible-target-in-cached-code-image-target-0-goldmont-rejecting-this-target-due-to-use-of-runtime-disabled-features/119457>\
**Category:** General Usage\
**Created:** [September 16, 2024, 8:11am UTC](https://discourse.julialang.org/t/embedding-julia-error-on-init-unable-to-find-compatible-target-in-cached-code-image-target-0-goldmont-rejecting-this-target-due-to-use-of-runtime-disabled-features/119457 "2024-09-16T08:11:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luc\_W](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luc_w/32/207478_2.png) [@Luc\_W](https://discourse.julialang.org/u/Luc_W)\
**Post date:** [September 16, 2024, 8:11am UTC](https://discourse.julialang.org/t/embedding-julia-error-on-init-unable-to-find-compatible-target-in-cached-code-image-target-0-goldmont-rejecting-this-target-due-to-use-of-runtime-disabled-features/119457/1 "2024-09-16T08:11:31Z")

</div>

On Windows 11 with Visual Studio 2022 I can embed Julia (version is 1.10.2) and that works fine. When I test the code inside a sandbox or on a different new computer, the initialisation fails and the error I get is :

Unable to find compatible target in cached code image.  
Target 0 (goldmont): Rejecting this target due to use of runtime-disabled features

Anybody a clue?

---

<div class="post-metadata">

**Author:** ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)\
**Post date:** [September 16, 2024, 8:19am UTC](https://discourse.julialang.org/t/embedding-julia-error-on-init-unable-to-find-compatible-target-in-cached-code-image-target-0-goldmont-rejecting-this-target-due-to-use-of-runtime-disabled-features/119457/2 "2024-09-16T08:19:55Z")

</div>

> [@Luc\_W](#):
>
> I can embed Julia

It is unclear to me what you are doing. Can you please elaborate what you are mean with “embed”?

---

<div class="post-metadata">

**Author:** ![Luc\_W](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luc_w/32/207478_2.png) [@Luc\_W](https://discourse.julialang.org/u/Luc_W)\
**Post date:** [September 16, 2024, 8:55am UTC](https://discourse.julialang.org/t/embedding-julia-error-on-init-unable-to-find-compatible-target-in-cached-code-image-target-0-goldmont-rejecting-this-target-due-to-use-of-runtime-disabled-features/119457/3 "2024-09-16T08:55:17Z")

</div>

It is a c++ program where I can call Julia functions.  
The line where I get the error message is

```
    jl_init_with_image(JuliaHomeDir, JuliaSysImage);

```

In my development environment it works fine. If I test the code on the same computer but in a sandbox, I get the above error message

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [September 16, 2024, 10:18am UTC](https://discourse.julialang.org/t/embedding-julia-error-on-init-unable-to-find-compatible-target-in-cached-code-image-target-0-goldmont-rejecting-this-target-due-to-use-of-runtime-disabled-features/119457/4 "2024-09-16T10:18:50Z")

</div>

How do you create `JuliaSysImage`? Presumably you have differences in the architectures or instruction sets between your workstation and the target, and may need to generate the sysimage for a common architecture.

---

<div class="post-metadata">

**Author:** ![Luc\_W](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luc_w/32/207478_2.png) [@Luc\_W](https://discourse.julialang.org/u/Luc_W)\
**Post date:** [September 16, 2024, 10:37am UTC](https://discourse.julialang.org/t/embedding-julia-error-on-init-unable-to-find-compatible-target-in-cached-code-image-target-0-goldmont-rejecting-this-target-due-to-use-of-runtime-disabled-features/119457/5 "2024-09-16T10:37:23Z")

</div>

The sys image is created with the PackageCompiler, I have a CJM.jl that contains the functions for the system image.

The jl script that I use to create the image is  
using Pkg  
Pkg.add(“PackageCompiler”)  
using PackageCompiler

#pkg.activate(“CJM”)  
Pkg.develop(path=“CJM”)  
PackageCompiler.create\_sysimage([:CJM],sysimage\_path=“…\bin64\Julia\bin\CJM.dll”)  
Pkg.activate(“”)

Architecture should not play a role, since when I test it in a sandbox, it is basically using the same computer hardware, only the windows environment is fresh.

And I also get this when I use jl\_init() with no parameters, when it is using its own system image.

Not sure if it is required to recreate the sys image when running on a different machine, even if I restrict those machine to be Windows 10/11 / 64bit
