# Error with MKL artifact when running app built through PackageCompiler.jl

**URL:** <https://discourse.julialang.org/t/error-with-mkl-artifact-when-running-app-built-through-packagecompiler-jl/98847>\
**Category:** General Usage\
**Tags:** mkl, package-compiler, artifacts, app\
**Created:** [May 14, 2023, 9:02pm UTC](https://discourse.julialang.org/t/error-with-mkl-artifact-when-running-app-built-through-packagecompiler-jl/98847 "2023-05-14T21:02:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![heyx3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heyx3/32/29811_2.png) [@heyx3](https://discourse.julialang.org/u/heyx3)\
**Post date:** [May 14, 2023, 9:02pm UTC](https://discourse.julialang.org/t/error-with-mkl-artifact-when-running-app-built-through-packagecompiler-jl/98847/1 "2023-05-14T21:02:29Z")

</div>

I’m experimenting with building my Julia application into an executable using PackageCompiler.jl. The build process seems to go just fine, but when I run the executable, it tries twice to “download artifact: MKL”, appears to succeed, then hard-crashes with the message “Unable to automatically install ‘MKL’ from ‘C:\Users\manni.julia\packages\MKL\_jll\kG4RZ\Artifacts.toml’”.

I’m using Julia 1.7.2.

Here is the log from calling `PackageCompiler.create_app()`:

```julia
PackageCompiler: bundled artifacts:
  ├── CImGuiPack_jll - 5.619 MiB
  ├── CImGui_jll - 3.571 MiB
  ├── Clang_jll - 284.799 MiB
  ├── FFTW_jll - 7.222 MiB
  ├── GLFW_jll - 710.488 KiB
  ├── Ghostscript_jll - 31.649 MiB
  ├── ImageMagick_jll - 25.680 MiB
  ├── Imath_jll - 1.005 MiB
  ├── IntelOpenMP_jll - 5.973 MiB
  ├── JpegTurbo_jll - 4.820 MiB
  ├── Libgcrypt_jll - 6.433 MiB
  ├── Libgpg_error_jll - 2.227 MiB
  ├── Libiconv_jll - 2.245 MiB
  ├── Libtiff_jll - 9.689 MiB
  ├── OpenEXR_jll - 10.481 MiB
  ├── OpenSpecFun_jll - 798.680 KiB
  ├── XML2_jll - 7.444 MiB
  ├── XSLT_jll - 2.226 MiB
  ├── Zstd_jll - 3.968 MiB
  ├── libpng_jll - 1.714 MiB
  └── libsixel_jll - 2.996 MiB
  Total artifact file size: 421.233 MiB
✔ [04m:32s] PackageCompiler: compiling incremental system image

```

And the output when running the executable:"

```julia
  Downloaded artifact: MKL
  Downloaded artifact: MKL
fatal: error thrown and no exception handler available.
InitError(mod=:MKL_jll, error=ErrorException("Unable to automatically install 'MKL' from 'C:\Users\manni\.julia\packages\MKL_jll\kG4RZ\Artifacts.toml'"))
error at .\error.jl:33
#ensure_artifact_installed#23 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Pkg\src\Artifacts.jl:441
ensure_artifact_installed##kw at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Pkg\src\Artifacts.jl:413
unknown function (ip: 0000000061c34cfc)
#ensure_artifact_installed#22 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Pkg\src\Artifacts.jl:404
unknown function (ip: 0000000061c343dc)
ensure_artifact_installed##kw at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Pkg\src\Artifacts.jl:399
unknown function (ip: 0000000061c34118)
_artifact_str at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Artifacts\src\Artifacts.jl:547
jfptr__artifact_str_66814 at C:\Users\manni\Documents\Code\BpWorld\build\VoxelToy\lib\julia\sys.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 C:\Users\manni\.julia\packages\JLLWrappers\RYztT\src\wrapper_generators.jl:17
__init__ at C:\Users\manni\.julia\packages\MKL_jll\kG4RZ\src\wrappers\x86_64-w64-mingw32.jl:9
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_init_with_image at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:74 [inlined]
jl_init_with_image at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:63 [inlined]
jl_init at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:90
.text at C:\Users\manni\Documents\Code\BpWorld\build\VoxelToy\bin\BpWorld.exe (unknown line) 
__tmainCRTStartup at C:\Users\manni\Documents\Code\BpWorld\build\VoxelToy\bin\BpWorld.exe (unknown line)
.l_start at C:\Users\manni\Documents\Code\BpWorld\build\VoxelToy\bin\BpWorld.exe (unknown line)
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)

```

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [May 14, 2023, 9:42pm UTC](https://discourse.julialang.org/t/error-with-mkl-artifact-when-running-app-built-through-packagecompiler-jl/98847/2 "2023-05-14T21:42:33Z")

</div>

You hit this issue: [Lazy downloading artifacts with custom sysimage · Issue #639 · JuliaLang/PackageCompiler.jl · GitHub](https://github.com/JuliaLang/PackageCompiler.jl/issues/639)  
You can find a workaround in the discussion.
