[Scons-users] set Windows environment for 32 or 64 bit x86 builds

Jason Kenny dragon512 at live.com
Fri Dec 16 19:12:48 EST 2016


Hi,

The windows side use of vcvars.bat to set of the compiler is setting the path to call the correct version of compiler to run for the requested output. The script sets up path to call the 64-bit or 32-bit compiler ( or an arm) as well as the linker and headers, and lib directories. Unlike Unix like platforms, Windows separate the SDK and the runtimes. This mean the doing builds require setting up a few paths to make sure one links with the correct binaries or uses the correct headers. It also means you can build for platform without having to install all the runtimes.

On linux you tend to add a -m32 or -m64 switch that allow the compiler to auto select certain hardcoded system paths for you. So when you call gcc -m32 it really goes off a selects the 32bit compiler for you and setup the paths for you. If you are on linux and wanted to compiler for ARM or Intel PHI cards or some other platform you would have to install ( or build) a gcc compiler that supports that output, there is no switch for this. For that compiler the distro might would provide a gcc-arm link tools or you would have to set a path to a /opt/gcc-arm/bin like path.  This is more like the windows case except that the platform might have dev packages of the libraries you want ready to install for you in the place the compiler would hope to find them.

On windows nothing is generally assumed and you have to add the correct paths in your environment to get a build. On windows this is generally easy as everyone tends to support a simple lib/x86 or lib/amd64 like setup. The main difference here is that on linux you tend to have tools that assume locations that are compiled in the tools. On linux there tends to be more paths that are distro dependent, so to make this sane to deal with cross platform on unix systems the compiler deal with those details for you.  So if you compiler on rhel6 for example you might install the gcc 5 compiler, but to use it on this platform you have to source the /opt/rh/devtools-4/enable script to use it. This case is like using vcvars.bat on windows.

Jason



From: Scons-users [mailto:scons-users-bounces at scons.org] On Behalf Of Rob Boehne
Sent: Friday, December 16, 2016 5:20 PM
To: Scons-users at scons.org
Subject: [Scons-users] set Windows environment for 32 or 64 bit x86 builds

All,

I've inherited a complicated cross-platform build in SCons, involving swig, C++, C# and Java.   On all platforms but windows, it uses a command-line argument to the compiler to generate code for 64-bit or 32-bit.  Under windows however, it runs the "vcvarsall.bat" with the appropriate argument, and then goes through some machinations to get the variables it sets into the scons environment.

Is this even a little bit necessary?  What is the canonical method for specifying 32 or 64-bit code generation?

Thanks

Robert Boehne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20161217/20765da5/attachment.html>


More information about the Scons-users mailing list