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

Enable C++11 as default #212

Closed
carlocamilloni opened this issue Jan 17, 2017 · 5 comments
Closed

Enable C++11 as default #212

carlocamilloni opened this issue Jan 17, 2017 · 5 comments
Labels
Milestone

Comments

@carlocamilloni
Copy link
Member

A number of things we are working on are just easier with C++11 and now is the default level of c++ also in gromacs

@carlocamilloni
Copy link
Member Author

in the branch isdb is already experimentally enabled

@GiovanniBussi
Copy link
Member

Hi @carlocamilloni

were you planning to do it for single features or as a whole (I mean: allowing any c++11 construct, without any ifdef protection)?

For me we could even allow c++11 everywhere perhaps. Here you can find supported compilers:
http://en.cppreference.com/w/cpp/compiler_support

It looks like to support all c++11 features you need:
gcc 4.8.1
clang 3.3
intel 15

Is anyone using older compilers?

Giovanni

@carlocamilloni
Copy link
Member Author

carlocamilloni commented Jan 17, 2017

Hi
I would put it as a prerequisite to just avoid problems, this is the gromacs policy from now on and I think that we could go in this direction for plumed 2.4. The implicit solvent CV could be in principle readapted to work with older compilers but it would not really make much sense. The are also very nice openmp4 features that at the moment I am systematically removing from what I am merging because I think is too early that requires c++11.

@GiovanniBussi
Copy link
Member

We should also check travis-ci.

Places that might be affected are:

  • There is one build set to UBUNTU precise that should be removed (this was there explicitly to check an older gcc compiler that has not c++11 support). This is not a problem in my opinion.
  • Other UBUNTU builds should use gcc 4.8.4 which should have almost complete c++11 support.
  • OSX build should use clang 3.8 which should have complete c++11 support.
  • src/maketools/codecheck currently uses this option for checking "cppcheck --std=c++03". I think this must be changed to "cppcheck --std=c++11"

Notice that in the web I found some comments about missing features in gcc 4.8 (added in 4.9), such as library. Since installing gcc 4.9 on travis might be complicated (especially since we need mpi; this might require compiling mpi every time), we could set our requirements to "a compiler with same c++11 support as gcc 4.8.4 and clang 3.8".

That would be very easy to check: if a test fails on travis, the corresponding part of the code should be protected with ifdefs and made optional. Would that be ok?

We can also specify it on the manual page. Hopefully intel compiler (that we can't check on travis) will also work.

Giovanni

@carlocamilloni
Copy link
Member Author

about the ubuntu precise at least for the current code i solved it using the flag --std=c++0x
I think that is fine to use gcc4.8 and clang 3.8 as you wrote, I also experienced some issue with recent intel compilers but in that case I have just reimplemented the feature.
Overall I think it should be robust enough, I mean is not that we are going to add immediately tons of c++11 features.

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

No branches or pull requests

2 participants