Add fallback compiler settings equivalent to gcc default#1809
Conversation
|
It makes sense to me, but @jedbrown may have some thoughts as he's done more work on the Makefile |
jedbrown
left a comment
There was a problem hiding this comment.
Thanks for this PR. One consequence of moving from declarative to imperative (with conditionals) is that one needs to read through all the conditional logic (or run on the target machine) to determine how it would be configured; cf. make print-CFLAGS.clang. I think the issue you observed could be addressed within the declarative model by updating these two lines. What do you think?
CC_VENDOR := $(firstword $(filter gcc (GCC) cc clang icc icc_orig oneAPI XL emcc,$(subst -, ,$(shell $(CC) --version))))
CC_VENDOR := $(subst cc,gcc,$(subst (GCC),gcc,$(subst icc_orig,icc,$(CC_VENDOR))))
Thank you for the review. I didn't appreciate that usage of prints Alternatively undoes the above, but leaves the |
|
As a more minimalist approach, with the same gcc style fallback, and maintaining the |
3c27eb4 to
8de8544
Compare
|
I updated to only map |
|
@hughcars I think this is good to merge unless you have any other changes, yes? |
My ubuntu vended
/usr/bin/ccfails in the vendor check because it's a wrapper of gcc:resulting in flags not being set correctly. This PR adds a gcc-equivalent default for the relevant flags (given parsing
(or)within Makefile is tricky, so can't search for justUbuntu). These flags are then overridden for specific compilers when necessary. Should preserve the "only set if not explicitly set" behaviour and detects against any other wrappers around gcc-equivalent compilers. If a future compiler vendor needs to be supported, should just need another if branch.Note: this was being encountered for libceed builds nested within Palace builds as part of a spack build (which was using
/usr/bin/cc).Before the change:
after the change: