Hi Thomas (& co), > Thanks for the hint, I never used the 'platform' module before. The > 'architecture' variable is planned to be passed to the g++ 'march' flag. > I then need a function that returns either 'i386', 'i686', etc. > > Then, according to the architecture, we might have something like: > g++ -o ... -march=i386 > or > g++ -o ... -march=i686. > > This would allow to have an optimized pythonOCC depending on the > platform on which it is build. However, the platform.architecture() > function "Returns a tuple (bits, linkage) which contain information > about the bit architecture and the linkage format used for the > executable. Both values are returned as strings." (extracted from Python > documentation), and cannot be used as I wish. That's why I use a call to > a system command ('apt-cache' for instance) that gives me the expected > string ('i386', 'i686' ...). You're absolutely right: this is not > platform independant ('apt-cache' is only available for Debian based > Linux systems). Do you know any platform independant Python code that > could give me the result? >
It's not Python, but the system call 'uname -m' will return the architecture on any Unix/Linux machine (returns i686 at my current computer), or maybe 'uname -i' to simply return i386 or x86_64. Maybe this helps? BTW, I'm using Fedora 10 here, if you want to check that something is non-ubunutu specific. Arthur _______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users