<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="font-variant-ligatures:no-common-ligatures;color:rgb(94,52,255)">all</span><span style="font-variant-ligatures:no-common-ligatures">: energy</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(208,60,255)">include</span><span style="font-variant-ligatures:no-common-ligatures"> ${</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(199,156,36)">PETSC_DIR</span><span style="font-variant-ligatures:no-common-ligatures">}/lib/petsc/conf/variables</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(208,60,255)">include</span><span style="font-variant-ligatures:no-common-ligatures"> ${</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(199,156,36)">PETSC_DIR</span><span style="font-variant-ligatures:no-common-ligatures">}/lib/petsc/conf/rules</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(215,57,30)"><span style="font-variant-ligatures:no-common-ligatures">#FLAGS = -g -O0 -fbounds-check </span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(199,156,36)">MYFLAGS</span><span style="font-variant-ligatures:no-common-ligatures"> = -mcmodel=medium -shared-intel</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(199,156,36)">OBJS</span><span style="font-variant-ligatures:no-common-ligatures"> = main.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> modules.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> diags.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> functions.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> conservation.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(199,156,36)">EXEC</span><span style="font-variant-ligatures:no-common-ligatures"> = energy</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(94,52,255)">main.o</span><span style="font-variant-ligatures:no-common-ligatures">: modules.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> functions.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> conservation.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> diags.o \</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(94,52,255)">energy</span><span style="font-variant-ligatures:no-common-ligatures">: $(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(199,156,36)">OBJS</span><span style="font-variant-ligatures:no-common-ligatures">) chkopts</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(199,156,36)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(53,163,39)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">$(</span><span style="font-variant-ligatures:no-common-ligatures">FLINKER</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) -o $(</span><span style="font-variant-ligatures:no-common-ligatures">EXEC</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) $(</span><span style="font-variant-ligatures:no-common-ligatures">MYFLAGS</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) $(</span><span style="font-variant-ligatures:no-common-ligatures">FLAGS</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) $(</span><span style="font-variant-ligatures:no-common-ligatures">OBJS</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) $(</span><span style="font-variant-ligatures:no-common-ligatures">PETSC_SNES_LIB</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">)</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(94,52,255)"><span style="font-variant-ligatures:no-common-ligatures">clean_all</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">:</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> $(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(199,156,36)">RM</span><span style="font-variant-ligatures:no-common-ligatures">) $(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(199,156,36)">OBJS</span><span style="font-variant-ligatures:no-common-ligatures">) $(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(199,156,36)">EXEC</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"><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 style="font-variant-ligatures:no-common-ligatures">/opt/mpi/bullxmpi/<a href="http://1.2.8.4/bin/mpif90">1.2.8.4/bin/mpif90</a> -c -fPIC -g -O3 -I/ccc/scratch/cont003/gen0198/lutjensh/Timothee/petsc-3.7.3/include -I/ccc/scratch/cont003/gen0198/lutjensh/Timothee/petsc-3.7.3/arch-linux2-c-debug/include -I/opt/mpi/bullxmpi/<a href="http://1.2.8.4/include">1.2.8.4/include</a> -o modules.o modules.F90</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures">without taking my variable MYFLAGS into account. What may be the reason? Also, what does "chkopts" mean ?</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures">Best</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures">Timothee</span></p></div></div>