metomi / fab

Flexible build system for scientific software
https://metomi.github.io/fab/
Other
19 stars 11 forks source link

`$FC` should allow the full path to compilers #275

Closed ScottWales closed 5 months ago

ScottWales commented 6 months ago

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'