On Feb 7, 2006, at 5:37 PM, Bill Saphir wrote:
In an attempt to limit runtime dependencies, I am using static
libraries
where possible. Under OSX (10.4.4) I get the following error when I
try to
link my application:
/usr/bin/ld: multiple definitions of symbol _munmap
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../../libSystem.dylib
(munmap.So)
definition of _munmap
[path-to-mpi-libs]/libopal.a(memory_darwin_component.o) definition of
_munmap in section (__TEXT,__text)
I have configured R8901 with --disable-shared and --enable-static
(I have also tried --with-memory-manager=none, with no effect).
Can you send the output of configure (and the config.log file) from a
build where you tried with the --with-memory-manager=none flag? That
should most definitely remove this issue (at the cost of slightly
slower communication when buffer reuse is high). I couldn't make the
memory manager component for OS X build when I specified that flag,
but it's possible I missed something obvious along the way.
If I understand correctly, openmpi's munmap depends on munmap being
a weak
symbol. But according to nm -mg, munmap is not a weak symbol in
libSystem.dylib (a.k.a. libc.dylib). In fact there aren't any weak
symbols
in this library.
It would seem that this is technically a problem with shared
libraries as
well, but it would only be detected at run time because there is so
much
indirection (empirically, there is no problem problem with dynamic
libraries, though).
Any ideas on a solution to this problem?
Darwin unfortunately doesn't support the concept of weak symbols in
quite the same way as Linux. Thankfully, the issue above isn't
generally an error, but a warning. Are you using the wrapper
compilers to build your application? I believe we add the correct
linker flags to make Darwin not complain about the duplicate symbols
and (more importantly) load the libraries in the correct order so
that our munamp (which eventually calls Darwin's munmap) is preferred
by the user's application. If you are using the wrapper compilers,
can you run "mpicc -showme" and send the results to me? If you
aren't using the wrapper compilers, try adding the following to your
link flags:
-Wl,-u,_munmap -Wl,-multiply_defined,suppress
that should do the right magic to make the linker more happy.
Brian
--
Brian Barrett
Open MPI developer
http://www.open-mpi.org/