-
Notifications
You must be signed in to change notification settings - Fork 110
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
Fix ambiguous template special. errors with GCC 7+ #259
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Jakob,
Thanks for putting this together!
Is there an explanation for the need for MPI_PROTO_COMPLEX(T)
instead of MPI_PROTO(Complex<T>)
?
Take for example function
Macro
GCC 8 throws To help GCC I explicitly instantiated those function templates in src/core/imports/mpi.cpp, e.g.
But in order to instantiate the right
vs.
Here it's |
Thanks for the explanation! Though this sounds like a bug in GCC 8 (that is worth working around). Is it not possible to use a chain of two macros to avoid hundreds of lines of redundancy between MPI_PROTO and MPI_PROTO_COMPLEX? Also, the OpenMP include seems unrelated to this CL. |
A chain of macros would definitely be better. Any idea how this could look like? I removed the OpenMP commit. Sorry, my fault. |
Separating out the routines with equivalent definitions for both real and complex into a |
Of course! 🙈😅 I'm on it.. |
Current draft is here. |
We are seeing this issue with petsc & v0.87.7 Would it be possilbe to have this fix on branch |
Thank you for the PR! The draft looks good and I think merging into 0.87 would be a great idea. |
BTW: this patch applies cleanly to 0.87 branch - and the build error goes away with it [my test box is fedora 28 - with gcc version 8.1.1] |
I will open a PR for this draft commit rebased on master (build logs) once #263 is done. |
FWIW, I just merged said commit despite it breaking the new build tests. |
I filed a bug report with GCC a while ago. It only seems to affect explicit template instantiation, not implicit instantiation. Last time I checked, GCC's development branch still won't accept this code, but that was last week. |
The build of elemental is failed on GCC 7+: elemental/Elemental#254 Fixed but not released yet in merge request: elemental/Elemental#259 * gnu/packages/maths.scm (elemental): Update to 0.87.7-0.6eb15a0. Change-Id: I333f1de160489035f1a8875173abdd57c03ef777 Signed-off-by: Eric Bavier <[email protected]>
Fix "ambiguous template specialization" errors like below with GCC 7 and later. #254
EDIT: Old commit can be found here.