<html>#2553: Cactus' link command used CPPFLAGS and CXXFLAGS
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Roland Haas</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td>development version</td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>minor</td></tr>
<tr><td style='text-align:right'>Component:</td><td>Cactus</td></tr>
</table>

<p>Comment (by Roland Haas):</p>
<p>I see. I had not thought of link time optimizations.</p>
<p>To me it seems that passing CCPFLAGS to the compiler call makes since we actually call the compiler driver which internally first preprocesses the code (with cpp) and then calls the actual compiler (cc1). This is different from say FPP where Cactus explicitly calls the preprocessor and then passes the output file to Fortran compiler (though by now it seems that many Fortran compiler drivers can also call the C preprocessor internally).</p>
<p>Right not the linking stage in Cactus is really just linking object files and library files into the executable and does not include any compilation so the compiler and preprocessor options  are (except for LTO) not needed.</p>
<p>The cases where this matters are probably limited and I would have though that one should be able to use g++ to link CUDA code, but at least my initial tries failed until I used nvcc to link (otherwise it would report undefined symbols for some CUDA using code. Not for libcuda or libcudart though, which I already included in LIBS).</p>
<p>I will try and see if the build system / option lists would support having <code>LDFLAGS</code> default to <code>$(CPPFLAGS) $(CXXFLAGS)</code> so that one can override its value completely via an option list. Currently it is impossible to remove <code>$(CXXFLAGS)</code> from the linker command line.</p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2553/cactus-link-command-used-cppflags-and'>https://bitbucket.org/einsteintoolkit/tickets/issues/2553/cactus-link-command-used-cppflags-and</a></p>
</html>