[Chapel Merge] Allow setting CC, CXX, and other variables to indi

Branch: refs/heads/main
Revision: 18519a0
Author: mppf
Log Message:

Merge pull request #17923 from mppf/compiler-cc

Allow setting CC, CXX, and other variables to indicate compiler path

This PR implements changes to how users can indicate a particular path to
a particular compiler. It is sort of a follow-up to PR #17800 which added
CHPL_LLVM_PREFIX for selecting an LLVM installation.

This PR makes the following variables settable by users (as environment
variables or in a chplconfig):

  • for setting all the compilers (host and target) at once using
    relatively well known environment variable names:
    • CC, CXX
  • for setting host and target compilers separately:
    • CHPL_HOST_CC, CHPL_HOST_CXX
    • CHPL_TARGET_CC, CHPL_TARGET_CXX
  • for indicating which system LLVM installation should be used / the
    path to it by providing the path to the llvm-config command:
    • CHPL_LLVM_CONFIG

Additionally it does some clean-ups for LLVM Makefiles.

For printchplenv, the new variables are in the compiler or runtime
categories but aren't printed by default (so printchplenv --all will
print them). This PR adjusts printchplenv.py to include an idea that
some variables shouldn't be in --path output since it doesn't make
sense to store the path to CC say in the compiler/runtime build path.

PR #17931 contains the documentation changes to go along with these changes.

Reviewed by @daviditen - thanks!

  • [x] full local testing

Future Work:

  • adding testing for setting CHPL_HOST_CC / CC / CHPL_LLVM_CONFIG etc.

    Modified Files:
    R third-party/llvm/LLVM_VERSION
    R third-party/llvm/Makefile.include-llvm-clang
    R third-party/llvm/Makefile.include-llvm-minimal
    R third-party/llvm/Makefile.include-system-minimal
    R third-party/llvm/find-llvm-config.sh
    M make/Makefile.base
    M make/compiler/Makefile.clang
    M make/compiler/Makefile.cray-prgenv
    M make/compiler/Makefile.gnu
    M make/compiler/Makefile.ibm
    M make/compiler/Makefile.intel
    M make/compiler/Makefile.pgi
    M runtime/Makefile
    M test/llvm/PREDIFF
    M test/llvm/llvmDebug/llvmDebug_test.py
    M test/runtime/sungeun/chpl-env-gen.precomp
    M third-party/llvm/Makefile
    M third-party/llvm/Makefile.include-bundled
    M third-party/llvm/Makefile.include-system
    M third-party/llvm/Makefile.share-bundled
    M third-party/llvm/Makefile.share-system
    M third-party/llvm/Makefile.version
    M third-party/llvm/README
    M util/buildRelease/install.sh
    M util/chplenv/chpl_compiler.py
    M util/chplenv/chpl_llvm.py
    M util/chplenv/printchplenv.py
    M util/chplenv/utils.py

    Compare: Comparing 5497e248e63f...18519a0c457e · chapel-lang/chapel · GitHub