# PackageCompiler and Plots.jl: ld warning and 16KB image

**URL:** https://discourse.julialang.org/t/packagecompiler-and-plots-jl-ld-warning-and-16kb-image/115312
**Category:** General Usage
**Tags:** error, package-compiler, plots, system-image
**Created:** [June 7, 2024, 8:01am UTC](https://discourse.julialang.org/t/packagecompiler-and-plots-jl-ld-warning-and-16kb-image/115312 "2024-06-07T08:01:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mgiugliano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mgiugliano/32/5818_2.png) [@mgiugliano](https://discourse.julialang.org/u/mgiugliano)
#### Post date: [June 7, 2024, 8:01am UTC](https://discourse.julialang.org/t/packagecompiler-and-plots-jl-ld-warning-and-16kb-image/115312/1 "2024-06-07T08:01:01Z")

</div>

I am on a Mac (M3) with Sonoma (14.4.1), running Julia v1.10.4 and trying to use PackageCompiler.jl (v2.1.17) with Plots.jl (v1.40.4). Note I get into the same troubles with any other package I am trying to “prepackage”.

Creating a working sys image fails, as the \*.so file is only 16KB and if I try to use it Julia complains that **System image file failed consistency check**.

The creation of the system image returns the following ld warning:

```julia
ld: warning: reexported library with install name '@rpath/libunwind.1.dylib' found at '/Users/myusernamehere/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/lib/julia/libunwind.1.0.dylib' couldn't be matched with any parent library and will be linked directly

```

Any help would be immensely appreciated.

---

<div class="post-metadata">

### Author: ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)
#### Post date: [June 8, 2024, 1:05am UTC](https://discourse.julialang.org/t/packagecompiler-and-plots-jl-ld-warning-and-16kb-image/115312/2 "2024-06-08T01:05:35Z")

</div>

Can you give us a reproducible MWE?

---

<div class="post-metadata">

### Author: ![mgiugliano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mgiugliano/32/5818_2.png) [@mgiugliano](https://discourse.julialang.org/u/mgiugliano)
#### Post date: [June 8, 2024, 9:21am UTC](https://discourse.julialang.org/t/packagecompiler-and-plots-jl-ld-warning-and-16kb-image/115312/3 "2024-06-08T09:21:15Z")

</div>

```julia
using PackageCompiler
create_sysimage(["Plots"], sysimage_path="sys_myimage.so", include_transitive_dependencies=false, precompile_execution_file="myfile.jl")

```

(note: with or w/o `include_transitive_dependencies=false` the result is the same)

with myfile.jl containing

```julia
using Plots

x = 1:10:100
y = sin.(x)

plot(x,y, show=true)

```

I even tried to add to the my file.jl the initial line `ENV["LD_LIBRARY_PATH"] = ""` but did not make any difference.

The resulting image is 16KB in size (i.e. suspiciously small) and `julia --sysimage ./sys_myimage.so` returns an error:

```Julia
ERROR: System image file failed consistency check: maybe opened the wrong version?

```

---

<div class="post-metadata">

### Author: ![mgiugliano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mgiugliano/32/5818_2.png) [@mgiugliano](https://discourse.julialang.org/u/mgiugliano)
#### Post date: [June 8, 2024, 10:53am UTC](https://discourse.julialang.org/t/packagecompiler-and-plots-jl-ld-warning-and-16kb-image/115312/4 "2024-06-08T10:53:59Z")

</div>

The exact same command does work, when run on a Google Colab [notebook](https://colab.research.google.com/drive/1RsJnSC6jtNJdPWSKyUjeM1EW9ql3-sFH?usp=sharing).
