compilers/clang: add flang (#5503)

* compilers/clang: add flang

* Update clang.py
This commit is contained in:
Christoph Junghans 2017-10-10 14:52:10 -06:00 committed by Todd Gamblin
parent 88b515ede8
commit cb7628c9a4
3 changed files with 16 additions and 10 deletions

4
lib/spack/env/cc vendored
View file

@ -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"

1
lib/spack/env/clang/flang vendored Symbolic link
View file

@ -0,0 +1 @@
../cc

View file

@ -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++',
'cxx': 'clang/clang++'}
if sys.platform == 'darwin':
# Use default wrappers for fortran, in case provided in
# compilers.yaml
'f77': 'clang/gfortran',
'fc': 'clang/gfortran'}
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 @@ def fc_version(cls, fc):
if sys.platform == 'darwin':
return cls.default_version('clang')
else:
return 'unknown'
return cls.default_version(fc)
@classmethod
def f77_version(cls, f77):