[Ns-developers] Building MPI with waf
Gustavo Carneiro
gjcarneiro at gmail.com
Fri Dec 18 08:18:20 PST 2009
2009/12/17 <jpelkey at gatech.edu>
> Hi all,
>
> I need some help with one issue I am having trying to build our new MPI
> code with waf. We have added a new switch at the command line to enable mpi
> "--enable-mpi". Now, if this is selected, waf checks to make sure that the
> mpic++ compiler is installed on the system. If it is not, the build stops
> (as expected). It also expects the CXX variable to be set to the path of
> mpic++. mpic++ is simply a wrapper around the underlying C++ compiler and
> is needed to compile MPI specific code. If CXX is not set to the path of
> mpic++, it does not continue with the build (and it tells you what is
> wrong). I would like to be able to handle setting CXX automatically, or as
> Gustavo has suggested previously, using mpic++ on only the files that need
> it when --enable-mpi is selected.
>
> I have tried a few things in the wscript to try and set CXX to the path of
> mpic++ when --enable-mpi is selected and mpic++ is found. I haven't been
> able to get it to work. Could someone guide me on how this could be done?
> As I see it, there should be two ways to accomplish what I'm trying to do:
>
> 1) When --enable-mpi is selected, make sure mpic++ is there (already done),
> and set CXX to the path of mpic++ and let mpic++ compile everything
>
> 2) Pick and choose which files should be compiled with CXX. If
> --enable-mpi wasn't selected, it doesn't need to compile the MPI specific
> files. If it is, then it could use mpic++ to compile the appropriate files.
> Here is a list of the files that
> need mpic++:
> -- examples/mpi/simple-dist.cc
> -- examples/mpi/nms-udp-nix.cc
> -- src/simulator/mpi-interface.cc/h
> -- src/simulator/distributed-simulator-impl.cc/h
>
> The code can be found in mercurial here:
> http://code.nsnam.org/jpelkey3/ns-3-distributed/
>
>
Here's a patch that you can use that does not modify CXX, only adds
compilation/link flags where appropriate. It is better not to override CXX
because the user may want to compile NS-3 with a specific version of the
compiler and CXX env. var. is the normal way to do it.
> Thank you for any help,
>
> Josh Pelkey
>
--
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 1613 bytes
Desc: not available
Url : http://mailman.isi.edu/pipermail/ns-developers/attachments/20091218/4bd1ce97/p.bin
More information about the Ns-developers
mailing list