[mpi] SEEK_* defined, but shouldn't be

A common problem that occurs when building mpich2 is that SEEK_SET, SEEK_CUR, and SEEK_END are all defined. mpich2 (specifically mpicxx.h) requires them to be unset to avoid problems caused by both the MPI interface and stdio using them. Anyway, the suggested solution is to #undef each macro before #include <mpi.h>. I tried that in the mpi library, and it still failed to build. I also tried adding <define>MPICH_IGNORE_CXX_SEEK=1 to the mpi Jamfile. Alas, it didn't fix the problem either. The failure occurs when building release/threading-multi/collective.o How are users of mpich2+boost::mpi getting around this problem? -- Benjamin A. Collins <aggieben@gmail.com> http://bloggoergosum.us

Try adding the following line to your "user-config.jam" before running bjam using gcc : : : <cxxflags>-DMPICH_IGNORE_CXX_SEEK ; Cheers, -- Aydin Benjamin Collins wrote:
A common problem that occurs when building mpich2 is that SEEK_SET, SEEK_CUR, and SEEK_END are all defined. mpich2 (specifically mpicxx.h) requires them to be unset to avoid problems caused by both the MPI interface and stdio using them.
Anyway, the suggested solution is to #undef each macro before #include <mpi.h>. I tried that in the mpi library, and it still failed to build. I also tried adding <define>MPICH_IGNORE_CXX_SEEK=1 to the mpi Jamfile. Alas, it didn't fix the problem either. The failure occurs when building release/threading-multi/collective.o
How are users of mpich2+boost::mpi getting around this problem?
-- Benjamin A. Collins <aggieben@gmail.com> http://bloggoergosum.us _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- View this message in context: http://www.nabble.com/-mpi--SEEK_*-defined%2C-but-shouldn%27t-be-tf4657004.h... Sent from the Boost - Dev mailing list archive at Nabble.com.

On Oct 20, 2007, at 2:23 AM, Benjamin Collins wrote:
A common problem that occurs when building mpich2 is that SEEK_SET, SEEK_CUR, and SEEK_END are all defined. mpich2 (specifically mpicxx.h) requires them to be unset to avoid problems caused by both the MPI interface and stdio using them.
Thanks for pointing this out. This trips me up every time I use MPICH2, because after fixing the problem I forget again :)
Anyway, the suggested solution is to #undef each macro before #include <mpi.h>. I tried that in the mpi library, and it still failed to build. I also tried adding <define>MPICH_IGNORE_CXX_SEEK=1 to the mpi Jamfile. Alas, it didn't fix the problem either. The failure occurs when building release/threading-multi/collective.o
How about putting a #define MPICH_IGNORE_CXX_SEEK 1 at the top of boost/mpi/config.hpp, before the inclusion of mpi.h? If that works for you, I'll go ahead and make the change in Subversion. I'd normally just test this myself, but I don't have easy access to an MPICH2 installation at the moment. - Doug

Sorry if this turns out to be a dup, but I think my original message got bounced by the list bouncer. On Oct 22, 2007 10:10 AM, Douglas Gregor <dgregor@osl.iu.edu> wrote:
How about putting a
#define MPICH_IGNORE_CXX_SEEK 1
at the top of boost/mpi/config.hpp, before the inclusion of mpi.h?
If that works for you, I'll go ahead and make the change in Subversion. I'd normally just test this myself, but I don't have easy access to an MPICH2 installation at the moment.
IAydin's suggestion to add that flag to the global <cxxflags> fixes the problems, but that's not necessarily the solution to hang your hat on - it should work out of the box (albeit the user may have to add the path to his mpicxx wrapper anyway). I tried your suggestion, but it didn't work. I tracked down the problem to three files that are including mpi.h directly, but not including boost/mpi/config.hpp: ./boost/mpi/detail/packed_oprimitive.hpp ./boost/mpi/detail/packed_iprimitive.hpp ./boost/mpi/detail/mpi_datatype_primitive.hpp I've submitted two patches tha define MPICH_IGNORE_CXX_SEEK in those three files and in boost/mpi/config.hpp. Ticket #1486, here: http://svn.boost.org/trac/boost/ticket/1486 -- Benjamin A. Collins <ben.collins@acm.org> http://bloggoergosum.us

On Dec 3, 2007, at 5:21 PM, Benjamin Collins wrote:
I've submitted two patches tha define MPICH_IGNORE_CXX_SEEK in those three files and in boost/mpi/config.hpp.
Ticket #1486, here: http://svn.boost.org/trac/boost/ticket/1486
Just FYI, I applied something very similar to these patches to fix the problem. Thanks again for pointing it out and coming up with the fix. - Doug
participants (3)
-
aydozz
-
Benjamin Collins
-
Douglas Gregor