Skip to content

conf-gmp: use pkg-config where available - #23330

Merged
raphael-proust merged 3 commits into
ocaml:masterfrom
mseri:fix-gmp
Apr 4, 2025
Merged

conf-gmp: use pkg-config where available#23330
raphael-proust merged 3 commits into
ocaml:masterfrom
mseri:fix-gmp

Conversation

@mseri

@mseri mseri commented Feb 16, 2023

Copy link
Copy Markdown
Member

See #18129 and #22954

I need to test the dependencies in opam list --depends-on conf-gmp before un-drafting

@mseri

mseri commented Feb 16, 2023

Copy link
Copy Markdown
Member Author

Checked packages:

  • bap-std
  • class_group_vdf
  • comby
  • conf-gmp-powm-sec
  • conf-mpfr
  • gappa
  • gmp-ecm
  • goblint
  • guile
  • libsail
  • lutin
  • mlgmp
  • mlgmpidl
  • numerix
  • polka
  • sail
  • secp256k1-internal
  • yices2
  • z3
  • zarith

Upper bound needed for

mlgmp, numerix

although they were already broken in systems with non-standard include paths

@artempyanykh

Copy link
Copy Markdown

Hi @mseri ! Just wanted to double-check if I could help somehow here. For the context, I'm interested in getting zarith fixes in as otherwise my team can't simply build our stuff (infer) on M1 MacBooks.

@nberth

nberth commented Apr 4, 2023

Copy link
Copy Markdown
Contributor

Hi @mseri
I've had similar issues locating weird installation paths for system libraries with mlgmpidl, so I've tried in #23613 an approach where packages like conf-gmp and conf-mpfr define some opam variables that other packages like zarith or mlgmpidl can use to locate the libraries (see https://github.com/ocaml/opam-repository/pull/23613/files#diff-2aa76d47e681a91666af166e62200ce54a0650971fbb9133bf778cf0cf1aeb27R12 for an example usage). For now this attempt makes use of a (slightly hackish) support package ez-conf-lib and does not involve pkg-config, as I've seen some systems where the directories it returns seemed incorrect; I think that feature could still be added with little effort.

@artempyanykh

Copy link
Copy Markdown

Hi @mseri! I see there's an alternative PR for GMP #23613 . Even if it gets merged, we'll still need a patch to zarith to use pkg-config for flag lookup. Is there something I can help with to help push this PR forward?

@mseri

mseri commented Jun 8, 2023

Copy link
Copy Markdown
Member Author

I need to check all the packages in the comment above, ensure that they link properly and that their reverse dependencies all still work. Once they all have a checkmark, we can undraft this

@mseri

mseri commented Jun 8, 2023

Copy link
Copy Markdown
Member Author

There is a PR in zarith to use pkg-config for gmp, which will also align it to this PR

@jvillard

Copy link
Copy Markdown
Contributor

Any chance this could be revived? gmp and zarith cannot be installed on osx with custom Homebrew paths at the moment.

@nberth

nberth commented Mar 20, 2024

Copy link
Copy Markdown
Contributor

Any chance this could be revived? gmp and zarith cannot be installed on osx with custom Homebrew paths at the moment.

There's been progress on the mlgmpidl side recently. It now uses a distinct "conf" package, named conf-gmp-paths. Customization via user input is not complete yet, but if that does not install properly you may be able to try the hack I suggested here.
I don't know if there is any plan to adapt zarith accordingly yet.

@mseri

mseri commented Mar 20, 2024

Copy link
Copy Markdown
Member Author

I will try to take some time to continue, but this is completely manual work and takes a lot of time for each package. I am not sure when I can unblock it.

@mseri

mseri commented Mar 20, 2024

Copy link
Copy Markdown
Member Author

the change to make zarith use pkg-config has been merged in the meantime (ocaml/Zarith#132) and published in zarith 1.13 (release-1.13)

@mseri

mseri commented Mar 20, 2024

Copy link
Copy Markdown
Member Author

I think I can refresh this PR with the suggestion from @avsm in #24133

@geralt-encore

Copy link
Copy Markdown

Is there any chance that this PR is going to be merged in foreseeable future? Anything I can help with to speed it up?

@mseri

mseri commented Jul 16, 2024

Copy link
Copy Markdown
Member Author

The latest zarith builds with pkg-config. Next week I am going to revise this. All revdeps I tested seem to be working fine

@mseri

mseri commented Aug 7, 2024

Copy link
Copy Markdown
Member Author

@geralt-encore it seems to work fine. If you have time to edit this to remove the patched zarith and to move the test files to the opam-sources-archive repository (they mat already be there!), we can finally merge it

See ocaml#18129 and ocaml#22954

Signed-off-by: Marcello Seri <marcello.seri@gmail.com>

Signed-off-by: Marcello Seri <marcello.seri@gmail.com>
@mseri
mseri marked this pull request as ready for review March 20, 2025 15:10
Comment thread packages/conf-gmp/conf-gmp.5/opam
Comment thread packages/conf-gmp-powm-sec/conf-gmp-powm-sec.4/opam Outdated
Comment thread packages/conf-gmp-powm-sec/conf-gmp-powm-sec.4/opam Outdated
Comment thread packages/conf-gmp/conf-gmp.5/opam Outdated
Comment thread packages/conf-gmp-powm-sec/conf-gmp-powm-sec.4/opam
Comment thread packages/conf-gmp-powm-sec/conf-gmp-powm-sec.4/opam Outdated
mseri and others added 2 commits April 3, 2025 15:24
Co-authored-by: Raphaël Proust <raphael-proust@users.noreply.github.com>
@raphael-proust

Copy link
Copy Markdown
Contributor

looks good

some failures in CI but all look unrelated to me

thanks ❤️

@raphael-proust
raphael-proust merged commit ebbcec9 into ocaml:master Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants