-
Notifications
You must be signed in to change notification settings - Fork 33
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/Paramonte fails to run on M1 Apple... #47
Comments
@arwelHughes, Can you check if any export Matlab_ROOT_DIR="path to the matlab root directory, like: /Applications/MATLAB_R2024a"
export matlab="path to the MATLAB executable, like: /Applications/MATLAB_R2024a/bin/matlab" Then retry the build command:
Let me know if this works. Thanks. |
Can you confirm if you are not running the build script in Rosetta compatibility mode with the Intel chip? |
I'm trying to run it from the native Apple Silicon version of R2023b on an M1 mac, so there should be no Rosetta involved. In other words this release expects mexmaca64, and it won't recognise mexmaci64. So by the sounds of it the build is running in Rosetta compatability mode when it shouldn't be, and I need to set a flag somewhere? |
Could you try this in Rosetta compatibility mode and see if it works there? I have never used Rosetta compatibility mode, and I will not know what may be causing it until I test it again in M1. @theoneineed, do you know what may be causing this GitHub issue? |
"Could you try this in Rosetta compatibility mode...." - I'm not clear what you mean.. is this a build setting / flag?? |
@shahmoradi I just did a fresh install on my system with cloned repository and it looks like I am getting the same error as @arwelHughes . When comparing the two folders(one generated now, and one that I had from couple weeks back, when it was working), this is the message I see. My installation process was same as the last time. I also installed it native to Apple Silicon without using rosetta. I have attached a zipped folder here with the version of pm that works for me ( https://drive.google.com/file/d/1lkPsm7Gn4R-XuUlbnoK6VJ-TrNyAltAB/view?usp=share_link ) |
@arwelHughes @theoneineed I just rebuilt the library from a clone of the latest version of th elibrry on GitHub on a macOS M2, and both serial and openmp versions seem to work fine, passing all tests. @arwelHughes Can you ensure matlab path is specified in your echo $PATH in your terminal. To be safe, you can try this command before rerunning the build script, export PATH=/Applications/MATLAB_R2023b.app/bin:$PATH assuming your MATLAB version is R2023b. ./install.sh --lang matlab --par serial Note that the example script for Himmelblau function searches for serial version of the library. To use the openmp version, you need to change the line, |
Thanks Amir, I will try this when I get to work. But just to be clear, on your M2 mac, are you running the Native Apple Silicon version of Matlab (https://uk.mathworks.com/support/requirements/apple-silicon.html), or the Rosetta Intel emulated one (see the comment at the end of the above link). The former expects mex files to be *.maci64 and the latter expects *.maca64, and they are not compatible - the build I tried made the Intel binaries... |
It's all for M2, both matlab and the build. I am traveling at the moment. I will test it also with an M1 once I am back later today. Given the complexity of the issue, I'd say build all your tests for the default case (serial as opposed to openmp) and run the tests. When I built the library for openmp, I got a similar error to yours for the first time (although the library names were correct) because the example expected to find the serial versions of the library because of the value set for |
@arwelHughes I have added a MATLAB arm64 pre-built package to the latest pre-release of the library on GitHub. While searching for the root cause of the error in this issue, please try the newly uploaded package and let us know if it also works for you. I have tested the package on both M1 and M2 ARM chips, and it seems to work fine. Here is the download instruction:
Let us know if this temporary solution works. Note that some of the visualization functionalities (e.g., Corner plots) are not fully implemented yet. |
Yes - that worked. Thanks! |
I cloned the toolbox from Github, and tried to build the toolbox as:
./install.sh --lang MATLAB --build release --par omp
Then, I added the folder containing the '+new' folder to the Matlab path and saved.
Navigated to '/example/matlab/sampling/Paradram', and tried to run 'main.m', but received the following error:
libspecs =
"darwin" "arm64" "shared" "heap" "serial"
bldtypes =
"native" "tuned" "ipo" "release" "testing" "debug"
clstypes =
"intel" "gnu"
Error using pm.sampling.Sampler/run
There are no MEX libraries associated with the configurations displayed above:
Either the user has compromised internal structure of the ParaMonte library
or the user has tempered with hidden attributes of the ParaMonte sampler.
If you believe neither is the case, please report this error at:
for a quick resolution.
Error in pm.sampling.Paradram/run (line 49)
[email protected](self, getLogFunc, ndim);
Error in main (line 12)
sampler.run ( @(x) pm.stats.dist.himmelblau.getLogUDF(x(1), x(2)) ...
The text was updated successfully, but these errors were encountered: