-
Notifications
You must be signed in to change notification settings - Fork 423
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
Add ability to infer CHPL_LLVM_GCC_INSTALL_DIR #26429
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
112be91
to
19f598f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would assume that we want this to replace the by-default inference in get_gcc_prefix_dir
. That is, if LLVM version is new enough, we should infer CHPL_LLVM_GCC_INSTALL_DIR
but not CHPL_LLVM_GCC_PREFIX
. If LLVM is too old, we should infer CHPL_LLVM_GCC_PREFIX
but not CHPL_LLVM_GCC_INSTALL_DIR
.
Also, presumably, we want to infer neither of these if one of them is set in the environment.
util/chplenv/chpl_llvm.py
Outdated
@@ -1054,8 +1069,7 @@ def filter_llvm_config_flags(llvm_val, flags): | |||
# when adding LLVM=system as system headers, we should not perturb the | |||
# include search path, so use -isystem-after/-idirafter | |||
# | |||
# when adding LLVM=bundled, we should include the LLVM headers as system | |||
# headers and prefer the bundled headers, so use -isystem | |||
# when adding LLVM=bundled, we should include the LLVM headers a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something weird happened with this comment
@@ -72,6 +72,7 @@ | |||
'CHPL_LLVM_CLANG_CXX', | |||
# CHPL_LLVM_VERSION -- doesn't make sense to override it | |||
'CHPL_LLVM_GCC_PREFIX', # not in printchplenv --all | |||
'CHPL_LLVM_GCC_INSTALL_DIR', # not in printchplenv --all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
That should be the logic already. This PR didn't touch the existing logic, which already prefers GCC_INSTALL_DIR gcc_install_dir = get_gcc_install_dir()
if gcc_install_dir:
clang_args.append('--gcc-install-dir=' + gcc_install_dir)
else:
gcc_prefix = get_gcc_prefix_dir(clang_cfg_args)
if gcc_prefix:
clang_args.append('--gcc-toolchain=' + gcc_prefix)
This is currently not handled. Also, if both are specified I expect we would want to prefer GCC_INSTALL_DIR and warn about GCC_PREFIX being set. I will make add this |
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
# note: this is a helper for get_clang_basic_args, its declared here so the | ||
# memoization can be shared and possible warnings only occur once | ||
flag_to_use = None | ||
# all(overrides.get(flag) is not None for flag in gcc_prefix_flags.keys()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented-out code
Adds the ability to infer
CHPL_LLVM_GCC_INSTALL_DIR
. Resolves #25925This PR uses similar logic to the LLVM spack package to determine this. Thanks @PHHargrove for the pointer to this.
Testing
CHPL_LLVM_GCC_INSTALL_DIR=none
make check
on a nightly test systemmake check
on M1 macThis PR also adds a missing line to
overrides.py
forCHPL_LLVM_GCC_INSTALL_DIR
[Reviewed by @]