matlab-actions / setup-matlab

Set up your GitHub Actions workflow with a specific version of MATLAB.
BSD 3-Clause "New" or "Revised" License
77 stars 12 forks source link

MEX of MATLAB R2023b provided by `setup-matlab@v2` does not work with Xcode 15 and Intel oneAPI 2023 #96

Closed zaikunzhang closed 9 months ago

zaikunzhang commented 9 months ago

Hi @mcafaro ,

I am not sure whether this is an issue with MEX of MATLAB R2023b or with setup-matlab@v2.

MEX of MATLAB R2023b (update 6 as of Feb 15, 2024) provided by setup-matlab@v2 does not work with Xcode 15.0 and Intel oneAPI 2023, but it should according to https://www.mathworks.com/support/requirements/supported-compilers-mac.html.

See the workflow run at https://github.com/zequipe/test_matlab/actions/runs/7910874522/job/21594149098. It complains about undefined symbols, e.g., ___power4i8.

N.B.:

  1. For the configurations of the macOS-13 runner, see https://github.com/actions/runner-images/blob/macos-13/20240204.1/images/macos/macos-13-Readme.md. In particular, it has Xcode Command Line Tools 15.1.0.0.1.1700200546 with Clang/LLVM 15.0.0.

  2. The version of Intel oneAPI is 2023, which is installed by https://github.com/equipez/github_actions_scripts/blob/de1b45b9fd667a9fe42cd7d5ecec4318f60d9117/install_oneapi_macos.sh

  3. The testing code: https://github.com/zequipe/test_matlab/actions/runs/7910874522/workflow https://github.com/zequipe/test_matlab/blob/master/test_mac/test_pow.m https://github.com/zequipe/test_matlab/blob/master/test_mac/pow.F The Fortran code is a modification of the official timestwo.F. It is modified to calculate the power $x^{[x]}$.

  4. It does not work with oneAPI 2022 either. However, oneAPI 2021 is fine: https://github.com/zequipe/test_matlab/actions/runs/7910874522/job/21594149278 https://github.com/zequipe/test_matlab/actions/runs/7910874522/job/21594149356

Thank you for taking a look.

Best regards, Zaikun

zaikunzhang commented 9 months ago

I am almost sure that this is a bug of MATLAB R2023b.

The default MEX options are wrongly specified. They are incompatible with the new linker in Xcode 15.

See my GitHub repo for the fix.

See PRIMA for more explanations.

mcafaro commented 9 months ago

Hi @zaikunzhang, thank you for the detailed report. I will inform the MEX team and have them take a look.

zaikunzhang commented 9 months ago

Hi @zaikunzhang, thank you for the detailed report. I will inform the MEX team and have them take a look.

Thank you very much @mcafaro . I have indeed submitted a bug report (ref 06811363) to MathWorks but received no response after two days ...

zaikunzhang commented 9 months ago

Hi @mcafaro ,

Have your MEX colleagues provided any updates? My bug report has not been answered.

Indeed, I do not need a fix, because I know how to fix it ( https://github.com/zequipe/test_matlab/blob/master/test_mac/test_pow.m ). I only need them to confirm that

If this is confirmed, then my fix above is sufficient for my project.

Many thanks.

Best regards, Zaikun

zaikunzhang commented 9 months ago

Any update from the mex team about this problem ? Thank you.

mcafaro commented 9 months ago

The MEX team informed me that they are currently working with you through another channel (perhaps your bug report?). Have they been in touch with you?

zaikunzhang commented 9 months ago

Hi @mcafaro ,

Yes, but it has been an extremely slow and frustrating communication, since everything is forwarded through a MATLAB support person in China. Being a nice person, he does not know MEX, Fortran, github, or Mac. In addition, there is a time difference of 12 hours between him and the MEX team in the US. You can imagine how efficient the process would be.

Could by any chance the MEX team respond to this issue here?

Many thanks, Zaikun

zaikunzhang commented 9 months ago

As mentioned, I do not need a fix, because I know why the error occurs and how to fix it. See

https://github.com/libprima/prima/blob/27b4771b31a32dd00fed9745f340b18d838d7a48/matlab/setup_tools/compile.m#L97-L106

https://github.com/zequipe/test_matlab/blob/master/test_mac/test_pow.m

I only need them to confirm that

If this is confirmed, then my fix above is sufficient for my project.

mcafaro commented 9 months ago

@zaikunzhang I understand. However because this is an issue with MEX and not setup-matlab, there is a preference to continue to work through the traditional support channels, sorry. I am closing this issue for now in favor of allowing that process to play out. Feel free to reopen if it becomes apparent that setup-matlab is part of the issue.

zaikunzhang commented 7 months ago

Update: the issue remains in MATLAB R2024a. Fortunately, your colleague @srirams1987 is investigating this issue.