Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting CPU architecture (32bit / 64bit ) in scons?

Are there any 'standard' plugins for detecting the CPU architecture in scons?

BTW, this question was asked already here in a more general form... just wondering if anyone has already taken the time to incorporate this information into scons.

like image 969
paxos1977 Avatar asked Mar 02 '23 05:03

paxos1977


1 Answers

Using i386 is rather compiler dependant, and won't detect non x86 32 bits archs. Assuming the python interpreter used by scons runs on the CPU you are interested in (not always the case - think cross compilation), you can just use python itself.

import platform
print platform.machine()
print platform.architecture()

If you need something more sophisticated, then maybe you will have to write your own configure function - but it may be better to deal with it in your code directly.

like image 181
David Cournapeau Avatar answered Mar 07 '23 22:03

David Cournapeau