<br><br><div class="gmail_quote">On Thu, Oct 28, 2010 at 3:47 PM, Szilárd Páll <span dir="ltr">&lt;<a href="mailto:szilard.pall@cbr.su.se">szilard.pall@cbr.su.se</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">&gt;&gt; 1) works fine, but referring to file extensions/endings might not be<br>
&gt;&gt; general enough. Making it more general/robust would require rewriting<br>
&gt;&gt; the way external libraries are treated: instead of adding them with<br>
&gt;&gt; full path we&#39;d need to add -Lpath -llibname separately. However, this<br>
&gt;&gt; needs quite a bit more time than I have now...<br>
&gt;<br>
&gt; I&#39;m confused, is the later part ( -Lpath -llibname separately) part of the<br>
&gt; 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&#39;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 &quot;.a&quot; directly.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


<div class="im"><br>
&gt;&gt;<br>
&gt;&gt; 2) Should work with the target property LINK_SEARCH_END_STATIC which<br>
&gt;&gt; essentially puts a -Wl,-Bstatic (for gcc on Linux, but it&#39;s supposed<br>
&gt;&gt; to work on many platforms) at the end of the final link call argument<br>
&gt;&gt; list.<br>
&gt;<br>
&gt; If the later part of step 1 above has not been done, than how does it help<br>
&gt; to set &quot;-Wl,-Bstatic&quot;? Does it use the static version even when you specify<br>
&gt; the library file with the full path?<br>
<br>
</div>From the Cmake docs:<br>
&quot;LINK_SEARCH_END_STATIC: End a link line such that static system<br>
libraries are used.&quot;<br>
<br>
If I understand correctly, when &quot;-Wl,-Bstatic&quot; 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 &quot;-Wl,-Bstatic&quot;. 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>