Specifying the compiler's full path allows you to be explicit about which compiler you're using, without worrying about PATH ordering.
Using the full path to the compiler
FC=/usr/bin/gfortran
fab
Causes errors
Traceback (most recent call last):
File "/home/swales/fab/source/fab/cli.py", line 65, in calc_linker_flags
linker, linker_flags = linkers[fc]
~~~~~~~^^^^
KeyError: '/usr/bin/gfortran'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/swales/miniconda3/envs/fab/bin/fab", line 8, in <module>
sys.exit(cli_fab())
^^^^^^^^^
File "/home/swales/fab/source/fab/cli.py", line 94, in cli_fab
config = _generic_build_config(folder, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/swales/fab/source/fab/cli.py", line 32, in _generic_build_config
linker, linker_flags = calc_linker_flags()
^^^^^^^^^^^^^^^^^^^
File "/home/swales/fab/source/fab/cli.py", line 67, in calc_linker_flags
raise NotImplementedError(f"Fab's zero configuration mode does not yet work with compiler '{fc}'")
NotImplementedError: Fab's zero configuration mode does not yet work with compiler '/usr/bin/gfortran'
calc_linker_flags() should be looking at the basename of the compiler to decide what flags to add.
calc_linker_flags() should consider getting the the linker from $LD or re-use $FC
tools.COMPILERS should be indexed using the compiler's base name, or better still the compiler identity gotten from $FC --version to account for wrappers like mpifort
Specifying the compiler's full path allows you to be explicit about which compiler you're using, without worrying about PATH ordering.
Using the full path to the compiler
Causes errors
calc_linker_flags()
should be looking at the basename of the compiler to decide what flags to add.calc_linker_flags()
should consider getting the the linker from$LD
or re-use$FC
tools.COMPILERS
should be indexed using the compiler's base name, or better still the compiler identity gotten from$FC --version
to account for wrappers likempifort