perl Makefile.PL CC=mpicc CCFLAGS="-lopenmpi -m64 -L/usr/local/lib/ope +nmpi -L/usr/local/lib/" LIB=/usr/local/lib ... gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions - +fstack-protector --param=ssp-b +uffer-size=4 -m64 -mtune=generic Simple.o -o blib/arch/auto/Parallel +/MPI/Simple/Simple.so \ \ ... - libmpi.so defines the symbol openmpi_mpi_char: ... - However the file Simple.so does not appear to look for this lib: ...

The problem is that the Simple.so hadn't been linked against libmpi.so, because there was no -lmpi on the above link command line.

My guess would be that, first, you shouldn't say -lopenmpi, but rather -lmpi (as the lib apparently isn't named libopenmpi.so), and second, this argument shouldn't be in CCFLAGS, but rather in LIBS or LDDLFLAGS, because CCFLAGS is for the compile step, where -lmpi is irrelevant.  (The annoying thing with LDDLFLAGS is that it replaces the defaults (instead of adding to them), so you'd have to manually add whatever perl -V:lddlflags reports.)

In case that doesn't help, you could simply re-issue the link command manually with the -lmpi appended (plus -L... etc.), rather than trying to convince MakeMaker to automatically issue the commands you want.  I.e. something like

$ gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions + -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic Simp +le.o -o blib/arch/auto/Parallel/MPI/Simple/Simple.so -L/usr/local/l +ib/openmpi -lmpi

In reply to Re: linker/loader problem with Parallel::MPI::Simple by almut
in thread linker/loader problem with Parallel::MPI::Simple by Vlad, the IM-perler

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.