diff options
-rwxr-xr-x | lib/spack/env/cc | 4 | ||||
l--------- | lib/spack/env/clang/flang | 1 | ||||
-rw-r--r-- | lib/spack/spack/compilers/clang.py | 21 |
3 files changed, 16 insertions, 10 deletions
diff --git a/lib/spack/env/cc b/lib/spack/env/cc index 3d118d8d7c..d76a06760d 100755 --- a/lib/spack/env/cc +++ b/lib/spack/env/cc @@ -110,13 +110,13 @@ case "$command" in comp="CXX" lang_flags=CXX ;; - ftn|f90|fc|f95|gfortran|ifort|pgfortran|xlf90|xlf90_r|nagfor) + ftn|f90|fc|f95|gfortran|flang|ifort|pgfortran|xlf90|xlf90_r|nagfor) command="$SPACK_FC" language="Fortran 90" comp="FC" lang_flags=F ;; - f77|gfortran|ifort|pgfortran|xlf|xlf_r|nagfor|ftn) + f77|gfortran|flang|ifort|pgfortran|xlf|xlf_r|nagfor|ftn) command="$SPACK_F77" language="Fortran 77" comp="F77" diff --git a/lib/spack/env/clang/flang b/lib/spack/env/clang/flang new file mode 120000 index 0000000000..82c2b8e90a --- /dev/null +++ b/lib/spack/env/clang/flang @@ -0,0 +1 @@ +../cc
\ No newline at end of file diff --git a/lib/spack/spack/compilers/clang.py b/lib/spack/spack/compilers/clang.py index 81e0babc1d..eea4798798 100644 --- a/lib/spack/spack/compilers/clang.py +++ b/lib/spack/spack/compilers/clang.py @@ -42,18 +42,23 @@ class Clang(Compiler): cxx_names = ['clang++'] # Subclasses use possible names of Fortran 77 compiler - f77_names = ['gfortran'] + f77_names = ['flang', 'gfortran'] # Subclasses use possible names of Fortran 90 compiler - fc_names = ['gfortran'] + fc_names = ['flang', 'gfortran'] # Named wrapper links within spack.build_env_path link_paths = {'cc': 'clang/clang', - 'cxx': 'clang/clang++', - # Use default wrappers for fortran, in case provided in - # compilers.yaml - 'f77': 'clang/gfortran', - 'fc': 'clang/gfortran'} + 'cxx': 'clang/clang++'} + + if sys.platform == 'darwin': + # Use default wrappers for fortran, in case provided in + # compilers.yaml + link_paths['f77'] = 'clang/gfortran' + link_paths['fc'] = 'clang/gfortran' + else: + link_paths['f77'] = 'clang/flang' + link_paths['fc'] = 'clang/flang' @property def is_apple(self): @@ -169,7 +174,7 @@ class Clang(Compiler): if sys.platform == 'darwin': return cls.default_version('clang') else: - return 'unknown' + return cls.default_version(fc) @classmethod def f77_version(cls, f77): |