--- a/src/mpi/model/mpi-interface.h Sun Sep 25 15:53:14 2011 +0100
+++ b/src/mpi/model/mpi-interface.h Sun Sep 25 16:28:09 2011 +0100
@@ -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 {
--- a/src/mpi/wscript Sun Sep 25 15:53:14 2011 +0100
+++ b/src/mpi/wscript Sun Sep 25 16:28:09 2011 +0100
@@ -6,8 +6,18 @@
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: