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

CMAKE_CXX_STANDARD=14 leads to -std=c++1y instead of -std=c++14 when compiling ROOT #1226

Closed
lucifer1004 opened this issue Sep 17, 2022 · 7 comments

Comments

@lucifer1004
Copy link

To reproduce, use the wizard to compile

https://root.cern/download/root_v6.26.06.source.tar.gz

No other dependencies are needed for now.

In srcdir, run the command:

cmake -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14 -Dminimal=ON root-6.26.06

And from the printed information, it can be seen that C++ flag is

-std=c++1y -pipe -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -DNDEBUG

But when I did this on my local system (Ubuntu 22.04), the flag is

-std=c++14 -pipe -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -DNDEBUG

So I think there is something wrong with the environment provided by BinaryBuilder. But currently, I do not know the root cause of this.

@lucifer1004
Copy link
Author

Also, it seems that CXX_STANDARD above 14 is not supported yet in the sandbox.

@giordano
Copy link
Member

Use a version of GCC which actually supports the C++14 standard? See https://gcc.gnu.org/projects/cxx-status.html#cxx14

@lucifer1004
Copy link
Author

So this should be solved with preferred_gcc_version option?

@lucifer1004
Copy link
Author

How should I do this in wizard mode?

@giordano
Copy link
Member

So this should be solved with preferred_gcc_version option?

Yes

How should I do this in wizard mode?

When you're asked "Do you want to customize the set of compilers?" you have to answer yes:

if yn_prompt(state, "Do you want to customize the set of compilers?", :n) == :y

@lucifer1004
Copy link
Author

Thanks!

@lucifer1004
Copy link
Author

I have never used that option before.

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

2 participants