fsaizpoy
fsaizpoy

Reputation: 149

mpicc with no warning when compiling

I would like to know what flag to use in order to avoid warning messages that appear when compiling a C/C++ parallel using mpicc. More specifically, I prefer not to have my screen of messages referring to unused variables,e.g. warning: unused variable

Thanks

Upvotes: 0

Views: 1224

Answers (3)

pyCthon
pyCthon

Reputation: 12361

depending on your compiler , you can add flags to avoid such warning messages, for instance -w is the GCC-wide option to disable warning messages.

Upvotes: 0

Hristo Iliev
Hristo Iliev

Reputation: 74485

As pointed by High Performance Mark, mpicc is simply a wrapper around the real compiler toolchain. There is an almost standard option that (almost) all wrappers understand: -showme. It shows you what flags exactly get passed on to the compiler, e.g.:

$ mpicc -showme
icc <lots of preprocessor flags> -fexceptions -pthread \
    <lots of linker flags> -lmpi -losmcomp -lrdmacm -libverbs -lrt \
    -lnsl -lutil -lpsm_infinipath -lbat -llsf -ldl -lm -lnuma

Examine these options, consult your compiler's manual and find out how to suppress the warnings.

Upvotes: 1

High Performance Mark
High Performance Mark

Reputation: 78364

Most (?) MPI compiler wrappers will pass compiler options to the compiler that they wrap. so you should be able to use the same flag, for mpicc, that you would use for your compiler unwrapped.

For a better answer: consult the source of your installation of mpicc which is generally implemented (on Linux systems) as a shell script. Many versions also respond to -help and similar.

Upvotes: 1

Related Questions