Bug 1095 - MPI enable configuration failed in Fedora
MPI enable configuration failed in Fedora
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: mpi
ns-3.10
PC Linux
: P3 blocker
Assigned To: George Riley
: bug
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-06 03:21 EDT by wxjeacen
Modified: 2012-07-11 11:06 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wxjeacen 2011-04-06 03:21:15 EDT
Hi Dears,

Here is the code for enable MPI in file wscript.
///
conf.find_program('mpic++', var='MPI')
    if Options.options.enable_mpi and conf.env['MPI']:
        p = subprocess.Popen([conf.env['MPI'], '-showme:comple'], stdout=subprocess.PIPE)
        flags = p.stdout.read().rstrip().split()
        p.wait()
        env.append_value("CXXFLAGS_MPI", flags)

///

However, the output of bash command "mpic++ -showme:compile" is not supported in fedora14.

And blocked compile error occurred list below, even I have installed mpic++.

/////
Waf: Entering directory `/home/Devil/linux/project/ns-3-dev/build'
[ 804/1526] cxx: src/mpi/model/distributed-simulator-impl.cc -> build/debug/src/mpi/model/distributed-simulator-impl_1.o
[ 805/1526] cxx: src/mpi/model/mpi-interface.cc -> build/debug/src/mpi/model/mpi-interface_1.o
../src/mpi/model/mpi-interface.cc:37:17: fatal error: mpi.h: No such file or directory
compilation terminated.
../src/mpi/model/distributed-simulator-impl.cc:35:17: fatal error: mpi.h: No such file or directory
compilation terminated.
Waf: Leaving directory `/home/Devil/linux/project/ns-3-dev/build'
Build failed:
 -> task failed (err #1): 
	{task: cxx mpi-interface.cc -> mpi-interface_1.o}
 -> task failed (err #1): 
	{task: cxx distributed-simulator-impl.cc -> distributed-simulator-impl_1.o}
///////////
Comment 1 Gustavo J. A. M. Carneiro 2011-04-06 06:40:29 EDT
What does the command "mpic++ -showme:compile" give as output.  What is its  return code (echo $?) ?
Comment 2 Gustavo J. A. M. Carneiro 2011-04-06 06:57:51 EDT
And what toolset you have, lam, openmpi, libmpich?  Can you try others and see if any works?
Comment 3 wxjeacen 2011-04-06 07:30:24 EDT
(In reply to comment #2)
> And what toolset you have, lam, openmpi, libmpich?  Can you try others and see
> if any works?

I have installed mpich2.
And I removed mpich2, and tried openmpi, conf.env[] did not find the mpic++,even the mpic++ has been installed under folder "/usr/lib/openmpi/bin"

I hard coded the path of mpi in wscript file of value conf.env['MPI'], and it worked, but, while running MPI related simulation, it reported libmpi_cxx.so can not found, even have add the library path to $LD_LIBRARY_PATH.

That is the torment of it.
Comment 4 wxjeacen 2011-04-06 22:24:50 EDT
Hi Dears,

Could u please provide solution for me ... 

I just can not fix it..
Comment 5 Gustavo J. A. M. Carneiro 2011-04-07 08:36:38 EDT
With openmpi installed, try:

MPI=/usr/lib/openmpi/bin/mpic++ ./waf configure --enable-mpi
Comment 6 Josh Pelkey 2011-04-25 11:15:29 EDT
Could the reporter comment on this one again? Is this still an issue? I'm thinking about closing this one.
Comment 7 Josh Pelkey 2011-04-25 11:16:18 EDT
Could the reporter comment on this one again? Is this still an issue? I'm thinking about closing this one.
Comment 8 Josh Pelkey 2011-04-25 11:17:02 EDT
Could the reporter comment on this one again? Is this still an issue? I'm thinking about closing this one.
Comment 9 Tom Henderson 2012-06-08 15:12:03 EDT
(In reply to comment #5)
> With openmpi installed, try:
> 
> MPI=/usr/lib/openmpi/bin/mpic++ ./waf configure --enable-mpi


I just tried this on a Fedora 17 buildslave, which has openmpi-devel installed (and mpic++ in /usr/lib/openmpi/bin/mpic++).

First, MPI is not auto-detected:

./waf configure --enable-mpi

 -------------------------------------------------------------------------
Checking for 'mpic++'
['mpic++', '-showme']
not found
from /home/buildslave/ns-3-allinone/ns-3-dev/src/mpi: The configuration failed
-------------------------------------------------------------------------
Checking for 'mpic++'
['mpic++', '-compile-info', '-link-info']
not found
from /home/buildslave/ns-3-allinone/ns-3-dev/src/mpi: The configuration failed
-------------------------------------------------------------------------

Next, Gustavo's tip above:

MPI=/usr/lib/openmpi/bin/mpic++ ./waf configure --enable-mpi

fails the same way.
Comment 10 Brian Swenson 2012-06-28 12:30:17 EDT
Hello

I installed Fedora 17 on a new virtual machine and grabbed a fresh copy of NS3.

I then install openmpi.

If I do this:
export PATH=$PATH:/usr/lib64/openmpi/bin

or

MPI=/usr/lib64/openmpi/bin/mpic++ ./waf --enable-mpi configure

I get this:

MPI Support : enabled

So is it a particular MPI script that isn't working or is it just a problem with installing MPI correctly?
Comment 11 Brian Swenson 2012-07-11 11:06:23 EDT
Updated MPI documentation to show how to set PATH and LD_LIBRARY_PATH for 32 and 64 bit linux distros