On 09/23/2011 01:49 AM, Jeff Squyres wrote:
> On Sep 22, 2011, at 4:17 PM, Uday Kumar Reddy B wrote:
>> Yes, but I can't find anything about -cc in openmpi's mpicc man page. So, -cc should either not be supported or work as per mpich's mpicc if you are wrapping around it.
> mpicc has no way of knowing that an option is not supposed to work. It only knows about a small number of options that it can understand (e.g., --showme). Any other command line tokens are passed through to the underlying compiler.
> More specifically: how is mpicc supposed to know that any given option was intended for mpicc and not the underlying compiler, particularly the ones that it doesn't support?
Yes, it won't in the general case, but since -cc is accepted by mpich,
you can as well assume it is not intended for the underlying compiler.
If a user is indeed trying to pass -cc to some unknown compiler, the
code is anyway not going to work with MPICH and probably most other
MPIs. In any case, for portability purposes, shouldn't you support -cc?
Or one could end up with distributions that compile on some or don't on
another. If you indeed would not like to support it, it's better to
check for -cc and throw an error than compile with a compiler user
didn't intend to - the latter may go unnoticed.