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 MPIR's compliance with c++ #18240
Comments
Branch: u/dimpase/18240 |
Commit: |
Author: Dima Pasechnik |
This comment has been minimized.
This comment has been minimized.
comment:5
needless to say, after pulling in the change, one has to |
comment:7
Is that known upstream? (I recall we had related discussions, but I don't know whether there's already a similar fix.) |
comment:8
Replying to @nexttime:
Ooops, saw the "reported upstream" too late. But isn't there already an upstream patch (or at least an issue on github)? |
This comment has been minimized.
This comment has been minimized.
comment:9
(fixed the link to sage-devel) my understanding is that upstream is not in hurry to fix this properly, as it's not easy. |
comment:10
Hmmm, I at least haven't found any reply from Bill on mpir-devel, nor any related (open or closed) issue on github (wbhart/mpir). So you should probably send some fix upstream as well (and/or open a new issue on github). ("Developers acknowledge bug" -- I'm not sure upstream is really aware of it such that it'll get fixed in the next release. Bill's pretty busy and there are lots of things he wanted or has to do for the next release IIRC.) As |
comment:11
Replying to @nexttime:
there is a post: https://groups.google.com/d/msg/mpir-devel/78Hb2-sGrjQ/1VohfbjBmgUJ I just opened an issue on github, too: wbhart/mpir#153
the former need to be touched as |
comment:12
Replying to @dimpase:
:-) So this ticket will set itself to "positive review" after a while as well...
Ok.
Ok, the real problem is that mpirxx.h includes mpir.h too late, but it's not the purpose of this ticket to optimize the order of inclusions in MPIR's headers. Still, I'd remove the |
comment:13
P.S.: I'd also like to see the patches to both files in a single patch with the issue in its filename, especially since |
comment:14
Oh, this is weird: While with the patches to MPIR 4ti2-1.6.2 now "finds" GMP (i.e., MPIR), it doesn't build for me (on Sage 6.6) with GCC 4.8.4 nor 4.9.2, but 5.0.1 (RC1). In the failing builds, GCC complains about
multiple times, where apparently only the last is fatal (= not ignored through Make rules); after the first error other things get built and installed. This might be related to MPIR as well, but I'm not sure, and I guess you also tested with GCC 4.9.2, so I'm a bit puzzled. |
comment:15
Replying to @nexttime:
sorry, what is the compiler you are using? |
comment:16
The patch/patches should be documented in the header (free-form text before the first chunk). Not in the filesystem metadata, and not in other files (like SPKG.txt) |
comment:17
Replying to @dimpase:
FSF GCC 4.8.4, FSF GCC 4.9.2, and the first release candidate of FSF GCC 5.0.1, i.e., no versions from distros / all vanilla. |
comment:18
Replying to @vbraun:
Well, a "verbose" filename in addition is also helpful; which files get patched can easily be extracted from the patch, and other patches may modify the same file(s). |
comment:19
Replying to @nexttime:
I don't see any errors in my |
comment:20
I don't think either that this is connected with MPIR offtopic: It must be the case that '_4ti2_HAVE_MPZ_INT64_CONVERSION' for whatever reasons is not defined |
comment:21
Replying to @sagetrac-jakobkroeker:
"either"? Which comment are you replying to? It's not clear to me, sorry... |
comment:22
I just misreaded comment 19, it is probably too late for me, sorry. Drop 'either'. @nexttime |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:24
Replying to @sagetrac-git:
oops, I messed up. |
New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:27
fixed the error in the previous commit. Ready for review now. |
comment:28
Replying to @sagetrac-jakobkroeker:
FWIW, without setting any with GCC 4.8:
With GCC 4.9:
With GCC 5.1:
In all cases, the C++ sources are compiled with $ for v in 4.4 4.8 4.9 5.0 5.1; do echo -n "g++ $v: "; g++-$v -E -dM -x c++ -std=c++0x /dev/null | grep __cplusplus; done
g++ 4.4: #define __cplusplus 1
g++ 4.8: #define __cplusplus 201103L
g++ 4.9: #define __cplusplus 201103L
g++ 5.0: #define __cplusplus 201103L
g++ 5.1: #define __cplusplus 201103L so there doesn't seem to be any difference (in case the version is checked in the source files). Haven't digged deeper yet. (Should take a look at the |
comment:29
Replying to @nexttime:
As posted, they fail, but for a different reason... (see below)
Ok, sorry, my bad: I had only rebuilt MPIR with GCC 5.1, and so 4ti2's conversion checks failed with the earlier versions (4.8.4 and 4.9.2) due to a rather unrelated linker error. Dima, if nobody objects, I think you can set the ticket to positive review. (Although "GCC 4.9 work-around" stills seems a bit misleading, as it's not a compiler bug. ;-) ) |
Reviewer: Jakob Kroeker, Leif Leonhardy |
Changed branch from u/dimpase/18240 to |
Changed commit from |
comment:32
please see an update on wbhart/mpir#153 |
Changed upstream from Reported upstream. Developers acknowledge bug. to Fixed upstream, in a later stable release. |
with gcc 4.9.2, we hit this bug:
Header changes
The header was updated for C++11 support and this breaks some libraries which misuse macros meant for internal use by GCC only. For instance with GMP versions up to 5.1.3, you may see:
This has hit here: #18198, see also sage-devel thread
The workaround suggested by the gcc people appears to work.
Upstream: Fixed upstream, in a later stable release.
CC: @vbraun @nexttime @wbhart
Component: packages: standard
Author: Dima Pasechnik
Branch:
6785ef2
Reviewer: Jakob Kroeker, Leif Leonhardy
Issue created by migration from https://trac.sagemath.org/ticket/18240
The text was updated successfully, but these errors were encountered: