<div dir="ltr">Scott<div><br></div><div>(Sorry for being busy earlier.)</div><div><br></div><div>I am not aware of a system where isnan is not defined; hence putting things into #ifdef won&#39;t help you -- you do have isnan.</div>
<div><br></div><div>Your problem is likely a syntax error because you forgot to enclose the if condition into parentheses: if (isnan(6.0)) {}</div><div><br></div><div>In C++, there are compilers that closely follow the C++ standard, and there are older compilers that don&#39;t, and which instead follow the C standard. That makes it difficult to use isnan, and Cactus thus works around this to provide isnan as specified in the C++ standard. It does so by first &quot;capturing&quot; isnan in whichever way it is provided by the compiler, then providing a function Cactus::good_isnan that is known to work, and then defining a macro isnan that expands to &quot;Cactus::good_isnan&quot;. This mechanism explains your error regarding &quot;Cactus&quot;.</div>
<div><br></div><div>-erik</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 13, 2013 at 6:41 PM, Scott Hawley <span dir="ltr">&lt;<a href="mailto:scott.hawley@belmont.edu" target="_blank">scott.hawley@belmont.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, I&#39;m confused as to why using &quot;isnan&quot; should produce an error involving<br>
&quot;Cactus&quot;. I&#39;ve pulled code out and reduced it to a mere isnan call, and<br>
even placed it within HAVE_ISNAN....<br>
<br>
#ifdef HAVE_ISNAN<br>
     if isnan(1.0) {}<br>
#endif<br>
<br>
(Ultimately I want isnan(gxx[CCTK_GFINDEX3D(cctkGH, i,j,k)]) in there...)<br>
<br>
<br>
Here&#39;s the error:<br>
<br>
%make bruiser SILENT=no<br>
..<br>
COMPILING<br>
/Users/shawley/Cactus/arrangements/Bruiser/BruiserConstraints/src/BruiserUt<br>
il.cc<br>
current_wd=`pwd` ; cd /Users/shawley/Cactus/configs/bruiser/scratch ;<br>
/opt/local/bin/g++-mp-4.7   -m64 -fopenmp -g -O0 -O2 -c -o<br>
$current_wd/BruiserUtil.cc.o $current_wd/BruiserUtil.cc<br>
-I&quot;/opt/local/include/openmpi&quot; -I&quot;/opt/local/include/openmpi&quot;<br>
-I&quot;/opt/local/include/openmpi&quot; -I&quot;/opt/local/include/openmpi&quot;<br>
-I&quot;/Users/shawley/Cactus/arrangements/Bruiser/BruiserConstraints/src&quot;<br>
-I&quot;/Users/shawley/Cactus/arrangements/Bruiser/BruiserConstraints/src/includ<br>
e&quot; -I&quot;/Users/shawley/Cactus/configs/bruiser/config-data&quot;<br>
-I&quot;/Users/shawley/Cactus/configs/bruiser/bindings/include&quot;<br>
-I&quot;/Users/shawley/Cactus/src/include&quot;<br>
-I&quot;/Users/shawley/Cactus/arrangements&quot;<br>
-I&quot;/Users/shawley/Cactus/configs/bruiser/bindings/Configuration/Thorns&quot;<br>
-I&quot;/Users/shawley/Cactus/configs/bruiser/bindings/include/BruiserConstraint<br>
s&quot; -I&quot;/opt/local/include/openmpi&quot; -I&quot;/opt/local/include/openmpi&quot;<br>
-I&quot;/opt/local/include/openmpi&quot; -I&quot;/opt/local/include/openmpi&quot;<br>
-I&quot;/Users/shawley/Cactus/arrangements/Bruiser/BruiserConstraints/src&quot;<br>
-I&quot;/Users/shawley/Cactus/arrangements/Bruiser/BruiserConstraints/src/includ<br>
e&quot;<br>
-I&quot;/Users/shawley/Cactus/configs/bruiser/bindings/include/BruiserConstraint<br>
s&quot;  -DCCODE<br>
/Users/shawley/Cactus/configs/bruiser/build/BruiserConstraints/BruiserUtil.<br>
cc: In function &#39;void BruiserF2CIBFillVar(cGH*, int, int, int, int,<br>
maskcodes_type)&#39;:<br>
/Users/shawley/Cactus/configs/bruiser/build/BruiserConstraints/BruiserUtil.<br>
cc:461:30: error: expected &#39;(&#39; before &#39;Cactus&#39;<br>
make[3]: *** [BruiserUtil.cc.o] Error 1<br>
make[2]: *** [make.checked] Error 2<br>
<br>
<br>
<br>
Pulling the raw code itself shows no lines with &quot;Cactus&quot; in them, so<br>
apparently &quot;isnan&quot; has NOT been redefined by some header:<br>
% sed -n 460,462p<br>
/Users/shawley/Cactus/configs/bruiser/build/BruiserConstraints/BruiserUtil.<br>
cc<br>
#ifdef HAVE_ISNAN<br>
     if isnan(6.0) {}<br>
#endif<br>
%<br>
<br>
<br>
I&#39;m guessing this is one of those cases where the error being reported is<br>
not the &quot;real&quot; error.  So I checked to make sure parentheses and curly<br>
braces are opened &amp; closed appropriately.<br>
<br>
Any suggestions for how to fix this?<br>
Thanks.<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@einsteintoolkit.org">Users@einsteintoolkit.org</a><br>
<a href="http://lists.einsteintoolkit.org/mailman/listinfo/users" target="_blank">http://lists.einsteintoolkit.org/mailman/listinfo/users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Erik Schnetter &lt;<a href="mailto:schnetter@cct.lsu.edu" target="_blank">schnetter@cct.lsu.edu</a>&gt;<br><a href="http://www.perimeterinstitute.ca/personal/eschnetter/" target="_blank">http://www.perimeterinstitute.ca/personal/eschnetter/</a>
</div>