[mvapich-discuss] mpicxx wrapper breaks user defined header files

Jonathan Perkins perkinjo at cse.ohio-state.edu
Thu Dec 3 14:55:40 EST 2009


On Thu, Dec 03, 2009 at 11:51:52AM -0700, Atencio, Jonathan Gerald wrote:
> While attempting to build an application using mvapich's mpicxx
> wrapper, a user its attempting to include headers from a library with
> a name similar to one provided by the system, for example boost.
> Instead of using the user specified include headers, it is defaulting
> to the system headers.  This is because CXXFLAGS is passed to the
> compiler before user arguments:
> 
> mpicxx:83 CXXFLAGS="-I${includedir}/mpi2c++  -pipe -xO -D_EM64T_
> -DEARLY_SEND_COMPLETION -DMEMORY_SCALE -DVIADEV_RPUT_SUPPORT -DCH_GEN2
> -D_SMP_ -D_SMP_RNDV_ -D_PCI_EX_ -D_DDR_ -I/usr/include
> -I/usr/include/infiniband -D_GNU_SOURCE -fPIC"
> 
> And later, it runs:
> mpicxx:336 : $Show $CCC $CCFLAGS  -DHAVE_MPI_CPP $CXXFLAGS
> $compileargs -I$includedir
> 
> In order to work around this issue, I removed /usr/include from
> CXXFLAGS and included it after $includedir.  So, these lines above
> would look something like this:
> 
> mpicxx:83 CXXFLAGS="-I${includedir}/mpi2c++  -pipe -xO -D_EM64T_
> -DEARLY_SEND_COMPLETION -DMEMORY_SCALE -DVIADEV_RPUT_SUPPORT -DCH_GEN2
> -D_SMP_ -D_SMP_RNDV_ -D_PCI_EX_ -D_DDR_ -I/usr/include/infiniband
> -D_GNU_SOURCE -fPIC"
> 
> mpicxx:336 : $Show $CCC $CCFLAGS  -DHAVE_MPI_CPP $CXXFLAGS
> $compileargs -I$includedir  -I/usr/include
> 
> This allows our user defined headers to be included before system
> headers. Would this be an acceptable work around? Is there a reason
> why we need to include /usr/include in CXXFLAGS for mpicxx?

I don't think its necessary to specifically add -I/usr/include since
compilers automatically search the system include paths after any user
specified path anyways.  I suspect that you can just drop -I/usr/include
from line 336 altogether.

We'll take a look into why this is being added specifically and if we
don't find any good reason to keep it will drop it from our wrapper(s) in
the next release.  Thanks for reporting this.

> 
> Your help is greatly appreciated.
> 
> Thank you,
> 
> Jonathan
> 

-- 
Jonathan Perkins
http://www.cse.ohio-state.edu/~perkinjo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://mail.cse.ohio-state.edu/pipermail/mvapich-discuss/attachments/20091203/fb1fe7e5/attachment-0001.bin


More information about the mvapich-discuss mailing list