Just for the record this is a discussion about "Simple Python
Distribution", not Sage. What Ondrej is doing doesn't a priori have
anything to do with how Sage is built (though I of course hope it
will). I've cc'd this to the spd-dev list since the discussion would
also make sense there:
http://groups.google.com/group/spd-dev/about
and there are no discussions there yet.
>>If Python is not available, then I can use this simple C program:
>>
>>http://github.com/certik/sysconf/blob/master/ncpus.c
>>
>>but I suspect this will not work on Mac or Windows.
>
> sysconf() is part of POSIX so it should work in any POSIX environment.
> Microsoft made a big claim about Windows being POSIX compliant so it
> should work there - but may need to link against special libraries.
> It should work on OS-X (though I can't test it).
Microsoft Windows only implements POSIX.1. According to wikipedia:
"Because only the first version of POSIX (POSIX.1) is implemented, a
POSIX application cannot create a thread or window, nor can it use RPC
or socket. Instead of implementing the later versions of POSIX,
Microsoft offers Windows Services for UNIX."
http://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem
I donly know if sysconf is in POSIX.1 or not.
>
>>2) try: cat /proc/cpuinfo | grep processor | wc -l
>
> That is far less portable than sysconf() because it _only_ works
> on Linux, whereas sysconf() should work on nearly all Unix systems
> (and some others).
>
> --
> Peter Jeremy
>
--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org