calculix-adapter icon indicating copy to clipboard operation
calculix-adapter copied to clipboard

Automatic adjustment of compiler flags based on compiler/version

Open MakisH opened this issue 3 years ago • 2 comments

We currently have the quick-and-dirty solution for GCC 10 or newer:

FFLAGS = -Wall -O3 -fopenmp $(INCLUDES)
# Note for GCC 10 or newer: add -fallow-argument-mismatch in the above flags

With Ubuntu 22.04 LTS, this will become a more pressing issue, as people will stumble upon it more often without reading the documentation.

We could easily make a condition in the Makefile to check if this is GCC and if it is >=10. Not necessarily now, just documenting the need. We have more pressing issues.

Maybe there is already some fix in the vanilla CalculiX Makefile?

MakisH avatar Feb 08 '22 01:02 MakisH

Can't we just enable the flag in all cases, to be safe ?

boris-martin avatar Feb 08 '22 14:02 boris-martin

No, because older compilers will complain that they don't know the flag. Already fell into this trap before. :see_no_evil:

MakisH avatar Feb 08 '22 16:02 MakisH