Boost logo

Boost Users :

Subject: Re: [Boost-users] boost MPI error
From: Riccardo Murri (riccardo.murri_at_[hidden])
Date: 2010-06-13 15:38:40


Hi Jack,

actually bjam is giving you a hint about what you should add to your
compiler command line:

On Sun, Jun 13, 2010 at 8:25 PM, Jack Bryan <dtustudy68_at_[hidden]> wrote:
> The following directory should be added to compiler include paths:
>
>     /lustre/jxding/boost_2010_6_8/boost_1_43_0
>
> The following directory should be added to linker library paths:
>
>     /lustre/jxding/boost_2010_6_8/boost_1_43_0/stage/lib

g++ option "-I" adds a directory to the include path and option "-L"
adds a directory to the linker library path; in addition to that, to
produce the actual executable file, you'll need to link against the
"boost_mpi" and "boost_serialization" libraries: libraries are
specified using the compiler's "-l" option.

So, I'd guess that you need to invoke the mpic++ compiler this way::

  mpic++ -o testp2p test_p2p.cpp \
    -I/lustre/jxding/boost_2010_6_8/boost_1_43_0 \
    -L/lustre/jxding/boost_2010_6_8/boost_1_43_0/stage/lib \
    -lboost_mpi -lboost_serialization

> It seems that I need to specify I need to use mpi for the bjam builder.
>
> But, I have added  "using mpi ;" and  "using mpi :
> /opt/openmpi-gnu/bin/mpic++ ;" in the file
> /home/myname/boost_2010_6_8/boost_1_43_0/user-config.jam.
>
> I have also added it in the file
> /home/myname/boost_2010_6_8/boost_1_43_0/tools/build/v2/user-config.jam.
>
> But, I still got the same error. It seems that there is something wrong with
> the package ?
> or the compiler cannot understand the "using mpi ;" in the user-config.jam ?
>

I had to add the "using mpi ;" line to the file "project-config.jam";
creating a "user-config.jam" did not work for me (but I didn't really
look into the issue, so likely I did something wrong).

Anyway, there is a simple check to see if the Boost.MPI library has
been built: search for a file named "libboost_mpi.a" into
/lustre/jxding/boost_2010_6_8/boost_1_43_0/stage/lib (or whatever
directory "bjam" suggests that you add to the linker library path).
If the file is there, MPI support has been built.

Best regards,
Riccardo

-- 
Riccardo Murri, Hadlaubstr. 150, 8006 Zürich (CH)

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net