[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: HOW TO: Use of /etc/environment to manage SMP application compiles



On Mon, Jul 02, 2001 at 02:09:16PM -0500, John Foster wrote:
> 
> # environment settings
> LANG=C
> CONFIG_SMP=y
> CONCURRENCY_LEVEL=2
> DEBIAN_BUILDARCH=pentium
> # EOF

The CONCURRENCY_LEVEL variable only has meaning to make-kpkg, not to
make or to anything else.  So adding it to your environment will only
work with make-kpkg.  From 'man 5 kernel-pkg.conf':
                                                   
       CONCURRENCY_LEVEL                           
              If  defined,  this  variable  sets  the concurrency
              leevl of make used to compile  the  kenel  and  the
              modules  set  using -j flags to the sub make in the
              build target of make-kpkg.   Should  be  a  (small)
              integer, if used.

So you see that defining CONCURRENCY_LEVEL causes make-kpkg to pass a
'-j' option to make.  That's what you want to do.  If you've got a dual
processor system, just append '-j 2' to the list of arguments to make
(e.g. 'make -j 2 foo').  All it does is cause make to run multiple
instances of the compiler.  If you have 2 CPUs then the program will
compile faster.  It *won't* run any faster once it's installed.  Since
the CONCURRENCY_LEVEL variable is only meaningful to make-kpkg, you
should put it in the appropriate config file, /etc/kernel-pkg.conf, not
/etc/environment.

In order to make the OS itself support multiple CPUs you must configure
SMP support in the kernel (during make config, make xconfig, or make
menuconfig, whichever you prefer).  This is the only way you'll ever get
the second CPU to work.  If your kernel doesn't support SMP then the
second (and third, fourth, etc) CPU will sit completely idle all the
time.

noah

-- 
 _______________________________________________________
| Web: http://web.morgul.net/~frodo/
| PGP Public Key: http://web.morgul.net/~frodo/mail.html 

Attachment: pgpQQrWmpNJj5.pgp
Description: PGP signature


Reply to: