# Application does not load all artifacts during compilation

**URL:** <https://discourse.julialang.org/t/application-does-not-load-all-artifacts-during-compilation/82493>\
**Category:** General Usage\
**Tags:** package-compiler, app\
**Created:** [June 9, 2022, 11:46am UTC](https://discourse.julialang.org/t/application-does-not-load-all-artifacts-during-compilation/82493 "2022-06-09T11:46:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Post date:** [June 9, 2022, 11:46am UTC](https://discourse.julialang.org/t/application-does-not-load-all-artifacts-during-compilation/82493/1 "2022-06-09T11:46:14Z")

</div>

I’m currently trying to compile an app using `PackageCompiler`. The associated project `App` depends on two packages `Foo` and `Bar`.  
`Foo` itself depends on `MKL` which depends on `MKL_jll` (which are present in the `Manifest.toml` of `App`)

My current compilation is performed using

```julia
create_app(<package_dir>,<exebinpath>; precompile_execution_file=<pspath>,incremental = true, cpu_target="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)", include_lazy_artifacts=true, include_transitive_dependencies = true)

```

Where the different path point to the correct targets.  
Given that `include_lazy artifacts = true` and `include_transitive_dependencies = true` I’d thought that the executable produced by the compilation would have been portable (to a machine with the same OS and architecture).  
However, whenever I try to run the application on the other machine, the first thing julia tries to do is to download `MKL`. The problem is that this machine cannot be connected to internet so it fails on the download.

It there a way to ensure that all dependencies / artifacts are loaded ? Why does `include_lazy_artifacts` not handle this ?

I’m working on this configuration

> Julia Version 1.7.3  
> Commit 742b9abb4d (2022-05-06 12:58 UTC)  
> Platform Info:  
> OS: Windows (x86\_64-w64-mingw32)  
> CPU: 11th Gen Intel(R) Core™ i7-1185G7 @ 3.00GHz  
> WORD\_SIZE: 64  
> LIBM: libopenlibm  
> LLVM: libLLVM-12.0.1 (ORCJIT, tigerlake)  
> Environment:  
> JULIA\_EDITOR = code  
> JULIA\_NUM\_THREADS = 1

---

<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:** [June 9, 2022, 12:57pm UTC](https://discourse.julialang.org/t/application-does-not-load-all-artifacts-during-compilation/82493/2 "2022-06-09T12:57:55Z")

</div>

Sounds like [PackageCompiler does not download artifacts for MKL now · Issue #691 · JuliaLang/PackageCompiler.jl · GitHub](https://github.com/JuliaLang/PackageCompiler.jl/issues/691). I’ll look at it.

---

<div class="post-metadata">

**Author:** ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Post date:** [June 9, 2022, 4:36pm UTC](https://discourse.julialang.org/t/application-does-not-load-all-artifacts-during-compilation/82493/3 "2022-06-09T16:36:41Z")

</div>

I just tested with v2.0.5 of `PackageCompiler` and the app doesn’t try to download artifacts, and weighs much more ( MKL ! ).

---

<div class="post-metadata">

**Author:** ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Post date:** [June 9, 2022, 4:52pm UTC](https://discourse.julialang.org/t/application-does-not-load-all-artifacts-during-compilation/82493/4 "2022-06-09T16:52:17Z")

</div>

Just for the record, I asked a somewhat related question [here](https://discourse.julialang.org/t/application-compilation-does-not-account-for-required-code/82515) if you have a suggestion. I preferred to split it in order to be able to focus on the two subjects separately.

---

<div class="post-metadata">

**Author:** ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Post date:** [June 10, 2022, 11:52am UTC](https://discourse.julialang.org/t/application-does-not-load-all-artifacts-during-compilation/82493/5 "2022-06-10T11:52:50Z")

</div>

Side note, If I try to create a sysimage rather than an app I get this error (with 2.0.5 and 2.0.6).  
Is it due to the general non-relocatability of the sysimages or is is becaus the HDF5 artifact is not correctly handled ?

> D:\admin\Desktop\>julia -J sysimage.dll  
> fatal: error thrown and no exception handler available.  
> InitError(mod=:HDF5\_jll, error=ErrorException(“Artifact “HDF5” was not installed correctly. Try `using Pkg; Pkg.instantiate()` to re-install all missing resources.”))  
> error at .\error.jl:33  
> \_artifact\_str at C:\buildbot\worker\package\_win64\build\usr\share\julia\stdlib\v1.7\Artifacts\src\Artifacts.jl:551  
> jfptr\_\_artifact\_str\_84373 at D:\admin\Desktop\sysimage.dll (unknown line)  
> jl\_apply at /cygdrive/c/buildbot/worker/package\_win64/build/src\julia.h:1788 [inlined]  
> jl\_f\_\_call\_latest at /cygdrive/c/buildbot/worker/package\_win64/build/src\builtins.c:757  
> jl\_apply at /cygdrive/c/buildbot/worker/package\_win64/build/src\julia.h:1788 [inlined]  
> do\_apply at /cygdrive/c/buildbot/worker/package\_win64/build/src\builtins.c:713  
> #invokelatest#2 at .\essentials.jl:716  
> jl\_apply at /cygdrive/c/buildbot/worker/package\_win64/build/src\julia.h:1788 [inlined]  
> do\_apply at /cygdrive/c/buildbot/worker/package\_win64/build/src\builtins.c:713  
> invokelatest at .\essentials.jl:714  
> jl\_apply at /cygdrive/c/buildbot/worker/package\_win64/build/src\julia.h:1788 [inlined]  
> do\_call at /cygdrive/c/buildbot/worker/package\_win64/build/src\interpreter.c:126  
> eval\_value at /cygdrive/c/buildbot/worker/package\_win64/build/src\interpreter.c:215  
> eval\_stmt\_value at /cygdrive/c/buildbot/worker/package\_win64/build/src\interpreter.c:166 [inlined]  
> eval\_body at /cygdrive/c/buildbot/worker/package\_win64/build/src\interpreter.c:587  
> jl\_fptr\_interpret\_call at /cygdrive/c/buildbot/worker/package\_win64/build/src\interpreter.c:675  
> macro expansion at C:\buildbot\worker\package\_win64\build\usr\share\julia\stdlib\v1.7\Artifacts\src\Artifacts.jl:680 [inlined]  
> find\_artifact\_dir at D:\admin.julia\packages\JLLWrappers\QpMQW\src\wrapper\_generators.jl:17  
> **init** at D:\admin.julia\packages\HDF5\_jll\5jwlp\src\wrappers\x86\_64-w64-mingw32.jl:11  
> jl\_apply at /cygdrive/c/buildbot/worker/package\_win64/build/src\julia.h:1788 [inlined]  
> jl\_module\_run\_initializer at /cygdrive/c/buildbot/worker/package\_win64/build/src\toplevel.c:73  
> \_finish\_julia\_init at /cygdrive/c/buildbot/worker/package\_win64/build/src\init.c:796  
> jl\_repl\_entrypoint at /cygdrive/c/buildbot/worker/package\_win64/build/src\jlapi.c:695  
> mainCRTStartup at /cygdrive/c/buildbot/worker/package\_win64/build/cli\loader\_exe.c:42  
> BaseThreadInitThunk at C:\windows\System32\KERNEL32.DLL (unknown line)  
> RtlUserThreadStart at C:\windows\SYSTEM32\ntdll.dll (unknown line)
