Hi Alan,<br><br><br>It doesn't want to link with the -Bstatic... But it links nicely with the static paths...<br>In fact on the system is only 1 libpthread.a ... And that's not what is getting linked against because it returns errors related to symbols which cannot be found in the .so (somehow).<br>
<br>I have no idea what's going on, but getting a list of ld which libraries it will link would certainly be helpful.<br><br><br>Thanks<br><br><div class="gmail_quote">2008/6/15 Alan W. Irwin <<a href="mailto:irwin@beluga.phys.uvic.ca">irwin@beluga.phys.uvic.ca</a>>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On 2008-06-15 19:28+0200 Steven Van Ingelgem wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Alan,<br>
<br>
<br>
I don't know why, but if I take the build command from cmake, and I insert<br>
the static libraries in there, it works all right. So somehow it's reverting<br>
itself to some other version of the static and/or dynamic libraries.<br>
</blockquote>
<br></div>
You would only link to a dynamic library if there was a bug in ld on your<br>
system so that -Bstatic was ignored. That's unlikely, but please exclude<br>
that possibility completely by running "ldd -r" on the executable to get a<br>
complete list of shared libraries that are being used (and also the -r<br>
option gives you any unresolved symbols for your executable).<br>
<br>
If you are getting the wrong static library, then that means you have some<br>
library search path where something other than /usr/lib is first on that<br>
path. I wonder if you have the wrong version of the static library in<br>
/usr/local/lib, and that path is first on the library search path for your<br>
distro?<div class="Ih2E3d"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
The entire point of me reporting this in fact is that in cmake cvs this<br>
should have been resolved... Meaning that if I say in my CMakeLists file to<br>
link against the static library, it should just keep that link... Not try to<br>
be smart and change it ;-).<br>
</blockquote>
<br></div>
You might be right, but I think you have to make your case with more detail.<br>
IOW, please do everything you can to identify the actual library being used<br>
by the -Wl,-Bstatic -lpthread compiler option on your system. I mentioned<br>
"ldd -r" above to eliminate one (remote) possibility. Also, I assume there<br>
is a way to get the linker (ld) to list the actual static libraries it uses,<br>
but my linker knowledge doesn't stretch that far. _Thus, I hope some linker<br>
expert here will be able to tell you how to do that._ But if nobody else<br>
comments, perhaps you can find the alternative static library on your system<br>
and infer you are using that (for example, if "nm" on the alternate static<br>
library shows none of the symbols that "ldd -r" shows are undefined for the<br>
executable).<br>
<br>
Note, I am not a CMake developer, but I do have an interest in linking<br>
issues which is why I am curious as to why -Wl,-Bstatic -lpthread is not<br>
doing the expected thing on your system.<div><div></div><div class="Wj3C7c"><br>
<br>
Alan<br>
__________________________<br>
Alan W. Irwin<br>
<br>
Astronomical research affiliation with Department of Physics and Astronomy,<br>
University of Victoria (<a href="http://astrowww.phys.uvic.ca" target="_blank">astrowww.phys.uvic.ca</a>).<br>
<br>
Programming affiliations with the FreeEOS equation-of-state implementation<br>
for stellar interiors (<a href="http://freeeos.sf.net" target="_blank">freeeos.sf.net</a>); PLplot scientific plotting software<br>
package (<a href="http://plplot.org" target="_blank">plplot.org</a>); the libLASi project (<a href="http://unifont.org/lasi" target="_blank">unifont.org/lasi</a>); the Loads of<br>
Linux Links project (<a href="http://loll.sf.net" target="_blank">loll.sf.net</a>); and the Linux Brochure Project<br>
(<a href="http://lbproject.sf.net" target="_blank">lbproject.sf.net</a>).<br>
__________________________<br>
<br>
Linux-powered Science<br>
__________________________<br>
</div></div></blockquote></div><br>