Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor Linker tool to be a CompilerWrapper #357

Open
hiker opened this issue Nov 26, 2024 · 0 comments
Open

Refactor Linker tool to be a CompilerWrapper #357

hiker opened this issue Nov 26, 2024 · 0 comments
Labels
BOM Issues copied from the BOM fork

Comments

@hiker
Copy link
Collaborator

hiker commented Nov 26, 2024

I can't see a good use case that anyone would want to use a non-compiler as linker. So by making Linker a compiler wrapper we enforce that each linker is a compiler (and that we can always add compiler flags like openmp, ... to the link flags automatically).

Important additional requirement:
Similar to the way compiler wrapper reuse flags of a compiler, we need the same feature for linker.
Use case: A non-MPI version might use gfortran as linker, so a user would specify all flags for gfortran. But if we then want to link with mpif90-gfortran, we need to specify the same flags again. It would be much more useful if the linker-mpif90-gfortran could inherit flags from linker-gfortran. Not sure atm how to do this best, but the decorator pattern might just work - a linker could be be using another linker-compiler-wrapper etc.

Additionally, it must then also be able to overwrite them! E.g. one infrastructure library comes in a MPI and non-MPI version (with slightly different names). So linker-gfortran would link dl_esm_inf using the non-mpi version of the lib, but linker-mpif90-gfortran would instead link the MPI-enabled version. If we stick with this pattern, a compiler wrapper would need to collect all library settings 'underneath' (which is only available if the wrapped tools is another linker, and not the compiler), but then update any settings with its own.

Am happy to discuss

@hiker hiker added the BOM Issues copied from the BOM fork label Nov 26, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
BOM Issues copied from the BOM fork
Projects
None yet
Development

No branches or pull requests

1 participant