Use case for CMAKE_<LANG>_COMPILER_LAUNCHER, and how to use when linking, and RFE: CMAKE_<LANG>_LINKER_LAUNCHER
Hi @robertmaynard @brad.king and all the other wonderful folks at Kitware! First let me say, I continue to love CMake and find it indispensable in my daily software development! Thank you for your passion, and hard work; my professional life would be much more unpleasant without CMake.
I am trying to compile applications using TAU Commander and also the OpenCoarrays compiler wrapper script. The former is a human-usable interface to the TAU Performance SystemⓇ which streamlines, abstracts and automates the collection of performance data for applications and maintains a database of performance measurement trials. The latter is akin to mpicc
or mpif90
; the OpenCoarrays caf
compiler wrapper script passes additional flags and libraries to the compiler and linker to compile coarray Fortran programs against the OpenCoarrays runtime.
From my experimentation, it seems the the CMAKE_<LANG>_COMPILER_LAUNCHER
variable/property will cause the command/executable specified to be pre-pended to the the compile rule, e.g., if -DCMAKE_Fortran_COMPILER_LAUNCHER:FILEPATH=$HOME/taucmdr/bin/tau
and FC=/path/to/gfortran
then when compiling objects CMake will launch compilation of object files like so:
/home/zbeekman/taucmdr/bin/tau /path/to/gfortran -c infile.f90 -o infile.f90.o
But my question is, what is one supposed to do at link time? How can we prepend the call to the linker (or better yet link via calling the compiler) with /home/zbeekman/taucmdr/bin/tau
? My experimentation seemed to indicate that the CMAKE_Fortran_COMPILER_LAUNCHER
was only ever called at compile time and not during linking.
If no such functionality exists could I request a property/variable like CMAKE_<LANG>_LINKER_LAUNCHER
?
I'm also curious what the motivation for CMAKE_<LANG>_COMPILER_LAUNCHER
was and what the typical use case is. It strikes me as somewhat hamstrung without the ability to also prepend the linker commands, but what do I know? ¯\_(ツ)_/¯
Thanks again, -Zaak