Error "File is not a MEX file" on Arch Linux

Hello!
I am trying to build a MEX file form a cpp code, but I always get the error "file.mexa64 is not a MEX file". This happens also with any c file (I tried with the timestwo.c example).
The only related information on the helper is about MEX Platform Compatibility, but the extension mexa64 is the correct one for my os.
I am running Matlab r2020a on Manjaro OS (Arch Linux) and using the gcc compiler (g++ for cpp), version 10.2.0 - might be this the problem? I read that the supported compiler is gcc 6.3.x but I couldn't retrieve that (super old) version so far. Also, I'd prefere not to downgrade to that version.
Any suggestion on how to fix the problem? I have no idea.
Thank you!

댓글 수: 4

Till Blaha
Till Blaha 2020년 11월 9일
Hello Alessia,
I have the exact same behaviour in R2019a running on Arch Linux. Did you find a workaround?
Kind regards
Till
Till Blaha
Till Blaha 2020년 11월 9일
In fact: These error message is weird and I have now spent around 2 hours compiling ancient GCC's without success.. but running the function just worked! So, if probably compiled just fine and the error message might just arise during verification? Still a bit scary, but so far, everything I compiled worked.
Hello!
Sorry for the late reply...
Finally I was able to compile, after relinking some libraries and changing the call to mex into: "try mex ... ; catch; end;"
I don't remeber exactly which libraries I needed to relink but there is a lot of information on the internet about that.
Hope it helps!
Regards, Alessia
Arnaud Benjamin
Arnaud Benjamin 2022년 11월 19일
편집: Arnaud Benjamin 2022년 11월 19일
For me, I had this error message (truncated for clarity) :
/usr/local/MATLAB/R2022b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found
The specified libstdc++.so.6 file is shipped with matlab. What probably happened, is that my OS's gcc (being up-to-date thanks to Arch Linux repos) produced a binary .mexa64 file which requires a more recent version of the standard lib than Matlab comes supplied with.
Simply relinking the above symlink to my system's /lib/libstdc++.so.6 fixed this error. You must also restart Matlab.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2020년 9월 30일

편집:

2022년 11월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by