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
Please add a cmake variable to use externally installed flint #1275
Comments
@DanGrayson the CMake side of this is done. The only exception being when we build with mpir, which requires compiling Flint in order to avoid linking conflicts. So I believe this is a duplicate of #1242. @yurivict if you'd like to use gmp rather than mpir, and use the system Flint if it has version at least 2.6, add |
There seems to be no autotools side of this, since the title refers to cmake, so closing. |
FYI: |
This didn't work. It still tries to use the bundled flint project, despite flint2-2.6.0 being present.
|
I'd still like to understand how there can be linking conflicts. |
This is the part I don't understand. I'll do some experiments ... |
There should be a workaround for this. I would like to at least be able to build it, and only using the external Rebuilding all dependencies isn't an option due to the need to patch dependencies which is highly undesirable (copying patches from the port to dependent project bundling the same package). Another reason is everything can't be bundled into everything. |
Ah, that's my bad ... the correct option is |
With
|
Could you send the full output of CMake, perhaps in a gist? |
The development branch has further changes:
|
@DanGrayson You've already seen these errors, but didn't realize they're caused by gmp/mpir conflicts. Here's an example from your own commit this morning: 5dfe1b2 This particular instance might not have to do with mpir, but the errors are exactly the same kind. |
@yurivict thanks! Could you also upload |
Looks like the error is literally just that the I'll try to figure out why it's behaving badly to not finding the submodule even when it isn't needed. |
I use tarballs from GitHub with some submodules added into the source tree. flint isn't added because it is a separate package. Using Git repositories isn't feasible for packaging due to security issues: all build sources need to be fingerprinted and 100% reproducible. |
Even if you provide a git commit hash? That would provide the same security and reproduciblity. |
@yurivict here's a hack for now: just do Does that work? |
But why have a local copy of flint if it isn't going to be used? |
Same with this hack:
|
Oh my bad again, I meant
|
The problem with flint2 went away, but now this:
You should never need to download glpk. It is a 20+ yo project available on all systems: https://repology.org/project/glpk/versions And if it isn't available on some system, maybe nobody cares about this system, and you shouldn't either. All cmake should do is to search for the |
This is the error:
@yurivict can you tell me where it is installed? I think the reason we offer compiling it is that it links with mpir, and so that whole story ... but in this case it's just not finding it! |
Okay -- how would I come to realize it? |
@DanGrayson I think my first clue came when I built shared libraries for everything and noticed that some of flint, ntl, and factory where linked with incorrect gmp libraries. Then I wrote a short code that used a function that is different between mpir and gmp and linked it with both static mpir and a static flint that is linked with the incorrect gmp, and the code executed the gmp function rather than mpir. This was a few months ago and a low priority for me at the moment, but if you're curious, try |
@yurivict since the flint issue is fixed (and I added a FAQ entry to INSTALL-CMake.md) I'll close this. Feel free to message here or open a new issue if CMake can't find glpk. We may need to patch |
I think the phrase "a static flint that is linked with the incorrect gmp" has no meaning, as a static library is not linked yet: it is only dynamic libraries that are pre-linked.
That's not an error, as mpir is a fork of gmp, and the two libraries define hundreds of identical functions. |
Unless I'm deeply confused about the terminology, I'm pretty sure it's exactly the opposite. For instance, the symbols in a static library
For a dynamic library
Dan, there's no need to explain to me what mpir is! When I tell the build system to use mpir, it's because I want the routines as implemented in mpir to be used (e.g. for speed), so I don't want an important library like flint to instead use the routines as implemented in gmp. Anyway, I think I've explained the issue as best as I understand it, and since the cmake build system works out of the box with both |
Just look at the symbol table in libflint.a:
The symbols are marked with "U", which means undefined. The job of "ld" when linking later is to locate those symbols in libgmp or libmpir and link them in.
Why would that be a link conflict?
If you use the flint dynamic library, you can't control it, as the dynamic library is pre-linked. But if you use the libflint.a, then you can easily link with libgmp or libmpir, as you wish, provided the versions and API's are compatible with what the compiler saw when creating libflint.a.
|
flint is packaged on most systems, see https://repology.org/projects/?search=flint
The text was updated successfully, but these errors were encountered: