<div dir="ltr"><div>We discussed recently how CFLAGS and other compiler options should be handled when configuring Cactus. On one hand, Cactus should automatically determine certain necessary settings depending on compiler vendor and operating system (e.g. choosing -std=c99). On the other hand, the user should have an easy way to add to these flags, as well as the possibility to override the automatically chosen flags.</div>
<div><br></div><div>I suggest the following way to do this. This roughly follows autoconf conventions (see e.g. <<a href="http://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Preset-Output-Variables.html">http://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Preset-Output-Variables.html</a>>):</div>
<div><br></div><div>CCTK_CFLAGS is a Cactus variable that is automatically set to something reasonable to make things work.</div><div><br></div><div>CFLAGS is a "user" variable. It defaults to being empty; the user can leave it unset, or can use it to add to CCTK_CFLAGS.</div>
<div><br></div><div>The Makefile will use $(CCTK_CFLAGS) $(CFLAGS) when building.</div><div><br></div><div>Cactus will never set CFLAGS. If the user sets CCTK_CFLAGS, then this completely overrides Cactus -- this is for experts, or for emergency cases where Cactus doesn't get it right, e.g. when porting Cactus to a new system.</div>
<div><br></div><div>This would apply to all variables where multiple values make sense. It would e.g. not apply to CC or DEBUG.</div><div><br></div><div>-erik</div><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>