JuliaLang / PackageCompiler.jl

Compile your Julia Package
https://julialang.github.io/PackageCompiler.jl/dev/
MIT License
1.41k stars 189 forks source link

InitError in Windows11 virtual machine on Windows10 #833

Open jsjie opened 1 year ago

jsjie commented 1 year ago

A MWE:

module SelfTest

using MKL

# Write your package code here.

function julia_main()::Cint
    println("wow")
    return 0
end

end

Compiled on a Windows11 machine, with

julia> versioninfo()
Julia Version 1.9.0
Commit 8e63055292 (2023-05-07 11:25 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 16 virtual cores
Environment:
  JULIA_PKG_SERVER = https://mirrors.tuna.tsinghua.edu.cn/julia
  JULIA_PKG_USE_CLI_GIT = true

Compiled binary was sent to a Windows 10 machine, with a Windows11 virtual machine on it. The virtual machine is Windows 11 Professional, 22621.1778.

Try to run the compiled binary in the virtual machine results in the following error:

fatal: error thrown and no exception handler available.
InitError(mod=:IntelOpenMP_jll, error=ErrorException("could not load library "C:\Users\Administrator\win01\share\julia\artifacts\350e71568ca7eb29f07862d75216c6bb9f91398e\bin\libiomp5md.dll"
The specified module could not be found. "))
jl_errorf at /cygdrive/c/buildbot/worker/package_win64/build/src\rtutils.c:77
jl_load_dynamic_library at /cygdrive/c/buildbot/worker/package_win64/build/src\dlload.c:284
#dlopen#3 at .\libdl.jl:117
dlopen at .\libdl.jl:117
unknown function (ip: 000000001110e455)
macro expansion at C:\Users\DELL\.julia\packages\JLLWrappers\QpMQW\src\products\library_generators.jl:54 [inlined]
__init__ at C:\Users\DELL\.julia\packages\IntelOpenMP_jll\1Rfuy\src\wrappers\x86_64-w64-mingw32.jl:8
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\Administrator\win01\bin\SelfTest.exe (unknown line)
__tmainCRTStartup at C:\Users\Administrator\win01\bin\SelfTest.exe (unknown line)
.l_start at C:\Users\Administrator\win01\bin\SelfTest.exe (unknown line)
BaseThreadInitThunk at C:\Windows\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\Windows\SYSTEM32\ntdll.dll (unknown line)
svilupp commented 11 months ago

I see this error on Julia 1.10 beta3 on linux when trying to build a sysimage

jsjie commented 9 months ago

I see this error on Julia 1.10 beta3 on linux when trying to build a sysimage

I have find a possible reason, which has nothing to do with PackageCompiler. Check my post on julia discourse.

KristofferC commented 9 months ago
InitError(mod=:IntelOpenMP_jll, error=ErrorException("could not load library "C:\Users\Administrator\win01\share\julia\artifacts\350e71568ca7eb29f07862d75216c6bb9f91398e\bin\libiomp5md.dll"
The specified module could not be found. "))

Usually means that there is some symbol in some dependent library that is not found. I've found that using https://github.com/lucasg/Dependencies is a decent way to find the missing symbol and what library is being problematic.