# Compiling a portable shared lib with PackageCompiler

**URL:** <https://discourse.julialang.org/t/compiling-a-portable-shared-lib-with-packagecompiler/45513>\
**Category:** General Usage\
**Created:** [August 25, 2020, 3:57pm UTC](https://discourse.julialang.org/t/compiling-a-portable-shared-lib-with-packagecompiler/45513 "2020-08-25T15:57:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [August 25, 2020, 3:57pm UTC](https://discourse.julialang.org/t/compiling-a-portable-shared-lib-with-packagecompiler/45513/1 "2020-08-25T15:57:34Z")

</div>

So, I’m in a situation at work where I’m trying to build a docker image to run on the “AWS Batch” service (it just runs docker containers), preferably with a compiled system image from PackageCompiler.

My docker images always work just fine locally, but when I try running on AWS I always get

```julia
ERROR: Unable to find compatible target in system image.

```

I’ve tried running my PackageCompiler compilation script with `julia -Cgeneric compile.jl` and very much to my surprise, I still get the same error with this.

Has anyone ever run into an analogous problem? Any suggestions?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [August 25, 2020, 4:09pm UTC](https://discourse.julialang.org/t/compiling-a-portable-shared-lib-with-packagecompiler/45513/2 "2020-08-25T16:09:38Z")

</div>

> [@ExpandingMan](#):
>
> I’ve tried running my PackageCompiler compilation script with `julia -Cgeneric compile.jl` and very much to my surprise, I still get the same error with this.

What does that mean? Do you pass the `cpu_target` to PackageCompiler when you create the sysimage?

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [August 25, 2020, 4:17pm UTC](https://discourse.julialang.org/t/compiling-a-portable-shared-lib-with-packagecompiler/45513/3 "2020-08-25T16:17:27Z")

</div>

Wow, I’m such an idiot.

I didn’t realize that PackageCompiler had a separate option, I thought it was inheriting it from the Julia run-time.

A couple of us got ourselves really confused about this on slack I think.

Yeah, haven’t been able to test on AWS yet, but I found a machine I couldn’t run the older binaries on, so hopefully that was it, thanks!
