summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2016-01-13 12:32:04 -0600
committerAdam J. Stewart <ajstewart426@gmail.com>2016-01-13 12:32:04 -0600
commitf9fbb57d3182bf0e9c39e4b7c0a958c6ba87a2fa (patch)
treeffd4cd24cfcb4a42c39e6923530d035c7313336b /lib
parentf55bba72446a38b020fd0e3fe79d8b680cd8d783 (diff)
downloadspack-f9fbb57d3182bf0e9c39e4b7c0a958c6ba87a2fa.tar.gz
spack-f9fbb57d3182bf0e9c39e4b7c0a958c6ba87a2fa.tar.bz2
spack-f9fbb57d3182bf0e9c39e4b7c0a958c6ba87a2fa.tar.xz
spack-f9fbb57d3182bf0e9c39e4b7c0a958c6ba87a2fa.zip
Add NAG Fortran Compiler support
Diffstat (limited to 'lib')
-rwxr-xr-xlib/spack/env/cc4
-rw-r--r--lib/spack/spack/compilers/__init__.py2
-rw-r--r--lib/spack/spack/compilers/nag.py24
3 files changed, 27 insertions, 3 deletions
diff --git a/lib/spack/env/cc b/lib/spack/env/cc
index 0966277a91..aacba996b3 100755
--- a/lib/spack/env/cc
+++ b/lib/spack/env/cc
@@ -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"
;;
diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py
index 66e608cf79..a6198fc1ce 100644
--- a/lib/spack/spack/compilers/__init__.py
+++ b/lib/spack/spack/compilers/__init__.py
@@ -45,7 +45,7 @@ from spack.util.environment import get_path
_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):
diff --git a/lib/spack/spack/compilers/nag.py b/lib/spack/spack/compilers/nag.py
new file mode 100644
index 0000000000..2dfc97af73
--- /dev/null
+++ b/lib/spack/spack/compilers/nag.py
@@ -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.]+)')