<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 13, 2016 at 12:16 PM, Timothée Nicolas <span dir="ltr"><<a href="mailto:timothee.nicolas@gmail.com" target="_blank">timothee.nicolas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I can't seem to figure out how to specify my compilation options with PETSc. For my makefiles, I've always been using Petsc examples inspired makefiles, just tuning them to my needs, and I have never played with compilation options so far. Now, I am trying to add some compilation options, but they are not taken into account by the compiler. My makefile looks like this</div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="color:rgb(94,52,255)">all</span><span>: energy</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="color:rgb(208,60,255)">include</span><span> ${</span><span style="color:rgb(199,156,36)">PETSC_DIR</span><span>}/lib/petsc/conf/<wbr>variables</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="color:rgb(208,60,255)">include</span><span> ${</span><span style="color:rgb(199,156,36)">PETSC_DIR</span><span>}/lib/petsc/conf/<wbr>rules</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(215,57,30)"><span>#FLAGS = -g -O0 -fbounds-check                                                                                                                                                                                                                        </span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="color:rgb(199,156,36)">MYFLAGS</span><span> = -mcmodel=medium -shared-intel</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="color:rgb(199,156,36)">OBJS</span><span> =  main.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>        modules.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>        diags.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>        functions.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>        conservation.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="color:rgb(199,156,36)">EXEC</span><span> = energy</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="color:rgb(94,52,255)">main.o</span><span>: modules.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>        functions.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>        conservation.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>        diags.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="color:rgb(94,52,255)">energy</span><span>: $(</span><span style="color:rgb(199,156,36)">OBJS</span><span>)  chkopts</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(199,156,36)"><span style="color:rgb(0,0,0)">        </span><span style="color:rgb(53,163,39)">-</span><span style="color:rgb(0,0,0)">$(</span><span>FLINKER</span><span style="color:rgb(0,0,0)">) -o $(</span><span>EXEC</span><span style="color:rgb(0,0,0)">) $(</span><span>MYFLAGS</span><span style="color:rgb(0,0,0)">) $(</span><span>FLAGS</span><span style="color:rgb(0,0,0)">) $(</span><span>OBJS</span><span style="color:rgb(0,0,0)">) $(</span><span>PETSC_SNES_LIB</span><span style="color:rgb(0,0,0)">)</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(94,52,255)"><span>clean_all</span><span style="color:rgb(0,0,0)">:</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>        $(</span><span style="color:rgb(199,156,36)">RM</span><span>) $(</span><span style="color:rgb(199,156,36)">OBJS</span><span>) $(</span><span style="color:rgb(199,156,36)">EXEC</span><span>)</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo">The compiler then executes things like</p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>/opt/mpi/bullxmpi/<a href="http://1.2.8.4/bin/mpif90" target="_blank">1.2.8.4/bin/<wbr>mpif90</a> -c -fPIC -g -O3    -I/ccc/scratch/cont003/<wbr>gen0198/lutjensh/Timothee/<wbr>petsc-3.7.3/include -I/ccc/scratch/cont003/<wbr>gen0198/lutjensh/Timothee/<wbr>petsc-3.7.3/arch-linux2-c-<wbr>debug/include -I/opt/mpi/bullxmpi/<a href="http://1.2.8.4/include" target="_blank">1.2.8.4/<wbr>include</a>    -o modules.o modules.F90</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>without taking my variable MYFLAGS into account. What may be the reason? Also, what does "chkopts" mean ?</span></p></div></div></blockquote><div><br></div><div>1) You want to change CFLAGS or FFLAGS</div><div><br></div><div>2) 'chkopts' is an internal check for PETSc</div><div><br></div><div>3) You realize that it is very dangerous to compile with options not configure with.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>Best</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>Timothee</span></p></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>