[OMPI devel] undefined environ symbol on Darwin

2007-05-28 Thread Jack Howarth
   On MacOS X, the current v1.1.5 and v1.2.2 sources for openmpi
create shared libraries with undefined environ symbols. This
problem on MacOS X and the available workarounds are discussed
on the fink wiki section on Porting Notes...

http://wiki.finkproject.org/index.php/Fink:Porting_Notes

There are quite a number of source files which will need to
be patched to fix this. For example, openmpi 1.2.2 shows...

openmpi-1.2.2/ompi/communicator/comm_dyn.c:extern char **environ;
openmpi-1.2.2/opal/tools/wrappers/opal_wrapper.c:extern char **environ;
openmpi-1.2.2/orte/mca/odls/base/odls_private.h:ORTE_DECLSPEC int 
orte_odls_base_purge_environment(char ***environ);
openmpi-1.2.2/orte/mca/pls/bproc/pls_bproc.c:extern char **environ;
openmpi-1.2.2/orte/mca/pls/gridengine/pls_gridengine_module.c:extern char 
**environ;
openmpi-1.2.2/orte/mca/pls/poe/pls_poe_component.c:extern char **environ;
openmpi-1.2.2/orte/mca/pls/poe/pls_poe_module.c:extern char **environ;
openmpi-1.2.2/orte/mca/pls/rsh/pls_rsh_component.c:extern char **environ;
openmpi-1.2.2/orte/mca/pls/rsh/pls_rsh_component.c:extern char **environ;
openmpi-1.2.2/orte/mca/pls/rsh/pls_rsh_module.c:extern char **environ;
openmpi-1.2.2/orte/mca/pls/slurm/pls_slurm_module.c:extern char **environ;
openmpi-1.2.2/orte/mca/pls/tm/pls_tm_module.c:extern char **environ;
openmpi-1.2.2/orte/mca/pls/xgrid/src/pls_xgrid_client.m:char **environ;
openmpi-1.2.2/orte/mca/rmgr/base/rmgr_base_check_context.c:extern char 
**environ;
openmpi-1.2.2/orte/mca/sds/base/base.h: 
 char ***environ);
openmpi-1.2.2/orte/runtime/orte_setup_hnp.c:extern char **environ;
openmpi-1.2.2/orte/tools/orterun/totalview.c:extern char **environ;

I would suggest you look at the second approach proposed in the fink wiki
of modifying configure to check for the presence of the crt_externs.h
header and the _NSGetEnviron symbol directly.
   Jack
ps This issue arises when trying to build packages like paraview
which won't link its shared libraries due to the undefined environ symbol.
I would also note this issue is discussed at...

http://lists.apple.com/archives/Darwin-dev/2005/Mar/msg00132.html



Re: [OMPI devel] undefined environ symbol on Darwin

2007-05-28 Thread Jack Howarth
   I have been told that Paraview is one package that
exhibits this problem with undefined environ symbols.
This will occur in any package which creates its own
shared libraries that link in any openmpi shared library
that contains the undefined environ symbol. I think it
is unreasonably restrictive to force all the application
developers who use openmpi to avoid creating shared libs
that use openmpi shared libraries. Again from the
response on the Darwin mailing list this is expected
behavior on Darwin. I will send two patches shortly
that address this without needing to touch configure.
Jack


[OMPI devel] MacOS X v1.1.5 patch

2007-05-28 Thread Jack Howarth
The following patch, against openmpi v1.1.5, 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.1.5/ompi/communicator/comm_dyn.c 
openmpi-1.1.5.environ/ompi/communicator/comm_dyn.c
--- openmpi-1.1.5/ompi/communicator/comm_dyn.c  2007-05-27 20:27:37.0 
-0400
+++ openmpi-1.1.5.environ/ompi/communicator/comm_dyn.c  2007-05-27 
20:25:55.0 -0400
@@ -51,7 +51,12 @@

 #include "orte/runtime/runtime.h"

+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif

 int ompi_comm_connect_accept ( ompi_communicator_t *comm, int root,
orte_process_name_t *port, int send_first,
diff -uNr openmpi-1.1.5/opal/tools/wrappers/opal_wrapper.c 
openmpi-1.1.5.environ/opal/tools/wrappers/opal_wrapper.c
--- openmpi-1.1.5/opal/tools/wrappers/opal_wrapper.c2006-04-12 
12:12:06.0 -0400
+++ openmpi-1.1.5.environ/opal/tools/wrappers/opal_wrapper.c2007-05-27 
20:05:22.0 -0400
@@ -48,7 +48,12 @@
 #include "opal/util/path.h"
 #include "opal/util/few.h"

+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif

 struct {
 char *language;
diff -uNr openmpi-1.1.5/opal/util/opal_environ.c 
openmpi-1.1.5.environ/opal/util/opal_environ.c
--- openmpi-1.1.5/opal/util/opal_environ.c  2006-04-12 12:12:07.0 
-0400
+++ openmpi-1.1.5.environ/opal/util/opal_environ.c  2007-05-27 
20:07:07.0 -0400
@@ -26,7 +26,9 @@
 #include "opal/util/argv.h"
 #include "opal/util/opal_environ.h"
 #include "opal/constants.h"
-
+# ifdef __APPLE__
+#  include 
+# endif

 /*
  * Merge two environ-like char arrays, ensuring that there are no
@@ -93,7 +95,11 @@
 int i;
 char *newvalue, *compare;
 size_t len;
+# ifdef __APPLE__
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif

 /* Make the new value */

diff -uNr openmpi-1.1.5/orte/mca/pls/base/pls_base_context.c 
openmpi-1.1.5.environ/orte/mca/pls/base/pls_base_context.c
--- openmpi-1.1.5/orte/mca/pls/base/pls_base_context.c  2006-04-12 
12:12:33.0 -0400
+++ openmpi-1.1.5.environ/orte/mca/pls/base/pls_base_context.c  2007-05-27 
20:09:03.0 -0400
@@ -42,7 +42,12 @@
 #include "orte/mca/pls/base/base.h"
 #include "orte/mca/errmgr/errmgr.h"

+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif

 int orte_pls_base_check_context_cwd(orte_app_context_t *context,
 bool want_chdir)
diff -uNr openmpi-1.1.5/orte/mca/pls/bproc/pls_bproc.c 
openmpi-1.1.5.environ/orte/mca/pls/bproc/pls_bproc.c
--- openmpi-1.1.5/orte/mca/pls/bproc/pls_bproc.c2006-09-19 
04:51:59.0 -0400
+++ openmpi-1.1.5.environ/orte/mca/pls/bproc/pls_bproc.c2007-05-27 
20:09:50.0 -0400
@@ -73,7 +73,12 @@
 /**
  * Our current evironment
  */
+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif

 #if OMPI_HAVE_POSIX_THREADS && OMPI_THREADS_HAVE_DIFFERENT_PIDS
 int orte_pls_bproc_launch_threaded(orte_jobid_t);
diff -uNr openmpi-1.1.5/orte/mca/pls/fork/pls_fork_module.c 
openmpi-1.1.5.environ/orte/mca/pls/fork/pls_fork_module.c
--- openmpi-1.1.5/orte/mca/pls/fork/pls_fork_module.c   2006-10-10 
09:58:48.0 -0400
+++ openmpi-1.1.5.environ/orte/mca/pls/fork/pls_fork_module.c   2007-05-27 
20:10:35.0 -0400
@@ -76,7 +76,12 @@
 #include "orte/mca/soh/base/base.h"
 #include "orte/mca/pls/fork/pls_fork.h"

+# ifdef __APPLE__
+#  include 
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif

 #if OMPI_HAVE_POSIX_THREADS && OMPI_THREADS_HAVE_DIFFERENT_PIDS && 
OMPI_ENABLE_PROGRESS_THREADS
 static int orte_pls_fork_launch_threaded(orte_jobid_t);
diff -uNr openmpi-1.1.5/orte/mca/pls/poe/pls_poe_component.c 
openmpi-1.1.5.environ/orte/mca/pls/poe/pls_poe_component.c
--- openmpi-1.1.5/orte/mca/pls/poe/pls_poe_component.c  2006-04-12 
12:12:33.0 -0400
+++ openmpi-1.1.5.environ/orte/mca/pls/poe/pls_poe_component.c  2007-05-27 
20:12:18.0 -0400
@@ -31,6 +31,9 @@
 #include "opal/util/argv.h"
 #include "opal/mca/base/mca_base_param.h"

+# ifdef __APPLE__
+#  include 
+# endif

 /*
  * Public string showing the pls ompi_poe component version number
@@ -156,7 +159,11 @@
 */
 orte_pls_base_module_t *orte_pls_poe_component_init(int *priority)
 {
+# ifdef __APPLE__
+#  define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif
 mca_pls_poe_component.path = 
opal_path_findv(mca_pls_poe_component.argv[0], 0, environ, NULL);
 if (NULL == mca_pls_poe_component.path) {
 return NULL;
diff -uNr openmpi-1.1.5/orte/mca/pls/poe/pls_poe_module.c 
openmpi-1.1.5.environ/orte/mca/pls/poe/pls_poe_module.c
--- openmpi-1.1.5/orte/mca/pl

[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 +45,1

[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__)
+# i

Re: [OMPI devel] undefined environ symbol on Darwin

2007-05-28 Thread Jack Howarth
Brian,
If you Google "crt_externs.h darwin", you will see that this approach
is very widely used for many packages include wine, 4Suite, ruby, etc.
We can take this over to the darwin developer mailing list but they
will tell you the same thing I am. It is bad form to create shared
libraries with undefined symbols that have to be created as a special
case. Better to handle that in the shared library than to inflict that
onto the developer using it.
 Jack


Re: [OMPI devel] undefined environ symbol on Darwin

2007-05-28 Thread Jack Howarth
Brian,
One general example of why openmpi shouldn't be creating
shared libraries with undefined environ symbols is as follows.
If a python based application was using the openmpi shared libraries
linked into the application's python module, your suggested
approach would be unusable since the user would have to rebuild
python to explicitly provide the missing environ symbol. You
will always run into such corner cases as long as openmpi is
misbuilt on darwin.
 Jack
ps I have posted this issue to Apple's radar bug reporter
as issue 5233061 as well.



Re: [OMPI devel] undefined environ symbol on Darwin

2007-05-29 Thread Jack Howarth
Brian,
Below is the response I got from the fink developer
who was trying to package paraview and ran into this
problem with the undefined environ symbol in openmpi.
I have also emailed on darwin-dev to get a clarification
on this issue. However your argument against target
specific chances is rather ironic considering openmpi
already has wrappers for Windows on those lines of code.
I've attached the error that is seen while compiling paraview. 
 Jack

---

I tried several patches to the paraview build scripts in order to get
rid of this undefined symbol, but I was not successful, one reason being
that the build process uses cmake which I find much less transparent
than the usual configure/libtool combination.

While looking through the build script, I see now that in fact there is
a difference between the linker command for this library
libicet_mpi.dylib and many other dylibs built in paraview, for example
libvtkParallel.pv2.6.dylib. Those use an explicit
-Wl,-flat_namespace,-U,_environ linker flag. Could it be that this is
there in order to avoid exactly this problem? I don't know. I'll look
some more where this comes from.

Here the error:

cd
/sw_unstable/src/fink.build/paraview-mpi-openmpi-2.6.1-1001/paraview-mpi-openmpi-darwin/Utilities/IceT/src/communication
&& /sw/bin/cmake -E cmake_link_script CMakeFiles/icet_mpi.dir/link.txt
--verbose=1
/sw/bin/gcc-O3 -DNDEBUG -dynamiclib -headerpad_max_install_names
-Wl,-search_paths_first -o ../../../../bin/libicet_mpi.dylib
-install_name /sw/lib/paraview-2.6/libicet_mpi.dylib
"CMakeFiles/icet_mpi.dir/mpi.o"
-L/sw_unstable/src/fink.build/paraview-mpi-openmpi-2.6.1-1001/paraview-mpi-openmpi-darwin/bin
-L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lGL -L/sw/lib/openmpi -lmpi
-lmpi_cxx -licet -L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lGL
-L/sw/lib/openmpi -lmpi -lmpi_cxx
ld: Undefined symbols:
_environ
/usr/bin/libtool: internal link edit command failed
make[2]: *** [bin/libicet_mpi.dylib] Error 1




Re: [OMPI devel] undefined environ symbol on Darwin

2007-05-29 Thread Jack Howarth
Ralph,
I don't know why such patches should be harder to
maintain in Windows than on Darwin. All you do is
the equivalent to...

cd /sw/lib/openmpi/lib
nm * | grep environ

and if you see environ undefined, identify which library
it is in and which object file it came from. I would also
note that my patch reveals that several instances of the
environ variable being declared that are missing the Windows
wrappers. So if anything, adding the Darwin patch will
increase the probability that both targets are properly
maintained.
 Jack