[OMPI devel] MacOS X v1.2.2 patch (corrected)

2007-05-28 Thread Jack Howarth
This is the previous patch for 1.2.2 again with a minor typo fixed.
One of the ifdef's was missing an underscore.
   Jack


diff -uNr openmpi-1.2.2/ompi/communicator/comm_dyn.c 
openmpi-1.2.2.environ/ompi/communicator/comm_dyn.c
--- openmpi-1.2.2/ompi/communicator/comm_dyn.c  2007-01-24 13:16:09.0 
-0500
+++ openmpi-1.2.2.environ/ompi/communicator/comm_dyn.c  2007-05-28 
16:08:20.0 -0400
@@ -59,7 +59,12 @@
 #include "orte/runtime/runtime.h"

 #if !defined(__WINDOWS__)
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif
 #endif  /* !defined(__WINDOWS__) */

 static int ompi_comm_get_rport (orte_process_name_t *port,
diff -uNr openmpi-1.2.2/opal/mca/memory/ptmalloc2/arena.c 
openmpi-1.2.2.environ/opal/mca/memory/ptmalloc2/arena.c
--- openmpi-1.2.2/opal/mca/memory/ptmalloc2/arena.c 2006-11-09 
13:53:28.0 -0500
+++ openmpi-1.2.2.environ/opal/mca/memory/ptmalloc2/arena.c 2007-05-28 
17:50:12.0 -0400
@@ -293,7 +293,12 @@
 /* Initialization routine. */
 #ifdef _LIBC
 #include 
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **_environ;
+# endif

 static char *
 internal_function
diff -uNr openmpi-1.2.2/opal/tools/wrappers/opal_wrapper.c 
openmpi-1.2.2.environ/opal/tools/wrappers/opal_wrapper.c
--- openmpi-1.2.2/opal/tools/wrappers/opal_wrapper.c2007-04-19 
12:30:53.0 -0400
+++ openmpi-1.2.2.environ/opal/tools/wrappers/opal_wrapper.c2007-05-28 
16:09:20.0 -0400
@@ -52,7 +52,12 @@
 #include "opal/util/os_path.h"

 #if !defined(__WINDOWS__)
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif
 #define OPAL_INCLUDE_FLAG  "-I"
 #define OPAL_LIBDIR_FLAG   "-L"
 #else
diff -uNr openmpi-1.2.2/opal/util/opal_environ.c 
openmpi-1.2.2.environ/opal/util/opal_environ.c
--- openmpi-1.2.2/opal/util/opal_environ.c  2007-04-19 12:30:53.0 
-0400
+++ openmpi-1.2.2.environ/opal/util/opal_environ.c  2007-05-28 
17:43:50.0 -0400
@@ -28,7 +28,12 @@
 #include "opal/constants.h"

 #if !defined(__WINDOWS__)
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char** environ;
+# endif
 #endif  /* !defined(__WINDOWS__) */

 /*
diff -uNr openmpi-1.2.2/orte/mca/pls/bproc/pls_bproc.c 
openmpi-1.2.2.environ/orte/mca/pls/bproc/pls_bproc.c
--- openmpi-1.2.2/orte/mca/pls/bproc/pls_bproc.c2007-04-19 
12:30:57.0 -0400
+++ openmpi-1.2.2.environ/orte/mca/pls/bproc/pls_bproc.c2007-05-28 
16:10:37.0 -0400
@@ -81,7 +81,12 @@
 /**
  * Our current evironment
  */
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif

 static bool daemons_launched;
 static bool bynode;
diff -uNr openmpi-1.2.2/orte/mca/pls/gridengine/pls_gridengine_module.c 
openmpi-1.2.2.environ/orte/mca/pls/gridengine/pls_gridengine_module.c
--- openmpi-1.2.2/orte/mca/pls/gridengine/pls_gridengine_module.c   
2007-04-19 12:30:57.0 -0400
+++ openmpi-1.2.2.environ/orte/mca/pls/gridengine/pls_gridengine_module.c   
2007-05-28 16:11:25.0 -0400
@@ -90,7 +90,12 @@
 #include "orte/mca/pls/gridengine/pls_gridengine.h"

 #if !defined(__WINDOWS__)
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif
 #endif  /* !defined(__WINDOWS__) */

 orte_pls_base_module_t orte_pls_gridengine_module = {
diff -uNr openmpi-1.2.2/orte/mca/pls/poe/pls_poe_component.c 
openmpi-1.2.2.environ/orte/mca/pls/poe/pls_poe_component.c
--- openmpi-1.2.2/orte/mca/pls/poe/pls_poe_component.c  2006-11-09 
13:54:09.0 -0500
+++ openmpi-1.2.2.environ/orte/mca/pls/poe/pls_poe_component.c  2007-05-28 
16:12:09.0 -0400
@@ -153,7 +153,12 @@
 }

 #if !defined(__WINDOWS__)
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif
 #endif  /* !defined(__WINDOWS__) */

 /**
diff -uNr openmpi-1.2.2/orte/mca/pls/poe/pls_poe_module.c 
openmpi-1.2.2.environ/orte/mca/pls/poe/pls_poe_module.c
--- openmpi-1.2.2/orte/mca/pls/poe/pls_poe_module.c 2007-02-16 
13:20:49.0 -0500
+++ openmpi-1.2.2.environ/orte/mca/pls/poe/pls_poe_module.c 2007-05-28 
16:12:53.0 -0400
@@ -56,7 +56,12 @@
 #include "orte/mca/pls/poe/pls_poe.h"

 #if !defined(__WINDOWS__)
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif
 #endif  /* !defined(__WINDOWS__) */

 /*
diff -uNr openmpi-1.2.2/orte/mca/pls/rsh/pls_rsh_component.c 
openmpi-1.2.2.environ/orte/mca/pls/rsh/pls_rsh_component.c
--- openmpi-1.2.2/orte/mca/pls/rsh/pls_rsh_component.c  2007-01-13 
21:39:47.0 -0500
+++ openmpi-1.2.2.environ/orte/mca/pls/rsh/pls_rsh_component.c  2007-05-28 
16:14:15.0 -0400
@@ -45,7 +45,12 @@
 #include "orte/mca/pls/rsh/pls_rsh.h"

 #if !defined(__WINDOWS__)
+# 

[OMPI devel] MacOS X v1.2.2 patch

2007-05-28 Thread Jack Howarth
The following patch, against openmpi v1.2.2, prevents undefined environ symbols 
in the openmpi shared libraries
on MacOS X. This approach avoids the need to modifiy the configure scripts. 
   Jack


diff -uNr openmpi-1.2.2/ompi/communicator/comm_dyn.c 
openmpi-1.2.2.environ/ompi/communicator/comm_dyn.c
--- openmpi-1.2.2/ompi/communicator/comm_dyn.c  2007-01-24 13:16:09.0 
-0500
+++ openmpi-1.2.2.environ/ompi/communicator/comm_dyn.c  2007-05-28 
16:08:20.0 -0400
@@ -59,7 +59,12 @@
 #include "orte/runtime/runtime.h"

 #if !defined(__WINDOWS__)
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif
 #endif  /* !defined(__WINDOWS__) */

 static int ompi_comm_get_rport (orte_process_name_t *port,
diff -uNr openmpi-1.2.2/opal/mca/memory/ptmalloc2/arena.c 
openmpi-1.2.2.environ/opal/mca/memory/ptmalloc2/arena.c
--- openmpi-1.2.2/opal/mca/memory/ptmalloc2/arena.c 2006-11-09 
13:53:28.0 -0500
+++ openmpi-1.2.2.environ/opal/mca/memory/ptmalloc2/arena.c 2007-05-28 
17:50:12.0 -0400
@@ -293,7 +293,12 @@
 /* Initialization routine. */
 #ifdef _LIBC
 #include 
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **_environ;
+# endif

 static char *
 internal_function
diff -uNr openmpi-1.2.2/opal/tools/wrappers/opal_wrapper.c 
openmpi-1.2.2.environ/opal/tools/wrappers/opal_wrapper.c
--- openmpi-1.2.2/opal/tools/wrappers/opal_wrapper.c2007-04-19 
12:30:53.0 -0400
+++ openmpi-1.2.2.environ/opal/tools/wrappers/opal_wrapper.c2007-05-28 
16:09:20.0 -0400
@@ -52,7 +52,12 @@
 #include "opal/util/os_path.h"

 #if !defined(__WINDOWS__)
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif
 #define OPAL_INCLUDE_FLAG  "-I"
 #define OPAL_LIBDIR_FLAG   "-L"
 #else
diff -uNr openmpi-1.2.2/opal/util/opal_environ.c 
openmpi-1.2.2.environ/opal/util/opal_environ.c
--- openmpi-1.2.2/opal/util/opal_environ.c  2007-04-19 12:30:53.0 
-0400
+++ openmpi-1.2.2.environ/opal/util/opal_environ.c  2007-05-28 
17:43:50.0 -0400
@@ -28,7 +28,12 @@
 #include "opal/constants.h"

 #if !defined(__WINDOWS__)
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char** environ;
+# endif
 #endif  /* !defined(__WINDOWS__) */

 /*
diff -uNr openmpi-1.2.2/orte/mca/pls/bproc/pls_bproc.c 
openmpi-1.2.2.environ/orte/mca/pls/bproc/pls_bproc.c
--- openmpi-1.2.2/orte/mca/pls/bproc/pls_bproc.c2007-04-19 
12:30:57.0 -0400
+++ openmpi-1.2.2.environ/orte/mca/pls/bproc/pls_bproc.c2007-05-28 
16:10:37.0 -0400
@@ -81,7 +81,12 @@
 /**
  * Our current evironment
  */
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif

 static bool daemons_launched;
 static bool bynode;
diff -uNr openmpi-1.2.2/orte/mca/pls/gridengine/pls_gridengine_module.c 
openmpi-1.2.2.environ/orte/mca/pls/gridengine/pls_gridengine_module.c
--- openmpi-1.2.2/orte/mca/pls/gridengine/pls_gridengine_module.c   
2007-04-19 12:30:57.0 -0400
+++ openmpi-1.2.2.environ/orte/mca/pls/gridengine/pls_gridengine_module.c   
2007-05-28 16:11:25.0 -0400
@@ -90,7 +90,12 @@
 #include "orte/mca/pls/gridengine/pls_gridengine.h"

 #if !defined(__WINDOWS__)
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif
 #endif  /* !defined(__WINDOWS__) */

 orte_pls_base_module_t orte_pls_gridengine_module = {
diff -uNr openmpi-1.2.2/orte/mca/pls/poe/pls_poe_component.c 
openmpi-1.2.2.environ/orte/mca/pls/poe/pls_poe_component.c
--- openmpi-1.2.2/orte/mca/pls/poe/pls_poe_component.c  2006-11-09 
13:54:09.0 -0500
+++ openmpi-1.2.2.environ/orte/mca/pls/poe/pls_poe_component.c  2007-05-28 
16:12:09.0 -0400
@@ -153,7 +153,12 @@
 }

 #if !defined(__WINDOWS__)
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif
 #endif  /* !defined(__WINDOWS__) */

 /**
diff -uNr openmpi-1.2.2/orte/mca/pls/poe/pls_poe_module.c 
openmpi-1.2.2.environ/orte/mca/pls/poe/pls_poe_module.c
--- openmpi-1.2.2/orte/mca/pls/poe/pls_poe_module.c 2007-02-16 
13:20:49.0 -0500
+++ openmpi-1.2.2.environ/orte/mca/pls/poe/pls_poe_module.c 2007-05-28 
16:12:53.0 -0400
@@ -56,7 +56,12 @@
 #include "orte/mca/pls/poe/pls_poe.h"

 #if !defined(__WINDOWS__)
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif
 #endif  /* !defined(__WINDOWS__) */

 /*
diff -uNr openmpi-1.2.2/orte/mca/pls/rsh/pls_rsh_component.c 
openmpi-1.2.2.environ/orte/mca/pls/rsh/pls_rsh_component.c
--- openmpi-1.2.2/orte/mca/pls/rsh/pls_rsh_component.c  2007-01-13 
21:39:47.0 -0500
+++ openmpi-1.2.2.environ/orte/mca/pls/rsh/pls_rsh_component.c  2007-05-28 
16:14:15.0 -0400
@@ -45,7