diff options
author | Chris White <white238@llnl.gov> | 2020-06-19 12:31:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-19 14:31:09 -0500 |
commit | a20ba315f57bcbbb73838d1b67a15a9e14d580cd (patch) | |
tree | 6242d977aafd81eb6261e742d69995589bd9e715 | |
parent | 844312f2135169b9e329710e178177df0553e412 (diff) | |
download | spack-a20ba315f57bcbbb73838d1b67a15a9e14d580cd.tar.gz spack-a20ba315f57bcbbb73838d1b67a15a9e14d580cd.tar.bz2 spack-a20ba315f57bcbbb73838d1b67a15a9e14d580cd.tar.xz spack-a20ba315f57bcbbb73838d1b67a15a9e14d580cd.zip |
Axom/Conduit: Fix error when fortran is not defined (#17171)
* Fix error when fortran is not defined
* Guard more ~fortran cases
-rw-r--r-- | var/spack/repos/builtin/packages/axom/package.py | 8 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/conduit/package.py | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/axom/package.py b/var/spack/repos/builtin/packages/axom/package.py index 2eb3ae226c..add0619a3e 100644 --- a/var/spack/repos/builtin/packages/axom/package.py +++ b/var/spack/repos/builtin/packages/axom/package.py @@ -231,7 +231,9 @@ class Axom(CMakePackage, CudaPackage): if fflags: cfg.write(cmake_cache_entry("CMAKE_Fortran_FLAGS", fflags)) - if ("gfortran" in f_compiler) and ("clang" in cpp_compiler): + if ((f_compiler is not None) + and ("gfortran" in f_compiler) + and ("clang" in cpp_compiler)): libdir = pjoin(os.path.dirname( os.path.dirname(cpp_compiler)), "lib") flags = "" @@ -444,7 +446,7 @@ class Axom(CMakePackage, CudaPackage): # Override XL compiler family familymsg = ("Override to proper compiler family for XL") - if "xlf" in f_compiler: + if (f_compiler is not None) and ("xlf" in f_compiler): cfg.write(cmake_cache_entry("CMAKE_Fortran_COMPILER_ID", "XL", familymsg)) if "xlc" in c_compiler: @@ -455,7 +457,7 @@ class Axom(CMakePackage, CudaPackage): familymsg)) if spec.satisfies('target=ppc64le:'): - if "xlf" in f_compiler: + if (f_compiler is not None) and ("xlf" in f_compiler): description = ("Converts C-style comments to Fortran style " "in preprocessed files") cfg.write(cmake_cache_entry("BLT_FORTRAN_FLAGS", diff --git a/var/spack/repos/builtin/packages/conduit/package.py b/var/spack/repos/builtin/packages/conduit/package.py index 9928884e92..b8b23bccbe 100644 --- a/var/spack/repos/builtin/packages/conduit/package.py +++ b/var/spack/repos/builtin/packages/conduit/package.py @@ -371,7 +371,9 @@ class Conduit(Package): if fflags: cfg.write(cmake_cache_entry("CMAKE_Fortran_FLAGS", fflags)) - if ("gfortran" in f_compiler) and ("clang" in cpp_compiler): + if ((f_compiler is not None) + and ("gfortran" in f_compiler) + and ("clang" in cpp_compiler)): libdir = os.path.join(os.path.dirname( os.path.dirname(f_compiler)), "lib") flags = "" |