-
Notifications
You must be signed in to change notification settings - Fork 90
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
Require C++14 #1830
Require C++14 #1830
Conversation
Note this removes CXX11_FLAGS that I think we added
MPICXX sets the MPI compiler, but this is used to set CXX. We should use CXX because some of the macros add flags directly to CXX
Compiler ICE :( Also looks like mpic++ isn't using g++-7 in that job, so that's doubly annoying. |
index_derivs strikes again :)
|
Make members of DerivativeType<FF> and FF `static constexpr` instead. And because we're not using C++17 yet, we also need to add redundant definitions outside the classes too Also need to move the declarations of func in DerivativeType<FF> above the uses because something else goes wrong. Not getting inlined? Linker getting confused? Don't know, but this fixes it. Alternative to last para: make `apply`: return FF{}(...); Probably free/cheap/inline-able? Don't need func member then, but could be useful, plausibly
Because nothing's ever easy, I've had to modify
A nice consequence of this is we can also eliminate the branching in |
C++14 is now widely supported by the majority of platforms and compilers:
https://en.cppreference.com/w/cpp/compiler_support#cpp14
Notably, IBM XL C++ only has partial support.
It's very much a "bugfix release" of the standard. Here's a good summary of the new features:
https://github.com/AnthonyCalandra/modern-cpp-features/blob/master/CPP14.md
As of the end of 2019, it seems not enough supercomputers have compilers that support C++17 to justify us moving to that.
This PR is a little bit longer than I was expecting, and there's a couple of changes that might be a little surprising at first.
For CMake, this was literally just changing a single character.
For autoconf... I decided to also update the macro from autoconf-archive that we use. It turns out we were using a slightly modified form (probably my doing) that added a variable
CXX11_FLAGS
that stored the compiler flag (-std=c++11
or similar).The actual macro just adds the flag directly to
CXX
. But we useMPICXX
as the compiler.Well, it turns out we actually only need
MPICXX
to find the MPI compiler, and after thatCXX
is set toMPICXX
. This is all internal toconfigure
and the user doesn't need to know any of this, so it's safe to change our uses ofMPICXX
toCXX
. Using./configure MPICXX=/path/to/mpi/compiler
is still supported.