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

UndefRefError in MAC OS Apple Silicon #195

Open
jinzhaohu opened this issue Dec 9, 2021 · 3 comments
Open

UndefRefError in MAC OS Apple Silicon #195

jinzhaohu opened this issue Dec 9, 2021 · 3 comments

Comments

@jinzhaohu
Copy link

Hi:

When I try to use this package, it keeps reminding me UndefRefError.

I have set ENV["MATLAB_HOME"]="/Applications/MATLAB_R2021b.app" in Julia and build MATLAB, but it didn't work.

Do you have any idea on how fix it?

THX!!

@GrantHecht
Copy link

I've run into this same issue as well. I expect it's due to running the native Apple Silicon version of Julia while attempting to use MATLAB which only currenrly supports x86 with Rosetta. Please note that I'm far from an expert on this topic so I may be compleately incorrect about this

I've gotten arround this issue by continuing to use Julia's x86 release for Mac when I need MATLAB interoperability.

@musm
Copy link
Collaborator

musm commented Jan 28, 2022

@GrantHecht are you also seeing the same problems as OP?

@GrantHecht
Copy link

GrantHecht commented Jan 31, 2022

@musm, I believe so. Here's a simple MWE with stack trace:

using MATLAB

mat"""
a = 1 + 2;
"""

ERROR: UndefRefError: access to undefined reference
Stacktrace:
 [1] MSession(bufsize::Int64; flags::String)
   @ MATLAB ~/.julia/packages/MATLAB/T20Ly/src/engine.jl:26
 [2] MSession (repeats 2 times)
   @ ~/.julia/packages/MATLAB/T20Ly/src/engine.jl:23 [inlined]
 [3] get_default_msession
   @ ~/.julia/packages/MATLAB/T20Ly/src/engine.jl:88 [inlined]
 [4] eval_string(stmt::String)
   @ MATLAB ~/.julia/packages/MATLAB/T20Ly/src/engine.jl:147
 [5] top-level scope
   @ ~/.julia/packages/MATLAB/T20Ly/src/matstr.jl:161

Note that this only occurs when using the ARM Julia release. I don't have any issues on my M1 Mac when using the x86 release through Rosetta.

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