-
-
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
build/pkgs/{gmp,mpfr}/spkg-configure.m4: Check pkg-config first #31348
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:4
I started to play around with this a bit, and I can use python’s pkgconfig to locate gmp and mpfr. After doing that though, I get complaints about not being able to locagte -lntl, which I don’t think I can find with pkgconfig since it doesn’t have an ntl.pc file. This may be a bit too hacky, but would it be possible in the build process to copy the various includes and libraries to SAGE_LOCAL/{include, lib} that are picked up by configure? That seems like it would solve a whole host of problems at the expense of if the user updates one of those libraries then the new version would not be picked up. |
comment:5
Replying to @zlscherr:
For NTL, the configure script already determines |
comment:6
I've opened #31365 for NTL. |
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:9
I pushed very simple code for trying to deal with this. It's probably better to use regular expressions, but I just wanted a proof of concept. This allows make ptest to work with homebrew without having to source .homebrew-build-env. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:13
I've started getting failures that are fixed by sourcing |
comment:14
Yes, this is part of what this ticket intends to fix. |
comment:15
Great, thanks for the clarification! |
comment:16
Moving to 9.4, as 9.3 has been released. |
This comment has been minimized.
This comment has been minimized.
comment:19
some distros, like Fedora, have an unpleasant habit of not installing .pc files, while these are available. |
comment:20
Yes, the ticket is "Check pkg-config first", not "Check pkg-config only". |
comment:21
IMO homebrew (and anyone else installing libgmp to a nonstandard directory) should be pestered to install it to the system's default location. I'm pretty sure that the gmp and mpir packages then conflict, but you don't need to install them both at the same time. In fact, mpir can probably be deprecated. Using pkg-config just changes this potential problem (libraries in wrong locations) to another one (pc files in wrong locations) and adds an extra layer of indirection in the process. We may have to go ahead and fix it anyway, but we shouldn't lose track of the simple and easy way that this was all meant to work. |
comment:27
It's really just the broken design of homebrew's |
comment:28
is this reported to Homebrew as a bug? |
comment:31
Replying to @mkoeppe:
You don't need to fight a battle, merely report the problem, please. |
comment:32
They're pretty quick with closing as wontfix if one doesn't also provide a patch |
comment:33
Replying to @mkoeppe:
Sprecht du kein Ruby, oder? :-) |
comment:34
Replying to @dimpase:
I sent a first PR to reduce homebrew's |
Changed keywords from none to mpfr |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:38
Replying to @mkoeppe:
They have merged a broader change now, eliminating all of |
comment:41
so this needs changes to gmp's and mpfr's |
comment:42
|
comment:43
should we remove all the crud needed for gmp and mpfr without .pc files available? I suppose almost every platform we support nowadays will have them installed. |
comment:44
Replying to @dimpase:
That would be worth checking. |
<!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> The unreleased 2.2.x series has work on support for Python 3.12 https://github.com/aleaxit/gmpy The new version makes it necessary to tighten the requirements for MPC and MPFR. We do the version check without pkg-config as before; changing it to pkg-config is sagemath#31348. <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> - Depends on sagemath#36775 (merged here) <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36351 Reported by: Matthias Köppe Reviewer(s):
…6.3, `gmpy2` 2.2.0a1 <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> The unreleased 2.2.x series has work on support for Python 3.12 https://github.com/aleaxit/gmpy The new version makes it necessary to tighten the requirements for MPC and MPFR. We do the version check without pkg-config as before; changing it to pkg-config is sagemath#31348. (The upgrade of the packages was previously done in sagemath#36775, but has now been merged here.) <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36351 Reported by: Matthias Köppe Reviewer(s):
…6.3, `gmpy2` 2.2.0a1 <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> The unreleased 2.2.x series has work on support for Python 3.12 https://github.com/aleaxit/gmpy The new version makes it necessary to tighten the requirements for MPC and MPFR. We do the version check without pkg-config as before; changing it to pkg-config is sagemath#31348. (The upgrade of the packages was previously done in sagemath#36775, but has now been merged here.) <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36351 Reported by: Matthias Köppe Reviewer(s):
Currently
gmp.pc
, which may be provided at least on some platforms, is not used at all -- neither byconfigure
nor bysage.env.cython_aliases
,sage.misc.cython
.For example, on homebrew, using it will provide the specific library search directory
-L/usr/local/Cellar/gmp/6.2.1/lib
instead of having to rely on/usr/local/
(which is disabled when compiler/linker are invoked with-isysroot
)Currently,
gmp
is detected usingAC_CHECK_HEADER
, and the result is communicated tosage-build-env-config
as variablesSAGE_GMP_PREFIX
andSAGE_GMP_INCLUDE
; but it is not available in the runtime environment (sage_conf.py
,sage-env-config
).The failures reported in
can be fixed by simply changing
sage.misc.cython
to pick upgmp.pc
. But to avoid unpleasant surprises, we need to make sure that it is used consistently when present.(After #32549, the relevant file is
build/pkgs/gmp/spkg-configure.m4
.)The above applies to
mpfr
as well. See failure report in https://groups.google.com/g/sage-release/c/8ctwsUGl6LQ/m/Ob38Iyh1AAAJSimilar situation with
readline
(#29000): The spkg-configure script already uses pkg-config - but forgets to tell the build system what it found.Previous tickets: #27212
Depends on #31344
Depends on #32549
CC: @dimpase @jhpalmieri @zlscherr @orlitzky
Component: build: configure
Keywords: mpfr
Branch/Commit: u/gh-zlscherr/add_gmp_mpfr_cython @
07e00b6
Issue created by migration from https://trac.sagemath.org/ticket/31348
The text was updated successfully, but these errors were encountered: