# PackageCompile system image for different computers

**URL:** <https://discourse.julialang.org/t/packagecompile-system-image-for-different-computers/47319>\
**Category:** New to Julia\
**Created:** [September 26, 2020, 3:14pm UTC](https://discourse.julialang.org/t/packagecompile-system-image-for-different-computers/47319 "2020-09-26T15:14:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tp2750](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tp2750/32/207806_2.png) [@tp2750](https://discourse.julialang.org/u/tp2750)\
**Post date:** [September 26, 2020, 3:14pm UTC](https://discourse.julialang.org/t/packagecompile-system-image-for-different-computers/47319/1 "2020-09-26T15:14:48Z")

</div>

I’ll like to compile a system image that I can use on our in-house compute cluster.

My problem is that the image I build on one computer, will not load on an other.

I have build a system image on my laptop using this command:

```julia
julia> create_sysimage(:Revise, sysimage_path="sys_1.5.0.so")
[ Info: PackageCompiler: creating system image object file, this might take a while...
julia> versioninfo()
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

```

The image loads fine on this machine.

Then I try to load it on a broadwell Xeon server:

```julia
julia> versioninfo()
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2687W v4 @ 3.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, broadwell)

```

and it fails:

```julia
$ julia -Jsys_1.5.0.so
ERROR: Unable to find compatible target in system image.
$ ls -l sys_1.5.0.so
-rwxrwxr-x 1 tp datashare 160964776 Aug 17 14:35 sys_1.5.0.so

```

Is there a way to build a “generic” system image that will run on any Linux x86\_64 machine (like the original julia image I download from [julialang.org](http://julialang.org))?

---

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [September 26, 2020, 10:33pm UTC](https://discourse.julialang.org/t/packagecompile-system-image-for-different-computers/47319/2 "2020-09-26T22:33:34Z")

</div>

related thread:

> [@Sysimage incompatible between Intel and AMD x86\_64?](https://discourse.julialang.org/t/sysimage-incompatible-between-intel-and-amd-x86-64/42716):
>
> I’m using PackageCompiler to provide colleagues with a batteries included package (Julia + pre-compiled Julia code) that they just unzip and run. This process worked perfectly so far for Intel based computers. Trying to run the package on a computer with AMD processor throws the error ERROR: Unable to find compatible target in system image. Julia is started like this: julia.exe -J "path\to\sysimage.dll". Is this to be expected? sysimage.dll is compiled on an Intel i5-8265U. The error occurs o…

TLDR: something like this should give you the same kind of portability as official julia images:

```julia
create_sysimage(..., cpu_target="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)")

```

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [September 27, 2020, 5:02am UTC](https://discourse.julialang.org/t/packagecompile-system-image-for-different-computers/47319/3 "2020-09-27T05:02:46Z")

</div>

I am going to be provocative here - not rude I stress.  
Why not build an optimised image for your in house cluster? You know the architecture there and surely you want the best performance?  
Don’t worry - I do understand why a generic sysimage is useful.  
This discussion arises often in the case of containerised/cloud computing versus ‘traditional’ HPC. the traditional HPC guys optimise to squeeze the last bit of performance out.  
The cloud side are concerned with getting things running and are less concerned with the last few percentages of performance.

---

<div class="post-metadata">

**Author:** ![tp2750](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tp2750/32/207806_2.png) [@tp2750](https://discourse.julialang.org/u/tp2750)\
**Post date:** [September 27, 2020, 10:07am UTC](https://discourse.julialang.org/t/packagecompile-system-image-for-different-computers/47319/4 "2020-09-27T10:07:34Z")

</div>

Thanks for the suggestions, @ffevotte. I’ll try it out.

---

<div class="post-metadata">

**Author:** ![tp2750](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tp2750/32/207806_2.png) [@tp2750](https://discourse.julialang.org/u/tp2750)\
**Post date:** [September 27, 2020, 10:21am UTC](https://discourse.julialang.org/t/packagecompile-system-image-for-different-computers/47319/5 "2020-09-27T10:21:39Z")

</div>

Thanks for the comments @johnh.

It is quite possible I’m doing it wrong 🙂

Our cluster is rather heterogeneous consisting of machines added over several years. So I can not assume a single CPU type.

It is also out of convenience: my workstation has internet access, display etc, so it is a more convenient environment for building the image, than a cluster node.

---

<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:** [September 27, 2020, 6:48pm UTC](https://discourse.julialang.org/t/packagecompile-system-image-for-different-computers/47319/6 "2020-09-27T18:48:58Z")

</div>

See [System Image Building · The Julia Language](https://docs.julialang.org/en/v1/devdocs/sysimg/#Specifying-multiple-system-image-targets) for some discussion of targets.

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [September 27, 2020, 7:39pm UTC](https://discourse.julialang.org/t/packagecompile-system-image-for-different-computers/47319/7 "2020-09-27T19:39:01Z")

</div>

@tp2750 Understood!
