Add NAG Fortran Compiler support

This commit is contained in:
Adam J. Stewart 2016-01-13 12:32:04 -06:00
parent f55bba7244
commit f9fbb57d31
3 changed files with 27 additions and 3 deletions

4
lib/spack/env/cc vendored
View file

@ -94,11 +94,11 @@ case "$command" in
command="$SPACK_CXX"
language="C++"
;;
f90|fc|f95|gfortran|ifort|pgf90|xlf90)
f90|fc|f95|gfortran|ifort|pgf90|xlf90|nagfor)
command="$SPACK_FC"
language="Fortran 90"
;;
f77|gfortran|ifort|pgf77|xlf)
f77|gfortran|ifort|pgf77|xlf|nagfor)
command="$SPACK_F77"
language="Fortran 77"
;;

View file

@ -45,7 +45,7 @@
_imported_compilers_module = 'spack.compilers'
_required_instance_vars = ['cc', 'cxx', 'f77', 'fc']
_default_order = ['gcc', 'intel', 'pgi', 'clang', 'xlc']
_default_order = ['gcc', 'intel', 'pgi', 'clang', 'xlc', 'nag']
def _auto_compiler_spec(function):
def converter(cspec_like):

View file

@ -0,0 +1,24 @@
class Nag(Compiler):
# Subclasses use possible names of C compiler
cc_names = []
# Subclasses use possible names of C++ compiler
cxx_names = []
# Subclasses use possible names of Fortran 77 compiler
f77_names = ['nagfor']
# Subclasses use possible names of Fortran 90 compiler
fc_names = ['nagfor']
@classmethod
def default_version(self, comp):
"""The '-V' option works for nag compilers.
Output looks like this::
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
Product NPL6A60NA for x86-64 Linux
Copyright 1990-2015 The Numerical Algorithms Group Ltd., Oxford, U.K.
"""
return get_compiler_version(
comp, '-V', r'NAG Fortran Compiler Release ([0-9.]+)')