You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Alexey Petrenko <al...@gmail.com> on 2006/12/15 14:40:54 UTC

[build] Changing native compiler options by setting environment variables

Guys,

I've implemented possibility to set native compiler options for debug
and release mode through environment variables. HYRELEASECFLAGS  for
release flags and HYDEBUGCFLAGS for debug.

For example, if you want to set more aggressive optimizing options you
can do the following:
=== Windows ===
c:>set HYRELEASECFLAGS=-O2
c:>ant -Dhy.cfg=release
=== Windows ===

=== Unix ===
$export HYRELEASECFLAGS=-O2
$ant -Dhy.cfg=release
=== Unix ===

I hope this will be useful.

SY, Alexey

P.S. Nadya, you are a doc guru :) Could you please publish info about
this environment variables and release/debug switch somewhere on the
site? Thanks in advance.

2006/12/15, apetrenko@apache.org <ap...@apache.org>:
> Author: apetrenko
> Date: Fri Dec 15 04:05:55 2006
> New Revision: 487526
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=487526
> Log:
> This patch adds possibility to change release and debug compiler options on Windows by setting environment variable
>
> Modified:
>    harmony/enhanced/classlib/trunk/depends/build/defines.mak
>
> Modified: harmony/enhanced/classlib/trunk/depends/build/defines.mak
> URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/depends/build/defines.mak?view=diff&rev=487526&r1=487525&r2=487526
> ==============================================================================
> --- harmony/enhanced/classlib/trunk/depends/build/defines.mak (original)
> +++ harmony/enhanced/classlib/trunk/depends/build/defines.mak Fri Dec 15 04:05:55 2006
> @@ -34,12 +34,16 @@
>   -WX -GF -Gs -MD -Zm400 \
>   -D_DLL -D_MT -D_WINSOCKAPI_ \
>   /I$(HY_HDK)\include /I$(HY_HDK)\jdk\include /I.
> -
> +
> +!ifndef HYDEBUGCFLAGS
>  HYDEBUGCFLAGS = \
>   -Zi -Od
> -
> +!endif
> +
> +!ifndef HYRELEASECFLAGS
>  HYRELEASECFLAGS = \
> -  -Ogityb1
> +  -Ogityb1
> +!endif
>
>  !IF "$(HY_CFG)" == "debug"
>  HYCFLAGS = $(HYDEBUGCFLAGS) $(HYCOMMONCFLAGS)
>
>
>

Re: [build] Changing native compiler options by setting environment variables

Posted by Elena Semukhina <el...@gmail.com>.
On 12/18/06, Geir Magnusson Jr. <ge...@pobox.com> wrote:
>
>
>
> Alexey Petrenko wrote:
> > 2006/12/18, Geir Magnusson Jr. <ge...@pobox.com>:
> >> Alexey Petrenko wrote:
> >> > Guys,
> >> >
> >> > I've implemented possibility to set native compiler options for debug
> >> > and release mode through environment variables. HYRELEASECFLAGS  for
> >> > release flags and HYDEBUGCFLAGS for debug.
> >> >
> >> > For example, if you want to set more aggressive optimizing options
> you
> >> > can do the following:
> >> > === Windows ===
> >> > c:>set HYRELEASECFLAGS=-O2
> >> > c:>ant -Dhy.cfg=release
> >> > === Windows ===
> >> >
> >> > === Unix ===
> >> > $export HYRELEASECFLAGS=-O2
> >> > $ant -Dhy.cfg=release
> >> > === Unix ===
> >> >
> >> > I hope this will be useful.
> >> >
> >> > SY, Alexey
> >> >
> >> > P.S. Nadya, you are a doc guru :) Could you please publish info about
> >> > this environment variables and release/debug switch somewhere on the
> >> > site? Thanks in advance.
> >>
> >>
> >> Several comments :
> >>
> >> 1) Yarg!  not the dreaded "HY" prefix.  Your name isn't "Ay", mine
> isn't
> >> "Gr" so Harmony's name isn't "Hy" :)
> > HARMONYRELEASECFLAGS is toooo long :)
> > HY seems widely used. In -Dhy.cfg, for example :)
>
> Why not save 50% and just use "H"? :)
>
> or
>
> HARMONY_RELCFLAGS :)
>
> >
> >> 2) Cool but... is there a way we can convert this facility to command
> >> line properties?  Using environment vars always strikes me as a side
> >> effect - IOW, looking at a script that has :
> >>
> >>     $ant -Dhy.cfg=release
> >>
> >> you have no clue what ephemeral values were set in the environment...
> > Yep, I thought about it, but did not implement yet. It is easy to
> > implement feature anyway.
>
> We'll want it for automated builds - there's no way I'd want any
> snapshots or builds to depend on environment variables (any more than
> they do now...)  IIRC, we still depend on CXX for DRLVM, but now that I
> think about it, I'm guessing that can be a cmd line flag as well...


The cmd line property works. I've just built DRLVM with -DCXX=icc.

Elena

geir
>
>
> >
> > SY, Alexey
>



-- 
Thanks,
Elena

Re: [build] Changing native compiler options by setting environment variables

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.

Alexey Petrenko wrote:
> 2006/12/18, Geir Magnusson Jr. <ge...@pobox.com>:
>> Alexey Petrenko wrote:
>> > Guys,
>> >
>> > I've implemented possibility to set native compiler options for debug
>> > and release mode through environment variables. HYRELEASECFLAGS  for
>> > release flags and HYDEBUGCFLAGS for debug.
>> >
>> > For example, if you want to set more aggressive optimizing options you
>> > can do the following:
>> > === Windows ===
>> > c:>set HYRELEASECFLAGS=-O2
>> > c:>ant -Dhy.cfg=release
>> > === Windows ===
>> >
>> > === Unix ===
>> > $export HYRELEASECFLAGS=-O2
>> > $ant -Dhy.cfg=release
>> > === Unix ===
>> >
>> > I hope this will be useful.
>> >
>> > SY, Alexey
>> >
>> > P.S. Nadya, you are a doc guru :) Could you please publish info about
>> > this environment variables and release/debug switch somewhere on the
>> > site? Thanks in advance.
>>
>>
>> Several comments :
>>
>> 1) Yarg!  not the dreaded "HY" prefix.  Your name isn't "Ay", mine isn't
>> "Gr" so Harmony's name isn't "Hy" :)
> HARMONYRELEASECFLAGS is toooo long :)
> HY seems widely used. In -Dhy.cfg, for example :)

Why not save 50% and just use "H"? :)

or

HARMONY_RELCFLAGS :)

> 
>> 2) Cool but... is there a way we can convert this facility to command
>> line properties?  Using environment vars always strikes me as a side
>> effect - IOW, looking at a script that has :
>>
>>     $ant -Dhy.cfg=release
>>
>> you have no clue what ephemeral values were set in the environment...
> Yep, I thought about it, but did not implement yet. It is easy to
> implement feature anyway.

We'll want it for automated builds - there's no way I'd want any 
snapshots or builds to depend on environment variables (any more than 
they do now...)  IIRC, we still depend on CXX for DRLVM, but now that I 
think about it, I'm guessing that can be a cmd line flag as well...

geir


> 
> SY, Alexey

Re: [build] Changing native compiler options by setting environment variables

Posted by Alexey Petrenko <al...@gmail.com>.
2006/12/18, Geir Magnusson Jr. <ge...@pobox.com>:
> Alexey Petrenko wrote:
> > Guys,
> >
> > I've implemented possibility to set native compiler options for debug
> > and release mode through environment variables. HYRELEASECFLAGS  for
> > release flags and HYDEBUGCFLAGS for debug.
> >
> > For example, if you want to set more aggressive optimizing options you
> > can do the following:
> > === Windows ===
> > c:>set HYRELEASECFLAGS=-O2
> > c:>ant -Dhy.cfg=release
> > === Windows ===
> >
> > === Unix ===
> > $export HYRELEASECFLAGS=-O2
> > $ant -Dhy.cfg=release
> > === Unix ===
> >
> > I hope this will be useful.
> >
> > SY, Alexey
> >
> > P.S. Nadya, you are a doc guru :) Could you please publish info about
> > this environment variables and release/debug switch somewhere on the
> > site? Thanks in advance.
>
>
> Several comments :
>
> 1) Yarg!  not the dreaded "HY" prefix.  Your name isn't "Ay", mine isn't
> "Gr" so Harmony's name isn't "Hy" :)
HARMONYRELEASECFLAGS is toooo long :)
HY seems widely used. In -Dhy.cfg, for example :)

> 2) Cool but... is there a way we can convert this facility to command
> line properties?  Using environment vars always strikes me as a side
> effect - IOW, looking at a script that has :
>
>     $ant -Dhy.cfg=release
>
> you have no clue what ephemeral values were set in the environment...
Yep, I thought about it, but did not implement yet. It is easy to
implement feature anyway.

SY, Alexey

Re: [build] Changing native compiler options by setting environment variables

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.

Alexey Petrenko wrote:
> Guys,
> 
> I've implemented possibility to set native compiler options for debug
> and release mode through environment variables. HYRELEASECFLAGS  for
> release flags and HYDEBUGCFLAGS for debug.
> 
> For example, if you want to set more aggressive optimizing options you
> can do the following:
> === Windows ===
> c:>set HYRELEASECFLAGS=-O2
> c:>ant -Dhy.cfg=release
> === Windows ===
> 
> === Unix ===
> $export HYRELEASECFLAGS=-O2
> $ant -Dhy.cfg=release
> === Unix ===
> 
> I hope this will be useful.
> 
> SY, Alexey
> 
> P.S. Nadya, you are a doc guru :) Could you please publish info about
> this environment variables and release/debug switch somewhere on the
> site? Thanks in advance.


Several comments :

1) Yarg!  not the dreaded "HY" prefix.  Your name isn't "Ay", mine isn't 
"Gr" so Harmony's name isn't "Hy" :)

2) Cool but... is there a way we can convert this facility to command 
line properties?  Using environment vars always strikes me as a side 
effect - IOW, looking at a script that has :

     $ant -Dhy.cfg=release

you have no clue what ephemeral values were set in the environment...

3) I agree with tim that this is beyond scope for "Getting Started" - 
maybe an "Advanced Topics in Building" page?

geir

Re: [build] Changing native compiler options by setting environment variables

Posted by Alexey Petrenko <al...@gmail.com>.
That's for class library build...

2006/12/15, Alexey Petrenko <al...@gmail.com>:
> Guys,
>
> I've implemented possibility to set native compiler options for debug
> and release mode through environment variables. HYRELEASECFLAGS  for
> release flags and HYDEBUGCFLAGS for debug.
>
> For example, if you want to set more aggressive optimizing options you
> can do the following:
> === Windows ===
> c:>set HYRELEASECFLAGS=-O2
> c:>ant -Dhy.cfg=release
> === Windows ===
>
> === Unix ===
> $export HYRELEASECFLAGS=-O2
> $ant -Dhy.cfg=release
> === Unix ===
>
> I hope this will be useful.
>
> SY, Alexey
>
> P.S. Nadya, you are a doc guru :) Could you please publish info about
> this environment variables and release/debug switch somewhere on the
> site? Thanks in advance.
>
> 2006/12/15, apetrenko@apache.org <ap...@apache.org>:
> > Author: apetrenko
> > Date: Fri Dec 15 04:05:55 2006
> > New Revision: 487526
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=487526
> > Log:
> > This patch adds possibility to change release and debug compiler options on Windows by setting environment variable
> >
> > Modified:
> >    harmony/enhanced/classlib/trunk/depends/build/defines.mak
> >
> > Modified: harmony/enhanced/classlib/trunk/depends/build/defines.mak
> > URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/depends/build/defines.mak?view=diff&rev=487526&r1=487525&r2=487526
> > ==============================================================================
> > --- harmony/enhanced/classlib/trunk/depends/build/defines.mak (original)
> > +++ harmony/enhanced/classlib/trunk/depends/build/defines.mak Fri Dec 15 04:05:55 2006
> > @@ -34,12 +34,16 @@
> >   -WX -GF -Gs -MD -Zm400 \
> >   -D_DLL -D_MT -D_WINSOCKAPI_ \
> >   /I$(HY_HDK)\include /I$(HY_HDK)\jdk\include /I.
> > -
> > +
> > +!ifndef HYDEBUGCFLAGS
> >  HYDEBUGCFLAGS = \
> >   -Zi -Od
> > -
> > +!endif
> > +
> > +!ifndef HYRELEASECFLAGS
> >  HYRELEASECFLAGS = \
> > -  -Ogityb1
> > +  -Ogityb1
> > +!endif
> >
> >  !IF "$(HY_CFG)" == "debug"
> >  HYCFLAGS = $(HYDEBUGCFLAGS) $(HYCOMMONCFLAGS)
> >
> >
> >
>