Control: tags -1 + patch
diff --git a/dhfortran/compilers.py b/dhfortran/compilers.py
index 224cac5..69c7413 100644
--- a/dhfortran/compilers.py
+++ b/dhfortran/compilers.py
@@ -318,11 +318,14 @@ def get_fc_flavor_arch(fc=None) -> str:
         f = os.environ["FC"]
     else:
         f = fc if fc else "/etc/alternatives/f95"
-    if f in default_compilers:
-        f = default_compilers[f]
+    # "gfortran" is a symlink to the default version, which need not
+    # be the one in the table. Try the name as given first, as
+    # compiler_present() does
     fullpath = which(f)
+    if fullpath is None and f in default_compilers:
+        fullpath = which(default_compilers[f])
     if fullpath is None:
-        fullpath = which(default_compilers['gfortran'])
+        fullpath = which("gfortran") or which(default_compilers['gfortran'])
     if fullpath is None:
         if orig_fc is None:
             orig_fc='gfortran' # for better error message

Reply via email to