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
Fix problem running 'make' with CC and CXX set #21985
Conversation
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
I'm OK with the approach at a high-level (particularly the stopping when printchplenv errors! :D ), but not invested enough in our interactions with cmake to be able to review that aspect of the approach or the implementation details. Do any of these changes add new user-facing environment variables, or change the behavior of current ones? (I'm hoping not). |
Yes, these parts are new and user-visible:
I view these as a relatively straightforward generalization of how we can infer I'd consider that a behavior change. The PR doesn't add any new Chapel configuration variables. If this direction gives you a lot of pause, there are certainly other ways we could fix the original issue. |
So Is it correct that if both |
Yes, the user was expected to set all of the relevant variables (e.g.
I do not know. It might have been an oversight. I don't know of a rationale to not infer
Setting e.g.
👍
Yes, we don't consider using
|
That all sounds good to me — thanks for the clarifications and reminders! (note that I have still not done anything to review the PR itself, just the behavior—and hope not to have to). |
Just catching up on email and noting that this could probably be merged now (?). (No surprise it hasn't been given the last few weeks, though). |
Follow-up to #21985 to resolve a Cygwin configuration failure where `CHPL_HOST_CC` is set to `gcc.exe` and the compiler detection logic is unable to infer `CHPL_COMPILER=gnu` from that. Reviewed by @arezaii - thanks! - [x] `make && make check` succeeds on a Cygwin system - [x] full comm=none testing
This PR is intended to resolve the build issue discussed in https://chapel.discourse.group/t/1-30-configuration-and-link-errors-when-building-on-system-where-1-29-previously-worked/20733/6
When building Chapel with something like
CC=clang CXX=clang++ make
, several things were going wrong:Why was there an error at all? it was this sequence of events:
CMAKE_C_COMPILER
andCMAKE_CXX_COMPILER
based on CHPL_MAKE_HOST_CC etc to communicate this setting to cmake (so cmake does not infer it based upon CC or use its favorite compiler)CHPL_HOST_CC
andCHPL_HOST_CXX
in the environment (so that printchplenv will be considering the same configuration that cmake is using)CHPL_HOST_COMPILER
fromCC
andCXX
but not fromCHPL_HOST_CC
andCHPL_HOST_CXX
. So, it failed, because the default valueCHPL_HOST_COMPILER=gnu
was inconsistent withCHPL_HOST_CC=clang
/CHPL_HOST_CXX=clang++
.This PR:
CHPL_HOST_COMPILER
fromCHPL_HOST_CC
/CHPL_HOST_CXX
CHPL_TARGET_COMPILER
fromCHPL_TARGET_CC
/CHPL_TARGET_CXX
(but this does not happen when LLVM would be the default or when using a PrgEnv).An alternative solution to the issue of inferring
CHPL_HOST_COMPILER
would be to pass it as an environment variable frommake
tocmake
and fromcmake
toprintchplenv
.Reviewed by @arezaii - thanks!
CC=clang-14 CXX=clang++-14 make
works on an Ubuntu 22.10 system where it did not work before