I met something like
ERROR: LoadError: InitError: could not load library "${USER}\.julia\artifacts\${SHA}\bin\libiomp5md.dll"
The specified module could not be found.
But the file is just there. Strangely, another PC is fine.
After some digging, I find the actual reason. libiomp5md
need C:\WINDOWS\system32\VCRUNTIME140.dll
as its dependency, which is missing in one of my PCs.
Such problems are annoying, there might be two ways to handle this.
One is to have more clear error message for such failure. Sadly, it seems impossible, because dlopen will directly call C function jl_load_dynamic_library
, and there might be no way to know about the real cause.
Another is to prevent such problems from the beginning. It seems that VCRUNTIME140
are part of Microsoft Visual C++ 2015 Redistributable
or something similar, which is one of the so-so-many run-time library-collections MS offers.
If I understand it correctly, such dependencies are related to the environment in which the artifact is compiled. To make it clear, they are related to what run-time library-collections you use when compiling.
If we can decide a common Windows environment where every Julia artifact works, something like manylinux
in python community, then users only need to make sure their PC have the required dependencies to be sure that everything works.
I know that such run-time libraries are in a total mess in the whole Windows ecosystem, but maybe we the Julia community can do something on our own?