how to find the number of processor cores

2012-05-16 Thread Svyatoslav Lempert
Hello,

I need some patch for single core CPU (on VPS), but this construction
do not work


CPUS=   `${SYSCTL} -n kern.smp.cpus`

.if ${CPUS} == 1
EXTRA_PATCHES=${FILESDIR}/extra-onecorecpu.patch
.endif


And for (but not true for me) if I use != it applyed, I think problem in CPUS=

How to get dubug what data record in CPUS?
How to get CPU core count?

In shell
# sysctl -n kern.smp.cpus
1

-- 
Svyatoslav
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: how to find the number of processor cores

2012-05-16 Thread Michael Scheidell



On 5/16/12 2:41 AM, Svyatoslav Lempert wrote:

Hello,

I need some patch for single core CPU (on VPS), but this construction
do not work


Try to describe why/ and why you want to do this.

Why not  a knob?

WITH_ONE_CPU



CPUS=   `${SYSCTL} -n kern.smp.cpus`

Try:

CPUS!= ${SYSCTL} -n kern.smp.cpus

(but, run portlint -abt after and see warning).  This spawns extra 
processes in make INDEX, and will bring the wrath of the ports auditors 
down on you.


--
Michael Scheidell, CTO
*| * SECNAP Network Security Corporation
d: +1.561.948.2259
w: http://people.freebsd.org/~scheidell
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: how to find the number of processor cores

2012-05-16 Thread Michael Scheidell



On 5/16/12 2:41 AM, Svyatoslav Lempert wrote:

Hello,

I need some patch for single core CPU (on VPS), but this construction
do not work


Try to describe why/ and why you want to do this.

Why not  a knob?

WITH_ONE_CPU



CPUS=   `${SYSCTL} -n kern.smp.cpus`

Try:

CPUS!= ${SYSCTL} -n kern.smp.cpus

(but, run portlint -abt after and see warning).  This spawns extra 
processes in make INDEX, and will bring the wrath of the ports auditors 
down on you.


--
Michael Scheidell, CTO
*| * SECNAP Network Security Corporation
d: +1.561.948.2259
w: http://people.freebsd.org/~scheidell
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: how to find the number of processor cores

2012-05-16 Thread Svyatoslav Lempert
2012/5/16 Michael Scheidell scheid...@freebsd.org:
 I need some patch for single core CPU (on VPS), but this construction
 do not work

 Try to describe why/ and why you want to do this.


http://www.freebsd.org/cgi/query-pr.cgi?pr=167953

 Try:

 CPUS!= ${SYSCTL} -n kern.smp.cpus

Thank you

-- 
Svyatoslav
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: how to find the number of processor cores

2012-05-16 Thread Vitaly Magerya
Svyatoslav Lempert wrote:
 Try to describe why/ and why you want to do this.
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=167953
 
 Try:

 CPUS!= ${SYSCTL} -n kern.smp.cpus

What if the package was built on one machine, but is installed on
another one? The number of CPUs during the build is meaningless; you
need to test for those at runtime (or find another workaround).
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: how to find the number of processor cores

2012-05-16 Thread Michael Scheidell



On 5/16/12 6:16 AM, Vitaly Magerya wrote:

Svyatoslav Lempert wrote:

Try to describe why/ and why you want to do this.

http://www.freebsd.org/cgi/query-pr.cgi?pr=167953

miwi has this pr, I suggest you make sure you work this out with him, 
and/or the ports maintainer. po...@mcdermottroe.com


miwi is not only a ports committer, but a senior developer working deep 
in the heat of FreeBSD.


also, don't be surprised if the maintainer of that port 
po...@mcdermottroe.com  rejects your patch.



Try:

CPUS!= ${SYSCTL} -n kern.smp.cpus

What if the package was built on one machine, but is installed on
another one? The number of CPUs during the build is meaningless; you
need to test for those at runtime (or find another workaround).

Like Vitaly said.

you need to find a better way to fix the problem. maybe some runtime 
test.  it looks like the upstream needs fixing as well.
Not only is this broken for so many reasons, but puts an undue burden on 
make index.

(you did run portlint -abt and read the warning, didn't you?)


--
Michael Scheidell, CTO
*| * SECNAP Network Security Corporation
d: +1.561.948.2259
w: http://people.freebsd.org/~scheidell
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org