Re: [gentoo-user] Ideas for a mini-FAQ/HOWTO

2005-09-11 Thread Neil Bothwick
On Sun, 11 Sep 2005 00:43:01 -0400, Walter Dnes wrote:

   1) In /etc/make.conf set the following entry...
 MAKEOPTS=-j1
  Do *NOT*, I repeat, do *NOT* use higher numbers.  You are begging
 for problems if you do so.

This is a blanket statement that will only slow down compiles for a lot
of people that use higher numbers with no problems. I use j2 on three
different boxes and I don't recall a single problem on any of them.


-- 
Neil Bothwick

folks who didn't succeed either.


pgpF9M2UABfTc.pgp
Description: PGP signature


Re: [gentoo-user] Ideas for a mini-FAQ/HOWTO

2005-09-11 Thread Robert Robinson
On 9/11/05, Neil Bothwick [EMAIL PROTECTED] wrote:
 On Sun, 11 Sep 2005 00:43:01 -0400, Walter Dnes wrote:
 
1) In /etc/make.conf set the following entry...
  MAKEOPTS=-j1
   Do *NOT*, I repeat, do *NOT* use higher numbers.  You are begging
  for problems if you do so.
 
 This is a blanket statement that will only slow down compiles for a lot
 of people that use higher numbers with no problems. I use j2 on three
 different boxes and I don't recall a single problem on any of them.
 

I, for some reason, recall ebuilds (mplayer?) being able to adjust the
MAKEOPTS and compiler flags on a case by case basis.  And if I recall
incorrectly, it should really be in there.

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] Ideas for a mini-FAQ/HOWTO

2005-09-11 Thread Michael Crute
On 9/11/05, Walter Dnes [EMAIL PROTECTED] wrote:
 2) The generic portion of CFLAGS consists of those flags that do notbegin with -m.For that part, use -O2 -pipe -fomit-frame-pointerPlease, do *NOT* use -O3 (or higher!!!) or try to unroll every last
loop or use every last exotic generic optimization.Your programs will*USUALLY* work, but they'll probably be flakier.They may be faster, orthey may be slower.However, people will point their fingers at you and
laugh.Developers will ignore you when a program blows up and you filea bug report.The only exception is if a developer specifically OK'sspecial optimizations for specific modules or programs, and is willing
to support those modules or programs with extra optimization.Thingsmay change in future versions of gcc, but the 3.4.x series works bestwith the settings I've given.It may be simpler to look at 
http://www.freehackers.org/gentoo/gccflags/flag_gcc3.html for the cflags for the processor. -Mike-- 
Michael E. CruteSoftware DeveloperSoftGroup Development CorporationLinux, because reboots are for installing hardware.In a world without walls and fences, who needs windows and gates?


Re: [gentoo-user] Ideas for a mini-FAQ/HOWTO

2005-09-11 Thread Ciaran McCreesh
On Sun, 11 Sep 2005 10:25:40 -0400 Michael Crute [EMAIL PROTECTED]
wrote:
| It may be simpler to look at 
| http://www.freehackers.org/gentoo/gccflags/flag_gcc3.html for the

Except that it's oh so very wrong...

-- 
Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
Mail: ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm



pgpLy5EY21a2D.pgp
Description: PGP signature


Re: [gentoo-user] Ideas for a mini-FAQ/HOWTO

2005-09-11 Thread Michael Crute
On 9/11/05, Ciaran McCreesh [EMAIL PROTECTED] wrote:
On Sun, 11 Sep 2005 10:25:40 -0400 Michael Crute [EMAIL PROTECTED]wrote:| It may be simpler to look at| 
http://www.freehackers.org/gentoo/gccflags/flag_gcc3.html for theExcept that it's oh so very wrong...Is it? How so? Just curious because I have used their suggestions for the base CFLAGS on about half a dozen of my boxes and had no issues whatsoever (and yes, I know that O3 is not recommended but I don't care).
-Mike-- Michael E. CruteSoftware DeveloperSoftGroup Development CorporationLinux, because reboots are for installing hardware.In a world without walls and fences, who needs windows and gates?


Re: [gentoo-user] Ideas for a mini-FAQ/HOWTO

2005-09-11 Thread Walter Dnes
On Sun, Sep 11, 2005 at 01:06:54AM -0400, Dave Nebinger wrote

 I don't necessarily agree with using -* in your USE flags, simply
 because I think the USE flags in the /etc/make.conf are meant to
 enhance the builds with options you plan on using.  Default USE
 flags, as identified by the developers, typically are limited to
 those components that the package needs to function correctly.
 
 And for those things that you really don't want to have, you can
 always specify the negative USE flag, i.e. -gnome to totally
 disable gnome (which is what I use).
 
 Using -* basically says that you know better than the developers,
 which is a position I wouldn't want to take...

  One size does not fit all.  Default flags have been a pet peeve of
mine since the ipv6 fiasco.

 Otherwise the content was fine, but it makes me wonder why it would be 
 necessary.  New folks migrating to Gentoo are going to use the handbook, 
 and I don't believe the handbook tells them to enable 
 framebuffer/bootsplash, etc.

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#book_part1_chap10

suggests that it's OK, specifically the sentences...

 But before we install one of these two bootloaders, we inform you
 how to configure framebuffer (assuming you want it of course). With
 framebuffer you can run the Linux command line with (limited)
 graphical features (such as using the nice bootsplash image Gentoo
 provides).

-- 
Walter Dnes [EMAIL PROTECTED]
My musings on technology and security at http://tech_sec.blog.ca
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] Ideas for a mini-FAQ/HOWTO

2005-09-11 Thread Walter Dnes
On Sun, Sep 11, 2005 at 10:00:17AM +0100, Neil Bothwick wrote
 On Sun, 11 Sep 2005 00:43:01 -0400, Walter Dnes wrote:
 
1) In /etc/make.conf set the following entry...
  MAKEOPTS=-j1
   Do *NOT*, I repeat, do *NOT* use higher numbers.  You are begging
  for problems if you do so.
 
 This is a blanket statement that will only slow down compiles for
 a lot of people that use higher numbers with no problems. I use j2
 on three different boxes and I don't recall a single problem on any
 of them.

  I can compromise by giving people a choice between...

  a) Run the safe setting -j1

  b) Run a with a higher value.  If a compile blows up on you, try it
again with -j1 before reporting a bug or asking for help.

  I start up my big emerges just before going to bed, or just before
going to work in the morning.  They're usually ready by the time I get
back to the computer.  Actually, maybe that idea should be part of my
hintsg.

-- 
Walter Dnes [EMAIL PROTECTED]
My musings on technology and security at http://tech_sec.blog.ca
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] Ideas for a mini-FAQ/HOWTO

2005-09-11 Thread Walter Dnes
On Sun, Sep 11, 2005 at 10:25:40AM -0400, Michael Crute wrote

 It may be simpler to look at 
 http://www.freehackers.org/gentoo/gccflags/flag_gcc3.html for the cflags for 
 the processor. 

  Yikes!!!  Let's just say that I strongly disagree with them.

  1) I do not consider -O3 to be safe.  Back a few years ago in my
Redhat days, I did my first custom compiles with the Mozilla 0.95 (*NOT*
Firefox 0.95) sources.  The thing that drove me to learn was that the
standard Mozilla 0.95 build was excruciatingly slow on a 433 mhz PIII
with 128 megs of RAM.  When I built with -O3, the resulting program
would usually segfault on startup or soon thereafter.  With -O2, Mozilla
0.95 was stable and was almost reasonably fast.

  2) They miss mmx, sse, sse2, sse3, 3dnow, and mfpmath=sse, which are a
lot safer than O3.

-- 
Walter Dnes [EMAIL PROTECTED]
My musings on technology and security at http://tech_sec.blog.ca
-- 
gentoo-user@gentoo.org mailing list



[gentoo-user] Ideas for a mini-FAQ/HOWTO

2005-09-10 Thread Walter Dnes
  I've been using Gentoo for several months now, and I've learned,
sometimes the hard way, what to do and not to do.  Here's the first
draft of a mini-FAQ/HOWTO.  It can stand alone.  If there's another FAQ
out there already, maybe the ideas here can be included in it...


  The secret of a fast and stable Gentoo is knowing what *NOT* to do, as
much as knowing what to do.  To use an automotive analogy, any idiot can
floor the gas pedal, and keep it pressed down.  But if you don't let off
the gas pedal as the tachometer approaches the red line, your engine
will blow up on you.  In addition to hints about what to do, this
document will point out some red lines that should not be crossed.
Please remember, when I say do *NOT* do something, I have a reason.

  Commonsense disclaimer... cpu tweaks are *NOT* going to speed up a
program that pounds away on the hard drive.  But for cpu-intensive apps,
the speedup can be significant.  Properly optimizing Gentoo is a
fill-in-the-blanks excercise.  First, I'll deal with generic
optimizations that are applicable to all architectures.

  1) In /etc/make.conf set the following entry...
MAKEOPTS=-j1
 Do *NOT*, I repeat, do *NOT* use higher numbers.  You are begging
for problems if you do so.  This is one place where I diverge from
official recommendation, ie.
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#book_part1_chap5__chap5_sect3
which says
 With MAKEOPTS you define how many parallel compilations should occur
 when you install a package. A good choice is the number of CPUs in
 your system plus one, but this guideline isn't always perfect.

  Actually, that statement of fact is correct.  The guideline is *NOT*
always perfect.  CPUs+1 *USUALLY* works, but usually isn't good
enough.  I have had compiles blow up on me on an old PII where I had set
MAKEOPTS=-j2.  Setting MAKEOPTS=-j1 solved the problem.  I've seen
reports of the same problem and solution on an AMD64.  The root cause of
the problem is that the combo of autoconf/make/gcc is not parallel-safe
today.  Future versions might be, but it will require major re-writes.
Parallel programming is a world of its own.  Parallel processes, by
definition, are not guaranteed to finish in a specific order.  In a
situation where module b depends on module a, you get stuff like the
process which is supposed to delete module a executes before the
compilation of module b begins... oops.

  Future versions may be declared parallel-safe, but for now, stick with
j1.  It slows down *THE COMPILATION PROCESS*.  However, it does *NOT*
slow down *THE COMPILED PROGRAM*.

  2) The generic portion of CFLAGS consists of those flags that do not
begin with -m.  For that part, use -O2 -pipe -fomit-frame-pointer

  Please, do *NOT* use -O3 (or higher!!!) or try to unroll every last
loop or use every last exotic generic optimization.  Your programs will
*USUALLY* work, but they'll probably be flakier.  They may be faster, or
they may be slower.  However, people will point their fingers at you and
laugh.  Developers will ignore you when a program blows up and you file
a bug report.  The only exception is if a developer specifically OK's
special optimizations for specific modules or programs, and is willing
to support those modules or programs with extra optimization.  Things
may change in future versions of gcc, but the 3.4.x series works best
with the settings I've given.



  And now for the machine-specific flags in CFLAGS.  I'll use my machine
because it happens to be handy.  *YOUR MACHINE WILL HAVE DIFFERENT FLAGS
UNLESS YOU HAVE THE EXACT SAME MODEL AS ME*.  Try to follow the logic I
use, and apply it to your situation.

  Boot your machine with any linux distro, and execute...

cat /proc/cpuinfo

  The two output lines we're interested in are model name and flags.
On my machine, they're...

model name  : Intel(R) Pentium(R) 4 CPU 1.80GHz

  That tells me what my CPU is. 

flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov 
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm

  This one involves a bit of looking up.  First execute gcc --version
to find out which version of gcc you're running.  Check the docs for your
version at http://gcc.gnu.org/onlinedocs and look under Hardware Models
and Configurations *FOR YOUR CPU*.  Look for anything in there that
matches anything in your flags line.  For my machine that's
-march=pentium4 -mfpmath=sse -mmmx -msse -msse2.  This gives me a the
following combined CFLAGS line...

CFLAGS=-O2 -fomit-frame-pointer -pipe -march=pentium4 -mfpmath=sse -mmmx -msse 
-msse2

  Some of the flags are also valid in the USE variable as well.  Check
your flags line against the list in /usr/portage/profiles/use.desc (or
online at http://www.gentoo.org/dyn/use-index.xml ).  In my case, mmx
and sse and sse2 are usable.  My USE variable looks like so (I'll explain
the -* later)...

USE=-* a52 aac 

Re: [gentoo-user] Ideas for a mini-FAQ/HOWTO

2005-09-10 Thread Dave Nebinger

Not to rain on your parade, Walter, but:


 1) In /etc/make.conf set the following entry...
MAKEOPTS=-j1
Do *NOT*, I repeat, do *NOT* use higher numbers.  You are begging
for problems if you do so.


I use distcc in my compile farm and have most systems set to -j8 or above. 
I haven't run into a single issue with the parallel compiles, and have been 
using this setup for months.


Yes, I will admit that there have been some cases where using a value 
greater than 1 caused problems, but those should be handled as a single 
case, not throwing in the towel on higher values all together.


I don't necessarily agree with using -* in your USE flags, simply because 
I think the USE flags in the /etc/make.conf are meant to enhance the builds 
with options you plan on using.  Default USE flags, as identified by the 
developers, typically are limited to those components that the package needs 
to function correctly.


And for those things that you really don't want to have, you can always 
specify the negative USE flag, i.e. -gnome to totally disable gnome (which 
is what I use).


Using -* basically says that you know better than the developers, which is 
a position I wouldn't want to take...


Otherwise the content was fine, but it makes me wonder why it would be 
necessary.  New folks migrating to Gentoo are going to use the handbook, and 
I don't believe the handbook tells them to enable framebuffer/bootsplash, 
etc.


--
gentoo-user@gentoo.org mailing list