@lonaowna
Thanks a lot, unfortunately I have tried these steps and installed different versions of compilers (4.9, 4.9.3, 5, 6.4, 7 etc.) However, MATLAB did not even accept gcc6.4 (from gcc63-multilib). I have edited "mex_C++_glnxa64.xml" and the output is below. Lastly, I also tried to compile 6.3.0 from source but it gives an error called "error 2". Therefore, I am a bit out of options. Is there a way to make this library to give 6.3 version when it requested -dumpversion :)
mex -setup C++ -v
Verbose mode is on.
... Looking for compiler 'g++' ...
... Executing command 'which g++' ...Yes ('/bin/g++').
... Executing command 'g++ -print-file-name=libstdc++.so' ...Yes ('/usr/lib/libstdc++.so').
... Executing command 'g++ -dumpversion' ...Yes ('8.2.1').
... Executing command 'which g++' ...Yes ('/bin/g++').
... Looking for folder '' ...No.
Did not find installed compiler 'g++'.
... Looking for compiler 'gcc-6' ...
... Executing command 'which gcc-6' ...Yes ('/bin/gcc-6').
... Executing command 'gcc-6 -print-file-name=libstdc++.so' ...Yes ('/usr/lib/gcc/x86_64-pc-linux-gnu/6.5.0/libstdc++.so').
... Executing command 'gcc-6 -dumpversion' ...Yes ('6.5.0').
... Executing command 'which gcc-6' ...Yes ('/bin/gcc-6').
... Looking for folder '' ...No.
Did not find installed compiler 'gcc-6'.
... Looking for compiler 'g++-6' ...
... Executing command 'which g++-6' ...Yes ('/bin/g++-6').
... Executing command 'g++-6 -print-file-name=libstdc++.so' ...Yes ('/usr/lib/gcc/x86_64-pc-linux-gnu/6.5.0/libstdc++.so').
... Executing command 'g++-6 -dumpversion' ...Yes ('6.5.0').
... Executing command 'which g++-6' ...Yes ('/bin/g++-6').
... Looking for folder '' ...No.
Did not find installed compiler 'g++-6'.
Error using mex
No supported compiler was found. For options, visit https://www.mathworks.com/support/compilers.
Pinned Comments
valandil commented on 2020-08-24 15:06 (UTC)
I highly recommend building this package in a clean chroot. This avoids the use of a AUR helper, which sometimes uses
/tmpas the stating directory, which often gets filled completely by gcc's build process.It also provides a clean environment, which minimizes interactions between your current environment and gcc's build process.