Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'-std=c++11' compilation error with matlab 2015a on ubuntu #1149

Closed
RussTedrake opened this issue Jul 9, 2015 · 6 comments
Closed

'-std=c++11' compilation error with matlab 2015a on ubuntu #1149

RussTedrake opened this issue Jul 9, 2015 · 6 comments

Comments

@RussTedrake
Copy link
Contributor

in the spotless pod on matlab 2015a on ubuntu 12.04, I just saw

cc1plus: error: unrecognized command line option '-std=c++11'
@RussTedrake
Copy link
Contributor Author

note that I am running gcc 4.6.3:

gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

and it looks like matlab officially only supports >= 4.7 now:
http://www.mathworks.com/support/compilers/R2015a/index.html?sec=glnxa64
and they officially only support ubuntu 14.04.

my guess is that changing the flag in ~/.matlab/R2015a/mex_C++_glnxa64.xml from -std=c++11 to -std=c++01 (in two places) would probably resolve it. or better yet, upgrading to gcc 4.7 .

@RussTedrake
Copy link
Contributor Author

also note that spotless is optional (and drake compiled fine). if you don't need it, you could comment it out in the drake-distro/tobuild.txt file.

@MiaoLi
Copy link

MiaoLi commented Jul 11, 2015

I had the same problem, ubuntu 12.04+ MATLAB 2015a .
I have gcc 4.7 and 4.8 installed, But I finally complied them by the following step:
cp /usr/local/MATLAB/R2015a/bin/mexopts.sh ~/.matlab/R2015a/mexopts.sh
Change CC=’gcc’ to CC=’gcc-4.7′ CCX=’g++’ to CCX=’g++-4.7′

chmod 644 ~/.matlab/R2013b/mexopts.sh

If still have the cc1plus error:
Then change -std=c++11 to -std=c++0x in CMakeList.

@RussTedrake
Copy link
Contributor Author

great. thank you for reporting your findings!

On Jul 11, 2015, at 10:32 AM, MiaoLi notifications@github.com wrote:

I had the same problem, ubuntu 12.04+ MATLAB 2015a .
I have gcc 4.7 and 4.8 installed, But I finally complied them by the following step:
cp /usr/local/MATLAB/R2015a/bin/mexopts.sh ~/.matlab/R2015a/mexopts.sh
Change CC=’gcc’ to CC=’gcc-4.7′ CCX=’g++’ to CCX=’g++-4.7′

chmod 644 ~/.matlab/R2013b/mexopts.sh

Then change -std=c++11 to -std=c++0x in CMakeList.


Reply to this email directly or view it on GitHub.

@RussTedrake
Copy link
Contributor Author

we have officially updated the minimal gcc version to 4.7, making this one irrelevant.

@ashutosh-devel
Copy link

To solve this:

go to the glnxa64/ directory inside the MATLAB/R20XXa/bin folder and replace all occurrences of c++11 with c++0x in the g++_glnax64.xml file present there. It worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants