Ascent/Conduit: Update the +fortran build config (#28646)

Do not silently turn off fortran support based on checking if
a fortran compiler exists. Let the build fail if there is no
working fortran compiler.
This commit is contained in:
kwryankrattiger 2022-02-01 08:44:48 -06:00 committed by GitHub
parent bdfcf7c92b
commit eb7bc7fc4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 20 deletions

View File

@ -276,11 +276,6 @@ def hostconfig(self, spec, prefix):
#######################
c_compiler = env["SPACK_CC"]
cpp_compiler = env["SPACK_CXX"]
f_compiler = None
if self.compiler.fc:
# even if this is set, it may not exist so do one more sanity check
f_compiler = env["SPACK_FC"]
#######################################################################
# Directly fetch the names of the actual compilers to create a
@ -330,12 +325,9 @@ def hostconfig(self, spec, prefix):
cfg.write(cmake_cache_entry("CMAKE_CXX_COMPILER", cpp_compiler))
cfg.write("# fortran compiler used by spack\n")
if "+fortran" in spec and f_compiler is not None:
if "+fortran" in spec:
cfg.write(cmake_cache_entry("ENABLE_FORTRAN", "ON"))
cfg.write(cmake_cache_entry("CMAKE_Fortran_COMPILER",
f_compiler))
else:
cfg.write("# no fortran compiler found\n\n")
cfg.write(cmake_cache_entry("ENABLE_FORTRAN", "OFF"))
# shared vs static libs

View File

@ -295,13 +295,7 @@ def hostconfig(self, spec, prefix):
#######################
c_compiler = env["SPACK_CC"]
cpp_compiler = env["SPACK_CXX"]
f_compiler = None
if self.compiler.fc:
# even if this is set, it may not exist
# do one more sanity check
if os.path.isfile(env["SPACK_FC"]):
f_compiler = env["SPACK_FC"]
f_compiler = env["SPACK_FC"]
#######################################################################
# Directly fetch the names of the actual compilers to create a
@ -349,12 +343,9 @@ def hostconfig(self, spec, prefix):
cfg.write(cmake_cache_entry("CMAKE_CXX_COMPILER", cpp_compiler))
cfg.write("# fortran compiler used by spack\n")
if "+fortran" in spec and f_compiler is not None:
if "+fortran" in spec:
cfg.write(cmake_cache_entry("ENABLE_FORTRAN", "ON"))
cfg.write(cmake_cache_entry("CMAKE_Fortran_COMPILER",
f_compiler))
else:
cfg.write("# no fortran compiler found\n\n")
cfg.write(cmake_cache_entry("ENABLE_FORTRAN", "OFF"))
if "+shared" in spec: