[Scons-users] Microsoft SDK not configured correctly when run with 64-bit python.
Monson, Kyle E
Kyle.Monson at pnnl.gov
Mon Sep 22 21:03:28 EDT 2014
Here’s what I’ve figured out so far…
It only fails to find the SDK (in 64-bit python) when using the method employed by msvc tools to setup the SDK.
If I add mssdk to the tools to use it can find and setup the SDK.
It was unclear in the documentation that I needed to add mssdk to my tools list before it would take into account MSSDK_DIR and MSSDK_VERSION. Those seem to be ignored when msvc sets up the SDK. In my case I didn’t need them as the SDK was installed in a standard place, but I thought I would mention it.
The problem with mssdk is that it fails to take into account TARGET_ARCH when setting up the PATH, LIB, and LIBPATH environment changes. I’ve added basic support for that in my local copy of scons and it seems to work for me.
In set_sdk_by_directory:
if env['TARGET_ARCH'] == 'ia64':
lib_path = r'Lib\ia64'
bin_path = r'Bin\ia64'
elif '64' in env['TARGET_ARCH']:
lib_path = r'lib\x64'
bin_path = r'Bin\x64'
else:
lib_path = 'Lib'
bin_path = r'Bin'
env_tuple_list.append(('LIB', os.path.join(sdk_dir, lib_path)))
env_tuple_list.append(('LIBPATH', os.path.join(sdk_dir, lib_path)))
env_tuple_list.append(('PATH', os.path.join(sdk_dir, bin_path)))
I’m not sure if this is the correct way to fix this in general but it works in my case.
-Kyle
From: Monson, Kyle E
Sent: Tuesday, September 09, 2014 17:25
To: SCons users mailing list
Subject: RE: [Scons-users] Microsoft SDK not configured correctly when run with 64-bit python.
Bill,
Both.
As a convenience you run scons with the python you want to build the python libraries against. It saves us from having to add a “which python” build argument. It’s also much easier way to locate libs and headers needed to build.
Kyle
From: Scons-users [mailto:scons-users-bounces at scons.org] On Behalf Of Bill Deegan
Sent: Tuesday, September 09, 2014 12:40
To: SCons users mailing list
Subject: Re: [Scons-users] Microsoft SDK not configured correctly when run with 64-bit python.
Kyle,
So when you say you are trying to compile your project with Python 2.7 64 bit, do you mean run SCons with that, or that your program will link with that version of python?
-Bill
On Tue, Sep 9, 2014 at 9:21 AM, Monson, Kyle E <Kyle.Monson at pnnl.gov<mailto:Kyle.Monson at pnnl.gov>> wrote:
Does anyone have any ideas?
From: Scons-users [mailto:scons-users-bounces at scons.org<mailto:scons-users-bounces at scons.org>] On Behalf Of Monson, Kyle E
Sent: Tuesday, September 02, 2014 17:30
To: scons-users at scons.org<mailto:scons-users at scons.org>
Subject: [Scons-users] Microsoft SDK not configured correctly when run with 64-bit python.
When I try to compile my project with the python 2.7 64-bit it fails to setup the Windows SDK properly.
The error I am getting is c:\python27_64\include\pyconfig.h(227) : fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
Attached is the output from SCONS_MSCOMMON_DEBUG for both the 32 and 64 bit versions of python as well as corresponding env.Dump()s. As you can see, both versions find the SDK but for some reason the 64 bit version does not make the same changes to the environment at the end. In both cases I’m using the same target architecture with both interpreters. (I get linker errors in the 32 bit python but that is because of what we are building. Switching to a 32 bit target fixes this when building with 32 bit python, see below.)
“Well, just compile with the 32-bit version.”
I’m using scons to compile two python modules and configure a python program (something we previously did with the automake toolchain… shudder). I chose scons to make finding the python lib, python headers, and numpy headers in a cross platform manner much easier. For this scons has performed admirably. When compiling you must use the python that you intend to run the program with, as we just ask the interpreter where stuff is. We need use the 64 bit version of python as our program uses lots of ram.
“Use mingw64.”
VS 2008 is one of our required compiler targets and executables produced by mingw are too slow for our applications. Icc will be added eventually but 2008 is a requirement.
I’m using scons-local-2.3.3 for my build.
Is this a bug? Is there a workaround? Do you need any other info?
Thanks for the help,
Kyle
_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20140923/5e9469fd/attachment-0001.html>
More information about the Scons-users
mailing list