MATLAB.jl icon indicating copy to clipboard operation
MATLAB.jl copied to clipboard

filepaths for Window

Open jacob-roth opened this issue 2 years ago • 3 comments

Based on my comment here, I would like to point out that the filepath conventions as used by MATLAB.jl don't really seem to work with Windows. I had to manually hardcode a few places: build.jl:

libmx_size = filesize(Libdl.dlpath(joinpath(matlab_libpath, "libmx")))
function check_deps()
  if libmx_size != filesize(Libdl.dlpath("C:\\\\Program Files\\\\MATLAB\\\\R2020b\\\\bin\\\\win64\\\\libmx.dll")) #! JR
    error("MATLAB library has changed, re-run Pkg.build(\\\"MATLAB\\\")")
  end
end

MATLAB.jl

libmx_loc = "C:\\Program Files\\MATLAB\\R2020b\\bin\\win64\\libmx.dll"
libmat_loc = "C:\\Program Files\\MATLAB\\R2020b\\bin\\win64\\libmat.dll"
libeng_loc = "C:\\Program Files\\MATLAB\\R2020b\\bin\\win64\\libeng.dll"

I just needed a quick fix, and this seemed to work for me.

jacob-roth avatar Oct 19 '23 22:10 jacob-roth

Hmm interesting, so MATLAB builds and the test suite runs fine?

The error that I am having is related to the library crashing. In other words, it's actually finding all the library paths correctly (I double checked) but when it tries to load them we have a crash

musm avatar Oct 20 '23 20:10 musm

Now it seems to be having issues... Is there any support for what to do when I receive the following error?

┌ Warning: Confirm MATLAB is installed and discoverable.
└ @ MATLAB C:\Users\roth0674\.julia\packages\MATLAB\5RUjq\src\engine.jl:28
┌ Warning: Ensure `matlab -regserver` has been run in a Command Prompt as Administrator.
└ @ MATLAB C:\Users\roth0674\.julia\packages\MATLAB\5RUjq\src\engine.jl:30
ERROR: LoadError: MATLAB.MEngineError("failed to open MATLAB engine session")

jacob-roth avatar Jan 19 '24 21:01 jacob-roth

Hmm interesting, so MATLAB builds and the test suite runs fine?

The error that I am having is related to the library crashing. In other words, it's actually finding all the library paths correctly (I double checked) but when it tries to load them we have a crash

Yes, everything seemed to be fine with this approach at one point. Now having more issues...

jacob-roth avatar Jan 19 '24 21:01 jacob-roth