[115295] trunk/dports/math/parmetis/Portfile

Ryan Schmidt ryandesign at macports.org
Sun Jan 5 23:38:48 PST 2014


On Dec 30, 2013, at 13:52, sean at macports.org wrote:

> Revision
> 115295
> Author
> sean at macports.org
> Date
> 2013-12-30 11:52:49 -0800 (Mon, 30 Dec 2013)
> Log Message
> 
> parmetis: add correct flags for debug variant
> Modified Paths
> 
> 	• trunk/dports/math/parmetis/Portfile
> Diff
> 
> Modified: trunk/dports/math/parmetis/Portfile (115294 => 115295)
> 
> --- trunk/dports/math/parmetis/Portfile	2013-12-30 19:52:44 UTC (rev 115294)
> +++ trunk/dports/math/parmetis/Portfile	2013-12-30 19:52:49 UTC (rev 115295)
> 
> @@ -61,6 +61,16 @@
> 
>      default_variants +mpich
> 
>  }
> 
>  
> 
> +if {[variant_isset debug]} {
> +    configure.cflags-delete    -O1 -O2 -O3 -Os -DNDEBUG
> +    configure.cppflags-delete  -O1 -O2 -O3 -Os -DNDEBUG
> +    configure.cxxflags-delete  -O1 -O2 -O3 -Os -DNDEBUG
> +
> +    configure.cflags-append    -g
> +    configure.cppflags-append  -g
> +    configure.cxxflags-append  -g
> +}

Optimization flags don’t belong in (and aren’t in) the cppflags. And the way that optimization flags get into the cflags and cxxflags is via optflags. So if you want to change the optimization flags, changing configure.optflags is best. -DNDEBUG isn’t in any of those flags, so attempting to remove it does nothing. (The cmake portgroup does do something with -DNDEBUG; you may need to look into that.) Here’s a simpler way to do what you’re doing:

if {[variant_isset debug]} {
    configure.optflags         -O0
    configure.cflags-append    -g
    configure.cxxflags-append  -g
}

Note that this code would have to run *before* any other uses of configure.cflags or configure.cxxflags, otherwise the default value of configure.optflags would already have been appended to them.




More information about the macports-dev mailing list