Closed bolognam closed 1 month ago
Another choice is to modify the environment variables using withenv
only when dlopen
is called.
That would have to wrap around every function call, because they can dynamically trigger additional LoadLibrary
calls internally (which is exactly what engOpen
does - the dlopen actually succeeds)
I wonder if there is a less invasive approach as a bulk modification of the environment variable, as I think has the potential to corrupt other libraries.
I believe that AddDllDirectory
would be the primary alternative (https://github.com/jheinen/GR.jl/issues/489 seemed to tread similar ground)
However, those directories won't be seen by a LoadLibraryW
w/o flags like the one in MATLAB, which doesn't opt-in to the new search directories.
SetDefaultDllDir
does change the LoadLibraryW behavior to use the added paths, but it's broken for e.g. SuiteSparse in Julia unless changes are made to Julia's library loading behavior: https://github.com/JuliaLang/julia/pull/47775
@topolarity I think we should explore that option in another PR. For now I will merge this since it at least allows us to use MATLAB. @bolognam do you mind also updating the readme?
See issue #200 for more details, specifically: