Does MEX of MATLAB R2023b (update 6) on macOS-13 work with Xcode 15 and Intel oneAPI 2023?

22 次查看(过去 30 天)
[Update 20240217: 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.]
----------------------------------------------------------------------------------------------------------
Does MEX of MATLAB R2023b (update 6) work with Xcode 15.0 and Intel oneAPI 2023? It should according to
However, it does not work in the GitHub Actions workflow run at
It complains about undefined symbols, e.g., ___power4i8.
N.B.:
In particular, it has Xcode Command Line Tools 15.1.0.0.1.1700200546 with Clang/LLVM 15.0.0.
3. The testing code:
The above Fortran code pow.F 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:
Did anyone encounter the same problem?
  3 个评论
sol1ton
sol1ton 2024-3-5
I had some unrelated issues with clang after the xcode update. Adding -ld_classic to compiler options solved it, maybe it helps. Apparently there was some change in the linker or something, I don't remember anymore.
Zaikun Zhang
Zaikun Zhang 2024-3-7
Hi @sol1ton, thank you very much for your comment. I feel assured that I am not the only one encountering these problems.
You are right. Adding -ld_classic to compiler options would solve the problem. It can also be fixed by adding -undefined dynamic_lookup, which does not force MEX to use the old linker that is being deprecated. This has been done in my PRIMA project.
Despite the fixes, this is still a bug of MATLAB MEX --- the engineers at MathWorks forgot to revise the default linking options hardcoded in the mexopts file to accomodate the brand new linker of Xcode 15, while mistakenly claiming that MATLAB R2023b supports Xcode 15 since update 5.
Surely, the users can hack the compilation/link options in the undocumented ways mentioned above. However, this should not be the way that MATLAB works. It should work out of the box if the compiler has been set up according to the official documentation.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Write C Functions Callable from MATLAB (MEX Files) 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by