octopus: Update compiler flags (#36446)
* octopus: set the right compiler flags https://github.com/fangohr/octopus-in-spack/pull/70 * octopus: fix pep8 style issue
This commit is contained in:
parent
cc4a528274
commit
7266cc9b92
@ -219,16 +219,33 @@ def configure_args(self):
|
|||||||
# In case of GCC version 10, we will have errors because of
|
# In case of GCC version 10, we will have errors because of
|
||||||
# argument mismatching. Need to provide a flag to turn this into a
|
# argument mismatching. Need to provide a flag to turn this into a
|
||||||
# warning and build sucessfully
|
# warning and build sucessfully
|
||||||
|
# We can disable variable tracking at assignments introduced in GCC10
|
||||||
|
# for debug variant to decrease compile time.
|
||||||
|
|
||||||
fcflags = "FCFLAGS=-O2 -ffree-line-length-none"
|
# Set optimization level for all flags
|
||||||
fflags = "FFLAGS=O2 -ffree-line-length-none"
|
opt_level = "-O2"
|
||||||
if spec.satisfies("%gcc@10:"):
|
fcflags = f"FCFLAGS={opt_level} -ffree-line-length-none"
|
||||||
gcc10_extra = "-fallow-argument-mismatch -fallow-invalid-boz"
|
cxxflags = f"CXXFLAGS={opt_level}"
|
||||||
args.append(fcflags + " " + gcc10_extra)
|
cflags = f"CFLAGS={opt_level}"
|
||||||
args.append(fflags + " " + gcc10_extra)
|
|
||||||
else:
|
# Add extra flags for gcc 10 or higher
|
||||||
args.append(fcflags)
|
gcc10_extra = (
|
||||||
args.append(fflags)
|
"-fallow-argument-mismatch -fallow-invalid-boz"
|
||||||
|
if spec.satisfies("%gcc@10:")
|
||||||
|
else ""
|
||||||
|
)
|
||||||
|
# Add debug flag if needed
|
||||||
|
if spec.satisfies("+debug"):
|
||||||
|
fcflags += " -g"
|
||||||
|
cxxflags += " -g"
|
||||||
|
cflags += " -g"
|
||||||
|
gcc10_extra += (
|
||||||
|
"-fno-var-tracking-assignments" if spec.satisfies("%gcc@10:") else ""
|
||||||
|
)
|
||||||
|
|
||||||
|
args.append(f"{fcflags} {gcc10_extra}")
|
||||||
|
args.append(f"{cxxflags} {gcc10_extra}")
|
||||||
|
args.append(f"{cflags} {gcc10_extra}")
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user