The following quote is taken from documentation of scorep. In order to use the software, the scorep command is said to prefixed to compiler which is mpicc. I am using automake. So far, in configure.ac I had AC_PROG_CC([mpicc]). How can I prefix the scorep command to compiler command with automake?
When makefiles are employed to build the application, it is convenient to define a placeholder variable to indicate whether a “preparation'' step like an instrumentation is desired or only the pure compilation and linking. For example, if this variable is called PREP then the lines defining the C compiler in the makefile can be changed from:
MPICC = mpicctoMPICC = $(PREP) mpiccOne can then use the same makefile to either build an instru- mented version with the
make PREP="scorep"command or a fully optimized and not instrumented default build by simply using:
make.
If your package must always be built with
scorep, then just prepend it toCCin yourconfigure.ac, like:This will cause a build failure if the user building your package doesn't have
scorep, but presumably that's what you want. (Or you could add a check toconfigure.acto have it error ifscorepis not found.)If you want the user to optionally use
scorep, you could make the above assignment conditional. One common way is to use an option, in your case, say,--with-scorep.A final option is to do nothing and let users wanting this functionality request it like: