-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Update MSVC compiler version for IntelCCompiler #13492
Conversation
Build numpy with intelw compiler currently fails with the error: Microsoft Visual C++ 14.1 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/ even when the VS toolset 14.1 is installed. The IntelCCompiler uses an old MSVC version to compile. This commit updates the MSCV compiler version, which fixes the error.
Why do you need the new file? It seems exactly like |
self.linker = self.find_exe('xilink') | ||
self.cc = _find_exe('icl.exe') | ||
self.lib = _find_exe('xilib') | ||
self.linker = _find_exe('xilink') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least for new code (python 3) _find_exe
should be spelled shutil.which
to avoid using "private" interfaces. If this is to be backported, then distutils.spawn.find_executable function
is still a better, although seemingly undocumented, alternative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a backport-candidate I think I should use distutils.spawn.find_executable
. There is also another find_executable
in numpy.distutils.exec_command
. I compare results of the different find_executable
on Monday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new commit I use distutils.spawn.find_executable
. Since distutils._msvccompiler
returns the original program name if no path is found, I created a wrapper around distutils.spawn.find_executable
to ensure that the both functions are having the same results. A few tests are failing at the moment, but I can't see how my changes are causing these tests to fail. Do I miss something?
Yes, it is almost the same file, except for the import
However, I found a comment in |
Implemented _find_exe with the same behaviour as distutils._msvccompiler._find_exe.
def initialize(self, plat_name=None): | ||
# The 'lib' and 'include' variables may be overwritten | ||
# by MSVCCompiler.initialize, so save them for later merge. | ||
environ_lib = os.getenv('lib') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when this key is missing? Maybe os.environ['libs']
-> os.environ.get('libs', '')
, and below as well.
@r-mike I'm going to close this. If you still need this enhancement, feel free to open an new PR. |
Build numpy with intelw compiler currently fails with the error:
Microsoft Visual C++ 14.1 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
even when the VS toolset 14.1 is installed. The IntelCCompiler uses
an old MSVC version to compile. This commit updates the MSCV compiler version, which fixes the error.