[Chapel Merge] Improve ability to use system packages for GMP/RE2

Branch: refs/heads/main
Revision: 00d7194f0da7ef88ee0a3da0c2166a12d5a159aa
Author: jabraham17
Link: Improve ability to use system packages for GMP/RE2 by jabraham17 · Pull Request #25184 · chapel-lang/chapel · GitHub
Log Message:
Improve ability to use system packages for GMP/RE2 (#25184)

Improves Chapels ability to use system packages for GMP and RE2.

This PR adds some pkg-config/brew logic to use CHPL_GMP=true when
GMP is not in the library path. It also adds some extra detection for
GMP. This means that if a user has GMP installed, CHPL_GMP will
default to system

This PR makes CHPL_RE2=system a config time error, because Chapel relies
on a special version of RE2 that is not available in any package
manager. This should improve errors if a user tries to use a system
install of RE2

This PR also puts some utils in place to check if GMP is installed on
the system, but it does not switch the default for CHPL_GMP

This PR also now requires pkg-config on systems with homebrew, and
makes the necessary adjustments to hwloc, jemalloc, gmp, and the
homebrew formula

Testing:

  • ran start_test test/library/standard/BigInteger/apiTest.chpl with
    CHPL_GMP=system
  • tested that CHPL_RE2=system is a config time error
  • tested various error conditions (e.g. "pkg-config" not installed,
    packages missing)

[Reviewed by @jhh67]

Compare: Comparing 38d3894f650b3f0b84301174286d23d9379baad5...2c58ba5f8140bdec62162291a85cf09d035e9feb · chapel-lang/chapel · GitHub

Diff:
M runtime/make/Makefile.runtime.gmp-system
M third-party/Makefile
M util/chplenv/chpl_compiler.py
M util/chplenv/chpl_gmp.py
M util/chplenv/chpl_hwloc.py
M util/chplenv/chpl_jemalloc.py
M util/chplenv/chpl_llvm.py
M util/chplenv/chpl_platform.py
M util/chplenv/chpl_re2.py
A util/chplenv/homebrew_utils.py
M util/chplenv/third_party_utils.py
M util/packaging/homebrew/chapel-main.rb
https://github.com/chapel-lang/chapel/pull/25184.diff