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

Atencio, Jonathan Gerald jgatenc at sandia.gov
Thu Dec 3 13:51:52 EST 2009


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?

Your help is greatly appreciated.

Thank you,

Jonathan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.cse.ohio-state.edu/pipermail/mvapich-discuss/attachments/20091203/723c6162/attachment.html


More information about the mvapich-discuss mailing list