Created
September 5, 2016 12:50
-
-
Save bonanza123/bb38a9a95e450e2bc99a6ac8d8513cf2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATLAB usually requires acient gcc versions to compile MEX files (e.g. v4.9.x for R2016b). However, archlinux usually ships with the most recent version of gcc and this may results in some conflicts with linked C++ ABI. | |
Fortunately, archlinux AUR provides also older gcc versions (such as gcc49). The problem is that MATLAB's `mex -setup` doesn't find these additionally installed gcc versions. The solution is to go into your local mex config in: | |
`/home/XX/.matlab/R2016b/mex_C++_glnxa64.xml` | |
and replace the line | |
`<cmdReturns name="which g++" />` | |
e.g. with | |
`<cmdReturns name="which g++-4.9" />`. | |
Additionally, change | |
`<cmdReturns name="g++ -print-file-name=libstdc++.so"` | |
to | |
`<cmdReturns name="g++-4.9 -print-file-name=libstdc++.so"`. | |
Then try to run `mex.getCompilerConfigurations('C++','Selected')` from MATLAB and verify the settings. | |
(Don't forget to the same if the mex_C xml files etc). |
Dear bonanza123,
Thanks for pointing out the solution, do you also have a solution for 2018b which requires 6.3.x version? I could find all version but 6.3.x. I tried 6.5.0 but that also does not seem to work. :(
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had catastrophic failure with
mex
forC++
. For some reason, themex_C++_glnxa64.xml
file didn't exist. This fixed it!Thanks!