Force PAPI to compile with gcc

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,

./configure CC=gcc

similar to a post here http://stackoverflow.com/questions/14253367/force-use-gcc-to-compile-instead-of-cc-in-configure-under-solaris-sparc

To see what kind of flags you can overwrite, you can do

./configure -help

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!

Advertisements
This entry was posted in Tools and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s