-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
spkg-configure.m4 for gmp and mpir #27212
Comments
Commit: |
Author: Dima Pasechnik |
Branch: u/dimpase/packages/gmp_m4 |
comment:1
here we check that GMP is new enough, by verifying it has a new function. To actually build with GMP, one needs
(configure does the test regardless) New commits:
|
comment:2
I suppose due to a special treatment of GMP/MPIR, despite configure reporting GMP as not being installed, it still gets picked up for installation from source. |
comment:3
Yes, I've already put some thought into how to handle this case, though I don't have a solid answer. The The tricky thing is that with MPIR it can be compiled with or without gmp-compatibility mode. On Sage we use So if we run |
comment:4
Deciding which BLAS to use from the system raises similar questions. |
comment:5
The more I think about it, the more I'm inclined toward If We should also add an |
comment:6
It should also be noted that we have also in the past patched other SPKGS (see e.g. #21188) to always link with I'm not 100% convinced that that's necessary, though certainly one or the other should be used. So it's probably best to always ensure that there is at least a working Update: It seems that a |
comment:7
It seems MPIR is not in fact packaged for Debian (not sure about other distros): https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=708391 I had just assumed it would be a question of using either MPIR or GMP (in other words, they conflict with each other, and installing either one or the other is possible, as is the case in Sage). |
comment:8
Replying to @embray:
FreeBSD provides GMP and MPIR, not in GMP-compatibility mode (I looked at the corresponding makefile) both are in /usr/local/ there. I would not be worried about a hypothetical situation of many libgmp's on the system |
comment:9
I guess the main question is what to do with the One way is that there are really three possible values:
where the default value is "detect". In the "detect" case we just try to find the best working libgmp on the system and use it if found. If not found the next fallback would be to install the mpir SPKG (the current default). If passed "mpir" or "gmp" explicitly we don't bother detecting and just install the specifically requested SPKG. Another possible interpretation is something more like:
where now default value "gmp" is similar to the first case: just try to detect any libgmp on the system to use, and failing that install an SPKG for some libgmp (where we might still use MPIR, but that fact is an implementation detail), whereas "mpir" means "detect MPIR specifically", which is to say find a libgmp that also, at a minimum, contains the Perhaps there are some other ways of interpreting/re-interpreting this flag, but those are a couple I have in mind. |
comment:10
I think I lean more toward the latter case. Most people who want to build Sage do not care what GMP implementation they use, so I think it's good enough to use the one they have, if any, and if not pick one for them. Whereas if someone is explicitly passing OTOH I'd also be curious in what cases MPIR gives better performance, and if we're doing users a disservice by not at least strongly recommending that they use it. I think this is more a question for the mailing list though. The details of what to do at |
comment:11
Perhaps we could leave the mpir-based toolchain aside for a moment, after all mpir is an optional package, so it is a bug if it is pulled in once GMP is chosen, So first we have to sort out why GMP is pulled in despite being recognised by configure as not to be installed, no? Note that this spurious GMP installation isn't even triggered before some of spkgs dependent on GMP are installed, e.g. MPFR happily installs long before it's started on GMP.
but the beginning of MPFR install log says, wrongly,
This is of course as expected, as it's hardwired in its spkg-install, as It appears to me that instead the main |
comment:12
And MPFR's only part of trouble:
So passing SAGE_LOCAL left and right for everything is something to work on. |
comment:13
I don't think I understand how the Or perhaps it's because |
comment:14
I've added spkg-configures to the whole "toolchain" bunch (see attachment) - the one for MPIR is basically just a plug, and will now try running the build to see if GMP install still surfaces... |
comment:15
Attachment: mp_star.patch.gz no, this does not help - and while I didn't have patience for the build to come to a halt, I still saw GMP getting built. (and none of MP*'s) |
comment:16
The thing to do with all of these is that For this it might be useful to use the existing Then every What I'm less sure about is how exactly to determine the value for |
comment:17
I think the .dummy magic breaks for diff --git a/build/make/deps b/build/make/deps
index e9008d20e6..c37b6062ee 100644
--- a/build/make/deps
+++ b/build/make/deps
@@ -77,7 +77,7 @@ toolchain: $(foreach pkgname,$(TOOLCHAIN),$(inst_$(pkgname)))
# See #14168 and #14232.
#
# Note: This list consists of only the *runtime* dependencies of the toolchain.
-TOOLCHAIN_DEPS = zlib $(MP_LIBRARY) mpfr mpc
+TOOLCHAIN_DEPS = zlib gmp mpfr mpc
TOOLCHAIN_DEP_INSTS = \
$(foreach pkgname,$(TOOLCHAIN_DEPS),$(inst_$(pkgname)))
@@ -156,7 +156,6 @@ sagelib: \
$(inst_mpc) \
$(inst_mpfi) \
$(inst_mpfr) \
- $(MP_LIBRARY) \
$(inst_ntl) \
$(inst_numpy) \
$(inst_pari) \ (probably only the 2nd change, removal from and, viola, no GMP building pops up. Needless to say, "dummies" of the form |
comment:18
Replying to @dimpase:
Sorry, I didn't realize you were being stymied by this. Yes, to me there was no mystery here, which is in part why I was focused on how best to handle the existing |
comment:19
Replying to @embray:
Another possibility of course is to just leave it empty and not pass |
comment:20
Pragmatically, I'd say that This is reasonably flexible. Experts who need special versions of GMP/MPIR may just update Sage's packages and use them, or install them system-wide. Most of all, it would not need fiddling with recongising "hidden" MPIR in a system's libgmp, something that would otherwise cater for non-existing systems, i.e. pure over-design for nothing and nobody... |
comment:112
and now this fails on OSX 10.14 with external gmp, specifically, flint does not build:
note that mpfr and ntl, its dependencies build just fine with SAGE_CHECK=yes, so that's something in flint C++ interface that is broken... |
comment:113
I suppose this is caused by the very recent (Apr 6) NTL update. |
comment:114
No, it must be either lack of testing on OSX 10.14 (I tested on 10.13 before), or new clang in Xcode:
|
comment:115
Replying to @vbraun:
Well, if you like I can install autotools on your OSX bot just from sources. (I recall doing that on OSX 10.12, it should still be possible on 10.14). |
comment:116
Replying to @dimpase:
The problem seems to be caused by |
comment:117
facepalm.... That was just a library clash - I did have libntl installed in /usr/local, and this seems to be deadly on OSX... |
comment:118
Replying to @dimpase:
Again, unless we make autotools a prerequisite we need a way to verify that Sage builds on OSX without autotools installed... |
comment:119
Replying to @vbraun:
Do we have Linux buildbots without autotools installed? Anyhow, one can have autotools installed in a non-standard location only buildbot knows, so that it can run ./bootstrap, and then it's as if there are not present. It's hard for me to understand the problem without knowing how exactly a release is made. |
Changed branch from public/packages/gmp_m4 to |
comment:121
No matter how you slice it, either the buildbot has access to autotools OR it tests that you can build without autotools. The only safe way to avoid generating a confball by hand is to have some automatic system, e.g. whenever I submit a new buildbot job. That requires some work to avoid version clashes when I back out commits. Truth be told, changes to the configure in Sage are pretty rare so this issue does not come up very often. I'm in Berlin, hit me up when you have some time. I'm located in the East (Elsenstrasse). |
Changed commit from |
comment:122
Replying to @dimpase:
I have had similar problems--not necessarily with NTL--but with other packages where having a copy of the development package already installed on my system created difficult to avoid clashes when trying to build some Sage SPKGs. See e.g. #22768. In that case it's more due to bugginess with Python's module build system, but I can envision similar problems in other build systems that make too many assumptions about your paths in some context. |
comment:123
Replying to @vbraun:
I have a dozen tickets open that do change configure, see #27330. |
comment:124
Breakage: #27751 |
This should be easy, and it's a potential source of library conflicts, as gmp is often installed...
note that GMP is pulled in via
./configure --with-mp=gmp
(as well as by specifying SAGE_MP_LIBRARY?)
Configure:
http://users.ox.ac.uk/~coml0531/sage/configure-316.tar.gz
CC: @embray
Component: packages: optional
Author: Erik Bray, Dima Pasechnik
Branch:
e735b4b
Reviewer: Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/27212
The text was updated successfully, but these errors were encountered: