<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/523" rel="nofollow">http://projects.scipy.org/numpy/ticket/523</a> on 2007-05-17 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mdehoon/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mdehoon">@mdehoon</a>, assigned to unknown.</em></p>
<p dir="auto">In numpy/numarray/_capi.c, for a number of platforms fenv.h or fenv.c is #included twice.</p>
<p dir="auto">Lines 227-232 in current source:</p>
<h1 dir="auto">if defined(<strong>GLIBC</strong>) || defined(<strong>APPLE</strong>) || defined(<strong>CYGWIN</strong>) || defined(<strong>MINGW32</strong>)</h1>
<h1 dir="auto">if defined(<strong>GLIBC</strong>) || defined(<strong>APPLE</strong>) || defined(<strong>MINGW32</strong>)</h1>
<h1 dir="auto">include &lt;fenv.h&gt;</h1>
<h1 dir="auto">elif defined(<strong>CYGWIN</strong>)</h1>
<h1 dir="auto">include "numpy/fenv/fenv.c"</h1>
<h1 dir="auto">endif</h1>
<p dir="auto">and further down in lines 2940-2945:</p>
<h1 dir="auto">elif defined(<strong>GLIBC</strong>) || defined(<strong>APPLE</strong>) || defined(<strong>CYGWIN</strong>) || defined(<strong>MINGW32</strong>)</h1>
<h1 dir="auto">if defined(<strong>GLIBC</strong>) || defined(darwin) || defined(<strong>MINGW32</strong>)</h1>
<h1 dir="auto">include &lt;fenv.h&gt;</h1>
<h1 dir="auto">elif defined(<strong>CYGWIN</strong>)</h1>
<h1 dir="auto">include "numpy/fenv/fenv.h"</h1>
<h1 dir="auto">endif</h1>
<p dir="auto">In numpy release 1.0.2, the second #include for <strong>CYGWIN</strong> actually reads</p>
<h1 dir="auto">include "numpy/fenv/fenv.c"</h1>
<p dir="auto">so it includes fenv.c instead of fenv.h twice. This causes the somewhat cryptic error message:</p>
<p dir="auto">In file included from numpy/numarray/_capi.c:2945:<br>
numpy/core/include/numpy/fenv/fenv.c:32: error: redefinition of '__fe_dfl_env'<br>
numpy/core/include/numpy/fenv/fenv.c:32: error: previous definition of '__fe_dfl<br>
_env' was here</p>
<p dir="auto">In the latest revision of numpy/numarray/_capi.c, the second #include reads fenv.h instead of fenv.c. This appears to be a lucky typo, which actually allows the compilation to proceed. Nevertheless, the second set of #include's seem to be unnecessary.</p>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/513" rel="nofollow">http://projects.scipy.org/numpy/ticket/513</a> on 2007-05-07 by trac user jenisys, assigned to unknown.</em></p>
<p dir="auto"><strong>VERSION:</strong>  1.0.2<br>
<strong>PLATFORM:</strong> Cygwin 1.5.24-2<br>
<strong>PYTHON:</strong>   2.5.1</p>
<p dir="auto">file:numpy/core/include/numpy/fenv/fenv.c seems to be included multiple times in some source files. Compilation fails because symbol "__fe_dfl_env" exists twice in same source/object file.</p>
<p dir="auto"><strong>QUICKFIX:</strong> Add header-like multi-include protection to source file.</p>