<div dir="ltr">On Wed, Sep 25, 2013 at 7:32 AM, Aron Ahmadia <span dir="ltr"><<a href="mailto:aron@ahmadia.net" target="_blank">aron@ahmadia.net</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi folks,<div><br></div><div>I'm working on a Cygwin64 port of PETSc and I have a question about doing a specific disable in BuildSystem based on a failing link.</div>
<div><br></div><div>The Cygwin folks provide an fenv.h implementation that (as far as I can tell), is currently broken due to an undefined FE_DFL_ENV variable.  My inclination is to disable this functionality in PETSc by declaring that fenv.h is unavailable if a simple link test fails.  I tried to write a test like this (in Configure.py)</div>

<div><br></div><div><pre style="margin-top:0px;margin-bottom:15px;padding:6px 10px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);font-size:13px;line-height:19px;overflow:auto;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(51,51,51)">
<span style="margin:0px;padding:0px">def</span> <span style="margin:0px;padding:0px">configureCygwin</span><span style="margin:0px;padding:0px">(</span><span style="margin:0px;padding:0px">self</span><span style="margin:0px;padding:0px">)</span><span style="margin:0px;padding:0px;font-weight:bold">:</span>
  <span style="margin:0px;padding:0px;color:rgb(166,23,23);background-color:rgb(227,210,210)">'''</span><span style="margin:0px;padding:0px">Cygwin</span> <span style="margin:0px;padding:0px">specific</span> <span style="margin:0px;padding:0px">stuff</span><span style="margin:0px;padding:0px;color:rgb(166,23,23);background-color:rgb(227,210,210)">'''</span>
  <span style="margin:0px;padding:0px;color:rgb(166,23,23);background-color:rgb(227,210,210)">#</span> <span style="margin:0px;padding:0px">detect</span> <span style="margin:0px;padding:0px">problem</span> <span style="margin:0px;padding:0px">with</span> <span style="margin:0px;padding:0px">missing</span> <span style="margin:0px;padding:0px">FE_DFL_ENV</span> <span style="margin:0px;padding:0px">symbol</span> <span style="margin:0px;padding:0px">in</span> <span style="margin:0px;padding:0px">Cygwin64</span>
  <span style="margin:0px;padding:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px">not</span> <span style="margin:0px;padding:0px">self</span><span style="margin:0px;padding:0px">.</span><span style="margin:0px;padding:0px">checkLink</span><span style="margin:0px;padding:0px">(</span><span style="margin:0px;padding:0px;color:rgb(166,23,23);background-color:rgb(227,210,210)">'#</span><span style="margin:0px;padding:0px">include</span> <span style="margin:0px;padding:0px;font-weight:bold"><</span><span style="margin:0px;padding:0px">fenv</span><span style="margin:0px;padding:0px">.</span><span style="margin:0px;padding:0px">h</span><span style="margin:0px;padding:0px;font-weight:bold">></span><span style="margin:0px;padding:0px;color:rgb(166,23,23);background-color:rgb(227,210,210)">'</span><span style="margin:0px;padding:0px">,</span> <span style="margin:0px;padding:0px;color:rgb(166,23,23);background-color:rgb(227,210,210)">'</span><span style="margin:0px;padding:0px">fesetenv</span><span style="margin:0px;padding:0px">(</span><span style="margin:0px;padding:0px">FE_DFL_ENV</span><span style="margin:0px;padding:0px">)</span><span style="margin:0px;padding:0px;color:rgb(166,23,23);background-color:rgb(227,210,210)">'</span><span style="margin:0px;padding:0px">)</span><span style="margin:0px;padding:0px;font-weight:bold">:</span>
      <span style="margin:0px;padding:0px">self</span><span style="margin:0px;padding:0px">.</span><span style="margin:0px;padding:0px">headers</span><span style="margin:0px;padding:0px">.</span><span style="margin:0px;padding:0px">headers</span><span style="margin:0px;padding:0px">.</span><span style="margin:0px;padding:0px">remove</span><span style="margin:0px;padding:0px">(</span><span style="margin:0px;padding:0px;color:rgb(166,23,23);background-color:rgb(227,210,210)">'</span><span style="margin:0px;padding:0px">fenv</span><span style="margin:0px;padding:0px">.</span><span style="margin:0px;padding:0px">h</span><span style="margin:0px;padding:0px;color:rgb(166,23,23);background-color:rgb(227,210,210)">'</span><span style="margin:0px;padding:0px">)</span></pre>

</div><div><br></div><div>I don't think it worked.  Has anybody had experience with *disabling* functionality in BuildSystem?  Should we be less optimistic about having the header and only enable it if the test passes?  Where would it go?</div>
</div></blockquote><div><br></div><div>I agree that this should be a supported way to go. The problem here is that the header check already added the make</div><div>macro:</div><div><br></div><div>  <a href="https://bitbucket.org/petsc/petsc/src/8dcff661f4ea44e2a26a9a756885f60ead790644/config/BuildSystem/config/headers.py?at=master#cl-83">https://bitbucket.org/petsc/petsc/src/8dcff661f4ea44e2a26a9a756885f60ead790644/config/BuildSystem/config/headers.py?at=master#cl-83</a></div>
<div><br></div><div>You can remove this define using</div><div><br></div><div>  <a href="https://bitbucket.org/petsc/petsc/src/8dcff661f4ea44e2a26a9a756885f60ead790644/config/BuildSystem/config/base.py?at=master#cl-149">https://bitbucket.org/petsc/petsc/src/8dcff661f4ea44e2a26a9a756885f60ead790644/config/BuildSystem/config/base.py?at=master#cl-149</a></div>
<div><br></div><div>  Thanks,</div><div><br></div><div>      Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div>Cheers,</div><div>Aron</div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>