<br><br><div class="gmail_quote">On Thu, Oct 28, 2010 at 3:47 PM, Szilárd Páll <span dir="ltr"><<a href="mailto:szilard.pall@cbr.su.se">szilard.pall@cbr.su.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">>> 1) works fine, but referring to file extensions/endings might not be<br>
>> general enough. Making it more general/robust would require rewriting<br>
>> the way external libraries are treated: instead of adding them with<br>
>> full path we'd need to add -Lpath -llibname separately. However, this<br>
>> needs quite a bit more time than I have now...<br>
><br>
> I'm confused, is the later part ( -Lpath -llibname separately) part of the<br>
> 2nd step below. Or not? Why does it take a lot of time?<br>
<br>
</div>Probably not a lot, but it smells like it's is/might turn out to be<br>
more then I have ATM :)<br>
The cmake find scripts (maybe not all, but most) do not return a<br>
separate library name and library path.<br></blockquote><div><br></div><div>Now I understand. BTW: their is a CMAKE_STATIC_LIBRARY_SUFFIX. You can use that instead of specifying ".a" directly.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
>><br>
>> 2) Should work with the target property LINK_SEARCH_END_STATIC which<br>
>> essentially puts a -Wl,-Bstatic (for gcc on Linux, but it's supposed<br>
>> to work on many platforms) at the end of the final link call argument<br>
>> list.<br>
><br>
> If the later part of step 1 above has not been done, than how does it help<br>
> to set "-Wl,-Bstatic"? Does it use the static version even when you specify<br>
> the library file with the full path?<br>
<br>
</div>From the Cmake docs:<br>
"LINK_SEARCH_END_STATIC: End a link line such that static system<br>
libraries are used."<br>
<br>
If I understand correctly, when "-Wl,-Bstatic" is placed at the end of<br>
the link argument list it does not affect the arguments that precede<br>
it and therefor 1) and 2) could work together, just that if e.g. fftw<br>
is only available as shared library, this would be linked in<br>
dynamically.</blockquote><div><br></div><div> Too me this looks like a bug in cmake. It has (in Modules/Platform/Linux.cmake) LINK_STATIC_C_FLAGS "-Wl,-Bstatic". But I think it should include the -static for gcc. It might have been sufficient to have the Wl,-Bstatic but at least now gcc requires also the static option. If you agree we should file a cmake bug report.</div>
<div><br></div><div>Does step 1 apply to the gromacs internal libraries (libmd, libgmx, ..)? If so, I think step 1 by itself is good enough. </div></div><br clear="all">Roland<div><br>-- <br>ORNL/UT Center for Molecular Biophysics <a href="http://cmb.ornl.gov">cmb.ornl.gov</a><br>
865-241-1537, ORNL PO BOX 2008 MS6309<br>
</div>