On Fri, Feb 11, 2011 at 6:00 AM, David Cole <span dir="ltr">&lt;<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>To use &quot;--debug-trycompile&quot; effectively, you have to:</div><div><br></div><div>- run *without* &quot;--debug-trycompile&quot; all the way through once to establish all the cache settings</div>- remove/delete the *single* cache entry whose try_compile result you are trying to debug<div>


- run again with &quot;--debug-trycompile&quot;</div><div><br></div><div>The reasons are:</div><div>- try_compile operations generate a project and a project build tree, and then clean up after themselves (delete the generated project source and build tree)</div>


<div>- only one try_compile operation may be executed at a time because they all share the same source and build trees<br>- clean up must occur in between runs so that each one is correct and independent of all the other ones</div>


<div>- --debug-trycompile *leaves* *the* try_compile project source and build tree on disk so that you can inspect them, and presumably &quot;debug&quot; the problem</div><div><br></div><div>So..... given this view into the implementation details of try_compile, you cannot count on the results of --debug-trycompile to be accurate for more than one try_compile in a row. Leaving the build tree from a previous try_compile operation affects the results of subsequent try_compiler operations. Only one at a time may be &quot;debugged&quot;.</div>


<div><br></div></blockquote><div><br></div><div>Thank you for the detailed explanation.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div></div><div>
(I realize this belongs in the documentation somewhere, but my question to you is: where would you have looked first for such documentation? If you can answer that, or several people answer approximately the same way, then I could add documentation for this in such a spot. -- Thanks.)</div>


<div><br></div></blockquote><div><br></div><div>The real answer is that I should have read the --debug-trycompile section of the docs, and then I wouldn&#39;t have sent an email. As someone pointed out, it does make it clear that subsequent try_compile calls are untrustworthy, and I am aware that check_function_exists uses try_compile under the hood. However, this is not in the documentation. I would suggest adding a list of all of the routines that --debug-trycompile breaks in the --debug-trycompile documentation section.</div>
<div><br></div><div>With that said, I think the appropriate place for your above discussion is definitely in the --debug-trycompile section of the documentation. I apologize for spamming the list with something that I could have read from the reference.</div>
<div><br></div><div>Jack</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br><div class="gmail_quote"><div><div></div><div>On Fri, Feb 11, 2011 at 2:57 AM, Jack Poulson <span dir="ltr">&lt;<a href="mailto:jack.poulson@gmail.com" target="_blank">jack.poulson@gmail.com</a>&gt;</span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div><div>On Fri, Feb 11, 2011 at 1:47 AM, Michael Wild <span dir="ltr">&lt;<a href="mailto:themiwi@gmail.com" target="_blank">themiwi@gmail.com</a>&gt;</span> wrote:<br>


</div><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div>On 02/11/2011 04:30 AM, Jack Poulson wrote:<br>
&gt; This is occurring with CMake 2.8.3 on OSX for several different<br>
&gt; check_function_exists calls. Is this expected behavior?<br>
&gt;<br>
&gt; Jack<br>
<br>
</div></div>Seriously, we&#39;re going to need some more information than just &quot;I get<br>
false positives&quot;...<br>
<br></blockquote><div><br></div></div><div>I did not give any more information because, well, it seems to _always_ give false positives with those settings. I don&#39;t really care if it&#39;s fixed because I can easily work around it, but I thought I&#39;d give you guys a heads up.</div>



<div><br></div><div>If it helps, this is the relevant snippet:</div><div><br></div><div>include(CheckFunctionExists)</div><div>set(CMAKE_REQUIRED_LIBRARIES ${MATH_LIBS})</div><div>check_function_exists(vdSin MKL)</div><div>



check_function_exists(vsin MASS)</div><div><br></div><div>If I run without --debug-trycompile when I am not linking in the MKL or MASS libraries, the routines vdSin and vsin are not found. When I run with --debug-trycompile, they are found. That&#39;s all I have time to give. Use it or not. I&#39;m not asking for help.</div>



<div><br></div><font color="#888888"><div>Jack</div></font></div>
<br></div></div><div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></div></blockquote></div><br></div>
</blockquote></div><br>