Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MATLAB.jl seems working fine with MATLAB R2023b on macOS #223

Open
wsshin opened this issue Mar 1, 2024 · 3 comments
Open

MATLAB.jl seems working fine with MATLAB R2023b on macOS #223

wsshin opened this issue Mar 1, 2024 · 3 comments

Comments

@wsshin
Copy link

wsshin commented Mar 1, 2024

It seems that we will need to change the warning message in README.md about the MATLAB.jl package's incompatibility with the up-to-date MATLAB versions, at least for macOS running on Macs equipped with M-chips (a.k.a. Apple silicon).

For MATLAB R2023b, MathWorks released a version native to Apple silicon. Today I was able to install it on my MacBook Pro with an M3 Max chip, and it seems working fine with the MATLAB.jl package. I have verified this by running several examples in README.md. For example,

julia> VERSION
v"1.10.1"

(@v1.10) pkg> st MATLAB
Status `~/.julia/environments/v1.10/Project.toml`
  [10e44e05] MATLAB v0.8.4 `~/code/MATLAB`

julia> using MATLAB

julia> x = -10.0:0.1:10.0
-10.0:0.1:10.0

julia> y = -10.0:0.1:10.0
-10.0:0.1:10.0

julia> xx, yy = mxcall(:meshgrid, 2, x, y)
([-10.0 -9.9 … 9.9 10.0; -10.0 -9.9 … 9.9 10.0; … ; -10.0 -9.9 … 9.9 10.0; -10.0 -9.9 … 9.9 10.0], [-10.0 -10.0 … -10.0 -10.0; -9.9 -9.9 … -9.9 -9.9; … ; 9.9 9.9 … 9.9 9.9; 10.0 10.0 … 10.0 10.0])

If there are any specific corner cases that concern the developers of this package in claiming the compatibility, I can test them, so please poset the code is this thread.

@bolognam
Copy link
Contributor

I have not tried to delve into this, but quickly trying to ]add MATLAB on a non-native MATLAB 2024a install on an M1 Max chip for Julia v1.10.4:

ERROR: Error building `MATLAB`: 
[ Info: Detected MATLAB root folder at "/Applications/MATLAB_R2024a.app"
[ Info: Detected MATLAB executable at "/Applications/MATLAB_R2024a.app/bin/matlab"
ERROR: LoadError: could not load library "/Applications/MATLAB_R2024a.app/bin/maca64/libmx"
dlopen(/Applications/MATLAB_R2024a.app/bin/maca64/libmx.dylib, 0x0001): tried: '/Applications/MATLAB_R2024a.app/bin/maca64/libmx.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/MATLAB_R2024a.app/bin/maca64/libmx.dylib' (no such file), '/Applications/MATLAB_R2024a.app/bin/maca64/libmx.dylib' (no such file)
Stacktrace:
 [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
   @ Base.Libc.Libdl ./libdl.jl:117
 [2] dlopen (repeats 2 times)
   @ ./libdl.jl:116 [inlined]
 [3] dlpath(libname::String)
   @ Base.Libc.Libdl ./libdl.jl:240
 [4] top-level scope
   @ ~/.julia/dev/MATLAB/deps/build.jl:81
 [5] include(fname::String)
   @ Base.MainInclude ./client.jl:489
 [6] top-level scope
   @ none:5
in expression starting at /Users/mbologna/.julia/dev/MATLAB/deps/build.jl:78

When I have more time, I would like to dig into this.

@wsshin
Copy link
Author

wsshin commented Jun 14, 2024

Yes, I confirm that MATLAB.jl works with MATLAB 2023 on Apple Silicon only if you use MATLAB native to Apple Silicon. If you use MATLAB built for Intel CPUs and run it via Rosetta on Apple Silicon, MATLAB.jl doesn't work.

@hstrey
Copy link

hstrey commented Sep 25, 2024

It also works with MATLAB 2024a on Apple Silicon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants