<div>Thanks Dave,</div>
<div> </div>
<div>I think you're probably right. When I tried reproducing the example with a simple hello world </div>
<div>test taht didnt have the rpath settings of my actual application (and I want to avoid rebuilding </div>
<div>my application with the old method that resulted in the linker error since it would take up a lot </div>
<div>of time). </div>
<div> </div>
<div>Anyway, if this really becomes an issue, then I will do it and submit - but for now, I'm happy </div>
<div>it works *some* way..</div>
<div> </div>
<div>Thanks again,</div>
<div>--Sunil<br><br></div>
<div class="gmail_quote">On Fri, Jan 7, 2011 at 3:00 PM, Dave Goodell <span dir="ltr"><<a href="mailto:goodell@mcs.anl.gov">goodell@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hmm... I'm not sure I understand why this is happening.<br><br>Can you try compiling the failing link step for your application with "-v" and send us the output? This should tell us the final library search path that the compiler is using when trying to link your application.<br>
<br>This _might_ be an rpath issue. By default, MPICH2 specifies an rpath when linking. You can disable the rpath by passing "--disable-rpath" to configure and rebuilding+reinstalling. But you'll need to add the installed library path to your LD_LIBRARY_PATH (or something equivalent).<br>
<font color="#888888"><br>-Dave<br></font>
<div>
<div></div>
<div class="h5"><br>On Jan 7, 2011, at 3:53 PM CST, Sunil Thomas wrote:<br><br>> Hi Dave,<br>><br>> Thanks for the response. Actually I added "-fPIC" to both CFLAGS and CXXFLAGS in my next try. I've always<br>
> been building with --enable-shared, and only started adding the flags after I got the error recommending them. But<br>> I still got the error (second one mentioned in the e-mail).<br>><br>> Yes, my application is being built with "-fPIC" as well. The only fix I found so far is tos specify the link against<br>
> the shared object (.so) mpich libraries, instead of static ones.<br>><br>> Thanks!<br>> --Sunil.<br>><br>> On Fri, Jan 7, 2011 at 11:25 AM, Dave Goodell <<a href="mailto:goodell@mcs.anl.gov">goodell@mcs.anl.gov</a>> wrote:<br>
> Well, you might be able to solve your C++ application build error by using the same workaround you used for C. Add "-fPIC" to your CXXFLAGS when you build MPICH2.<br>><br>> However, that said, it shouldn't be necessary to add those flags to your plain old CFLAGS/CXXFLAGS when building MPICH2 with "--enable-shared". Are you building your application with "-fPIC" as well? If not, then the reason that adding those to MPICH2's build flags fixes your problem is because that flag is then added to the mpicc and mpicxx compiler wrapper scripts.<br>
><br>> -Dave<br>><br>> On Jan 6, 2011, at 10:24 PM CST, Sunil Thomas wrote:<br>><br>> > Just to follow-up on this issue; I resolved it by linking instead against the dynamic library<br>> > libmpich.so (shared objects files). I am configuring this entirely with cmake and it could<br>
> > very well be that I am not specifying the right things in the cmake file (but I still feel the<br>> > previous version should work, using the static libs).<br>> ><br>> > Any further thoughts on this will be appreciated..<br>
> ><br>> > --Sunil.<br>> ><br>> > On Thu, Jan 6, 2011 at 8:02 PM, Sunil Thomas <<a href="mailto:sgthomas27@gmail.com">sgthomas27@gmail.com</a>> wrote:<br>> > Hi,<br>> ><br>> > First I built mpich2-1.3.1 following the directions in install.pdf doc with --enable-shared<br>
> > and the built and install complete successfully but I got the following error when building<br>> > my application:<br>> ><br>> > relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object,<br>
> > recompile with -fPIC (Could not read symbols: Bad value)<br>> ><br>> ><br>> > Then I built mpich2-1.3.1 with CFLAGS=-fPIC and --enable-shared and the build and install<br>> > again comlpete successfully. (This is on RHEL 5). However when I try to build my application<br>
> > using the resulting mpicxx compilers and link to the installed mpich libraries (my application<br>> > is written in C++), this time I got the following error:<br>> ><br>> > relocation R_X86_64_32 against `mpifcmb2_' can not be used when making a shared object;<br>
> > recompile with -fPIC (Could not read symbols: Bad value)<br>> ><br>> > Greatly appreciate any advice on a fix to the this issue. Let me know if I can provide more<br>> > info.<br>> ><br>> > Thanks!<br>
> > --Sunil.<br>> ><br>> ><br>> > _______________________________________________<br>> > mpich-discuss mailing list<br>> > <a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br>
> > <a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br>><br>> _______________________________________________<br>
> mpich-discuss mailing list<br>> <a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br>> <a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br>
><br>> _______________________________________________<br>> mpich-discuss mailing list<br>> <a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br>> <a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br>
<br>_______________________________________________<br>mpich-discuss mailing list<br><a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br><a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br>
</div></div></blockquote></div><br>