I was trying to compile PAPI (http://icl.cs.utk.edu/papi/) on linux machine. The problem is that I have both icc and gcc installed. There are some issues with icc. As a result, I wanted to force building PAPI with gcc instead of icc.
Apparently, you can do that by setting a compiler flag (‘CC’) to gcc. You can do it in one line,
To see what kind of flags you can overwrite, you can do
It will display the following,
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
headers in a nonstandard directory <include dir>
F77 Fortran 77 compiler command
FFLAGS Fortran 77 compiler flags
CPP C preprocessor
Next time, I will know how to deal with this kind of issues. This is especially important when multiple compilers, (icc and gcc for example) are installed.
Many thanks to Shoaib!