Bug 1137 - mpi module is hard-coded for openmpi

This commit is contained in:
Gustavo J. A. M. Carneiro
2011-09-25 16:28:09 +01:00
parent ab4feb7bb4
commit 35f0a9aaae
2 changed files with 16 additions and 2 deletions

View File

@@ -28,8 +28,12 @@
#include "ns3/nstime.h"
#include "ns3/buffer.h"
#if defined(NS3_OPENMPI)
struct ompi_request_t;
typedef struct ompi_request_t* MPI_Request;
#elif defined(NS3_MPICH)
typedef int MPI_Request;
#endif
namespace ns3 {

View File

@@ -6,8 +6,18 @@ from waflib.Errors import WafError
def configure(conf):
if Options.options.enable_mpi:
if conf.check_cfg(path='mpic++', args='-showme',
package='', uselib_store='MPI', mandatory=False):
# try to detect openmpi installation
mpi = conf.check_cfg(path='mpic++', args='-showme',
package='', uselib_store='MPI', mandatory=False)
if mpi:
conf.env.append_value('DEFINES_MPI', 'NS3_OPENMPI')
else:
# try the MPICH2 flags
mpi = conf.check_cfg(path='mpic++', args='-compile-info -link-info',
package='', uselib_store='MPI', mandatory=False)
if mpi:
conf.env.append_value('DEFINES_MPI', 'NS3_MPICH')
if mpi:
conf.env.append_value('DEFINES_MPI', 'NS3_MPI')
conf.env['ENABLE_MPI'] = True
for libpath in conf.env.LIBPATH_MPI: