How do I tell from sclang if the Win environment is 32-bit or 64-bit?


#1

Hi,

I’m trying to write an installation script in sclang that should select 32-bit or 64-bit plugins, as the case may be. Is there any way of determining, from inside sclang, on which Windows sclang is running?

Also, is there any real benefit to running 64-bit, other than concurrency with many other large apps? I’ve noticed that sound card drivers such as those from RME are 32-bit, so maybe it is better to run SuperCollider as 32-bit, too?

Thanks /Sten


#2

welcome @stern!

yeah, usually this sort of task can be outsourced to the command line. see here: https://superuser.com/questions/321988/how-do-i-determine-if-my-windows-is-32-bit-or-64-bit-using-a-command

i think your ticket is "echo %PROCESSOR_ARCHITECTURE%".unixCmdGetStdOut, which will return either AMD64 or x86. (and yeah the method is called unixCmdGetStdOut even though it runs on windows, which is cool and makes sense)

i’m not an expert in this but sclang and scsynth can be used in memory-intensive applications (e.g. loading a huge amount of samples) so i think it’s definitely possible to run into limitations of 32-bit. how practical these concerns are isn’t clear to me, and the best way to know for sure would be to run a benchmark.


#3

Thanks so much for this, that works fine!

But, I’ ve just realized: since 32-bit SuperCollider can run well on 64-bit Windows, I guess my question should have been: how can I determine the bitwidth of SuperCollider itself,
from inside sclang?

/Sten


#4

found an easier solution: "PROCESSOR_ARCHITECTURE".getenv

you can query the instruction set of an arbitrary executable on windows, so you could run this on sclang or scsynth and parse its output: https://superuser.com/questions/358434/how-to-check-if-a-binary-is-32-or-64-bit-on-windows/808127#808127

if you have the unix file utility it’s even easier


#5

Thanks again! I found that “PROCESSOR_ARCHITECTURE”.getenv actually does return
“X86” when running 32-bit SuperCollider on 64-bit Windows! Problem solved! /Sten


#6

After seeing this conversation I’ve opened https://github.com/supercollider/supercollider/pull/4524; this will make it possible to check this cross-platform.