Boost logo

Boost Users :

Subject: [Boost-users] boost lib error
From: Jack Bryan (dtustudy68_at_[hidden])
Date: 2010-06-12 16:42:16


Hi, all:

I need to install boost library (/home/myname/boost_2010_6_8/boost_1_43_0).
http://www.boost.org/doc/libs/1_43_0/more/getting_started/index.html

It has MPI library :

http://www.boost.org/doc/libs/1_42_0/doc/html/mpi.html

After installingit, I compile some c++ program with calling for boost.MPI class, the compiler cannot find the header files in the program even though I have included the boost path in the compile command.

example:
------------------------------------------------------------------------
#include </boost/mpi/environment.hpp>
#include <boost/mpi/communicator.hpp>
#include <iostream>
namespace mpi = boost::mpi;

int main(int argc, char* argv[])
{
  mpi::environment env(argc, argv);
  mpi::communicator world;
  std::cout << "I am process " << world.rank() << " of " << world.size()
            << "." << std::endl;
  return 0;
}
--------------------------------------------------------------------------

 mpic++ -o testp2p test_p2p.cpp I/home/myname/boost_2010_6_8/boost_1_43_0
g++: I/home/myname/boost_2010_6_8/boost_1_43_0: No such file or directory
test_p2p.cpp:7:38: error: /boost/mpi/environment.hpp: No such file or directory
test_p2p.cpp:11:38: error: boost/mpi/communicator.hpp: No such file or directory

Actually, I have installed these header files in the directory.

I find a possible reason:
 When I built the package, it tells me that :

-----------------------------------------------------------------
-bash-3.2$ ./bjam

Building the Boost C++ Libraries.

warning: Building Boost.Regex with the optional Unicode/ICU support disabled.
note: Please refer to the Boost.Regex documentation for more information
note: this is a strictly optional feature.
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.

Component configuration:

    - date_time : building
    - filesystem : building
    - graph : building
    - graph_parallel : building
    - iostreams : building
    - math : building
    - mpi : building
    - program_options : building
    - python : building
    - random : building
    - regex : building
    - serialization : building
    - signals : building
    - system : building
    - test : building
    - thread : building
    - wave : building

...patience...
...patience...
...patience...
...found 6754 targets...

The Boost C++ Libraries were successfully built!

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
------------------------------------------------------------------------------------------

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 ?

Any help is appreciated.

Jack

June 11 2010
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4



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