Opened 14 years ago

Closed 10 years ago

#26424 closed defect (fixed)

valgrind +openmpi doesn't provide promised "libmpiwrap-<platform>.so" file

Reported by: nilstec_inc@… Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc:
Port: valgrind-devel

Description

I do:

sudo port clean valgrind-devel
sudo port -d install valgrind-devel +openmpi

In the output of the configure the following two lines appear:

checking primary target for usable MPI2-compliant C compiler and mpi.h... no
checking secondary target for usable MPI2-compliant C compiler and mpi.h... no

According to the Valgrind User Manual it should say yes, mpicc, right? I'll supply the output of sudo port -d install valgrind-devel +openmpi. Thanks for your help!

Attachments (2)

valgrind_devel_output.txt (696.5 KB) - added by nilstec_inc@… 14 years ago.
Output of sudo port -v install valgrind-devel +openmpi
error-in-dynamic-libs.txt (2.7 KB) - added by nilstec_inc@… 14 years ago.
Output of openmpirun -np 2 /opt/local/bin/valgrind ./a.out

Download all attachments as: .zip

Change History (10)

Changed 14 years ago by nilstec_inc@…

Attachment: valgrind_devel_output.txt added

Output of sudo port -v install valgrind-devel +openmpi

comment:1 Changed 14 years ago by raimue (Rainer Müller)

Cc: raimue@… removed
Owner: changed from macports-tickets@… to raimue@…
Status: newassigned

comment:2 Changed 14 years ago by raimue (Rainer Müller)

That's my fault, openmpi actually installs as ${prefix}/bin/openmpicc while the variant expected ${prefix}/bin/mpicc. I guess I missed this in my testing as configure went over this without reporting any error. Committed a fix in r71354. So at least openmpi is detected now.

But additionally, there is another bug that leaves this broken. It requires both i386 and x86_64 architectures in openmpi libraries at the moment as valgrind builds for both architectures by default. These are not available through MacPorts, as openmpi does not offer a +universal variant. I am working on a fix.

comment:3 Changed 14 years ago by raimue (Rainer Müller)

Resolution: fixed
Status: assignedclosed

Should be working now with +openmpi after r71356. Now the library is installed as expected at /opt/local/lib/valgrind/libmpiwrap-amd64-darwin.so.

Issue these commands to get the changes:

sudo port selfupdate
sudo port upgrade --enforce-variants valgrind-devel +openmpi

comment:4 Changed 14 years ago by nilstec_inc@…

Wow! Thanks for the quick help. After following your advice, i do indeed get my libmpiwrap-amd64-darwin.so. I do not know, if this belongs here, or if it is some others concern, but i'll just post it and you can feel free to ignore it ;). I tried to follow the procedure given in the Valgrind User Manual with a MPI Hello World example. Sadly i didn't see

valgrind MPI wrappers 31901: Active for pid 31901
valgrind MPI wrappers 31901: Try MPIWRAP_DEBUG=help for possible options

so i tried linking with the library:

openmpicc testMPI.c /opt/local/lib/valgrind/libmpiwrap-amd64-darwin.so

which completes, but upon calling

openmpirun -np 2 /opt/local/bin/valgrind ./a.out

i get an error which i'll supply. It complains about not loaded dynamic libraries. So if you've got any idea, thanks for your help!

Changed 14 years ago by nilstec_inc@…

Attachment: error-in-dynamic-libs.txt added

Output of openmpirun -np 2 /opt/local/bin/valgrind ./a.out

comment:5 Changed 14 years ago by raimue (Rainer Müller)

/opt/local/lib/valgrind is not in the default search path of the linker, therefore this fails. The user manual shows using LD_PRELOAD to insert the library, but that is Linux specific.

There are two options:

  • Use export DYLD_INSERT_LIBRARIES=/opt/local/lib/valgrind/libmpiwrap-amd64-darwin.so before you call openmpirun. For this, you do not need to link your library.
  • Link against libmpiwrap-amd64-darwin.so and use export DYLD_LIBRARY_PATH=/opt/local/lib/valgrind/ before you call openmpirun.

comment:6 Changed 13 years ago by nilstec_inc@…

That's it, thank you very very much for your help!

comment:7 in reply to:  6 Changed 13 years ago by mike.hui.zhang@…

Resolution: fixed
Status: closedreopened

Replying to nilstec_inc@…:

That's it, thank you very very much for your help!

Hi, what is your Mac OS X's version? On my 10.6.8 Snowleopad, DYLD_LIBRARY_PATH does not work! When I 'otool -L' on the libmpiwrap-amd64-darwin.dylib, I saw there is no path only the filename for it.

Even after I use 'install_name_tool -change ' on the helloworld executable (unfortunately, not work on the lib) to have the correct load path, I can not see the 'MPI wrappers' on the screen when I openmpirun it. It seems the library is loaded at runtime because there is no error message from 'ld' or 'dyld'. The output on the screen is just the same as without linking against the mpiwrap lib.

comment:8 Changed 10 years ago by seanfarley (Sean Farley)

Resolution: fixed
Status: reopenedclosed

This should definitely be fixed by now with my mpi portgroup. If there is still an issue, please open a new ticket.

Note: See TracTickets for help on using tickets.