John Cavan <[EMAIL PROTECTED]> writes:

> Hey all,
> 
> A number of specs use something like:
> 
> numprocs=`cat /proc/cpuinfo | grep processor | wc | cut -c7`

yes it's wrong, two other way i use to detect SMP, via GLIBC :

if [ -x /usr/bin/getconf ] ; then
    NRPROC=$(/usr/bin/getconf _NPROCESSORS_ONLN)
    if [ $NRPROC -eq 0 ] ; then
        NRPROC=1
    fi
else
    NRPROC=1
fi

and :

make -j $NRPROC

but it's wrong on sparc, so you can also do this :

uname -a|grep SMP && NRPROC=2

                                  --Chmouel

Reply via email to