<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'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'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 "capturing" 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 "Cactus::good_isnan". This mechanism explains your error regarding "Cactus".</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"><<a href="mailto:scott.hawley@belmont.edu" target="_blank">scott.hawley@belmont.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, I'm confused as to why using "isnan" should produce an error involving<br>
"Cactus". I'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'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"/opt/local/include/openmpi" -I"/opt/local/include/openmpi"<br>
-I"/opt/local/include/openmpi" -I"/opt/local/include/openmpi"<br>
-I"/Users/shawley/Cactus/arrangements/Bruiser/BruiserConstraints/src"<br>
-I"/Users/shawley/Cactus/arrangements/Bruiser/BruiserConstraints/src/includ<br>
e" -I"/Users/shawley/Cactus/configs/bruiser/config-data"<br>
-I"/Users/shawley/Cactus/configs/bruiser/bindings/include"<br>
-I"/Users/shawley/Cactus/src/include"<br>
-I"/Users/shawley/Cactus/arrangements"<br>
-I"/Users/shawley/Cactus/configs/bruiser/bindings/Configuration/Thorns"<br>
-I"/Users/shawley/Cactus/configs/bruiser/bindings/include/BruiserConstraint<br>
s" -I"/opt/local/include/openmpi" -I"/opt/local/include/openmpi"<br>
-I"/opt/local/include/openmpi" -I"/opt/local/include/openmpi"<br>
-I"/Users/shawley/Cactus/arrangements/Bruiser/BruiserConstraints/src"<br>
-I"/Users/shawley/Cactus/arrangements/Bruiser/BruiserConstraints/src/includ<br>
e"<br>
-I"/Users/shawley/Cactus/configs/bruiser/bindings/include/BruiserConstraint<br>
s" -DCCODE<br>
/Users/shawley/Cactus/configs/bruiser/build/BruiserConstraints/BruiserUtil.<br>
cc: In function 'void BruiserF2CIBFillVar(cGH*, int, int, int, int,<br>
maskcodes_type)':<br>
/Users/shawley/Cactus/configs/bruiser/build/BruiserConstraints/BruiserUtil.<br>
cc:461:30: error: expected '(' before 'Cactus'<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 "Cactus" in them, so<br>
apparently "isnan" 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'm guessing this is one of those cases where the error being reported is<br>
not the "real" error. So I checked to make sure parentheses and curly<br>
braces are opened & 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 <<a href="mailto:schnetter@cct.lsu.edu" target="_blank">schnetter@cct.lsu.edu</a>><br><a href="http://www.perimeterinstitute.ca/personal/eschnetter/" target="_blank">http://www.perimeterinstitute.ca/personal/eschnetter/</a>
</div>