guard against SPACK_FC possibly not being defined (#30581)

This commit is contained in:
Chris White 2022-05-10 10:19:03 -07:00 committed by GitHub
parent 01b79abcdf
commit cfed42ecfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -303,7 +303,10 @@ def hostconfig(self):
####################### #######################
c_compiler = env["SPACK_CC"] c_compiler = env["SPACK_CC"]
cpp_compiler = env["SPACK_CXX"] cpp_compiler = env["SPACK_CXX"]
f_compiler = env["SPACK_FC"] if "+fortran" in spec:
f_compiler = env["SPACK_FC"]
else:
f_compiler = None
####################################################################### #######################################################################
# Directly fetch the names of the actual compilers to create a # Directly fetch the names of the actual compilers to create a

View file

@ -287,7 +287,10 @@ def hostconfig(self):
####################### #######################
c_compiler = env["SPACK_CC"] c_compiler = env["SPACK_CC"]
cpp_compiler = env["SPACK_CXX"] cpp_compiler = env["SPACK_CXX"]
f_compiler = env["SPACK_FC"] if "+fortran" in spec:
f_compiler = env["SPACK_FC"]
else:
f_compiler = None
####################################################################### #######################################################################
# Directly fetch the names of the actual compilers to create a # Directly fetch the names of the actual compilers to create a