metomi / fab

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

Improve support for user-defined tools #311

Open hiker opened 2 weeks ago

hiker commented 2 weeks ago

With #309 in progress, we need to implement a way to allow users to specify their own tools.

Suggested approach:

  1. TBH, the fine-grained tool categories (fcm ,git, subversion etc each being their own cateforie) would appear a probably useless overkill. Instead, add all these tools as MISC.
  2. Allow more than one MISC tool in the tool box.

With this implement, a user can add arbitrary tools (all as MISC). This works fine as long as the name of the tools are unique (i.e. we get the tool svn or subversion from the MISC category).

MatthewHambley commented 1 week ago

If separate categories are overkill for none compiler tools the next obvious question is "Why have them for tools?" Is everything "misc"?

hiker commented 1 week ago

Good question :) Originally, I imaginged that linker and compiler will use the same name. But obviously a linker would be quite different (it needs linker flags, and make sure to use the same compiler flags used elsewhere, e.g. -fopenmp or so). So when using a linker, you could not just ask for a name, you needed to specify which category you wanted (e.g. gfortran as linker, or gfortran as compiler).

But atm we create a linker based on the compiler name by adding linker- in front (linker-gfortran, or so). So in hindsight, maybe we don't need the categories? My suggestion: we leave this for now, and re-evaluate once we have proper compiler wrapper, linker, and tool flags.