Subject: FVWM: Compiling FVWM with optimizations

From: Walter Dnes <[email-masked]>
Date: Wed, 27 Mar 2002 01:52:17 -0500

I'm currently working on getting CRUX linux ( http://crux.nu ) running
on my second machine.  It's a lightweight, but up-to-date, highly
optimized linux.  Everything is supposed to be optimized as "march=i686".
I've done the standard "./configure && make && make install" routine,
but tweaking compiler options is new to me.  My first guess is something
like...

set CFLAGS="-O2 -march=i686"
export CFLAGS

  Is this correct, and if not, what should I be doing ?

-- 
Walter Dnes <[email-masked]>
I'm not repeating myself; I'm an X Window user, I'm an ex-Windows user
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Wed, 27 Mar 2002 10:17:31 +0000

>   Is this correct, and if not, what should I be doing ?

If you do this before ./configure, it will use these optimizations in all
tests (determining whether you have xpm, gnome-libs, stroke and all other
supports). This may give bad test results in some CFLAGS cases, but it is
usually ok. Additionally ./configure produces Makefiles with the given
CFLAGS instead of the default "-g -O2 -Wall" or "-g -O2".

"make" itself does not use environment $CFLAGS, it uses what is configured
at ./configure time. But you may pass CFLAGS to "make" like this:

  % make clean
  % make all CFLAGS="-O3 -march=i686"
  % sudo make install

Regards,
Mikhael.

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 27 Mar 2002 11:42:13 +0100

>   % make all CFLAGS="-O3 -march=i686"

I don't recommend using -O3.  THe last time I did that I got
random crashes (I think, can't remember exactly).

Bye

Dominik ^_^  ^_^

-- 
Dominik Vogt, email: [email-masked]
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 27 Mar 2002 11:09:56 +0100

> set CFLAGS="-O2 -march=i686"

This works:

  make CFLAGS="-O2 -march=i686"

>   Is this correct, and if not, what should I be doing ?

That may be overridden in the make files.  I'm not sure.

Bye

Dominik ^_^  ^_^

---

From: Tom Alsberg <[email-masked]>
Date: Wed, 27 Mar 2002 14:01:20 +0200

Hi there...
Please read my comments bellow.

>   Is this correct, and if not, what should I be doing ?

Well, according to 'export' it seems you're using a Bourne shell... so
you should not use 'set'... Just:

CFLAGS="-O2 -march=i686"
export CFLAGS

Do that before running ./configure, and those CFLAGS will be used for
all of the compilation. configure generates the Makefiles with the
given CFLAGS.

Also, you can always make with different CFLAGS than you configured
with, by adding the parameter at the end of the make command line,
e.g.:
make CFLAGS='-O2 -march=i686'

Also, not important with FVWM, as it has no C++ code, I think, but you
should also set CXXFLAGS to the same thing you set CFLAGS for C++ code
to be optimized in the same way.

Remember that code compiled with '-march=i686' will most probably not
run on any lower machine, e.g. i586, i486, or i386... As it will
generate instructions specific to i686. A more moderate thing could be
'-mcpu=i686', which will optimize the order of instructions for the
i686, but not generate any i686-specific instructions.
The two can also be used together, for example:

CFLAGS='-O2 -march=i586 -mcpu=i686'

will generate only i586 specific instructions, but optimize the code
for the i686.

  Best regards,
  -- Tom

-- 
  Tom Alsberg - certified insane, complete illiterate.
        e-mail: <[email-masked]>
	Homepage: http://www.cs.huji.ac.il/~alsbergt/
  * An idea is not responsible for the people who believe in it.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].