Sushil Ks
Sushil Ks

Reputation: 403

Can we use gcc optimization flags over mpicc?

I tried compiling MPI programs with mpicc by passing -O1 -O2 -O3 etc optimization flags. I would like to know whether optimization flags really work with mpicc and also wether mpicc supports all the optimization flags of gcc compiler.

Upvotes: 2

Views: 3181

Answers (2)

Hristo Iliev
Hristo Iliev

Reputation: 74465

mpicc, mpic++, mpif90, mpif77, etc. are all just wrappers around the actual system compiler. Any option that the wrapper does not recognise as its own gets passed to the actual compiler. You can see what is being invoked behind the scenes by calling mpicc with the -showme option:

$ mpicc -showme
gcc ... <lots of options> ...

Upvotes: 4

niklasfi
niklasfi

Reputation: 15951

absolutely. All flags passed to mpicc, mpic++ and the likes are passed to the "original" compiler.

Upvotes: 1

Related Questions