Skip to content
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

Support clang-cl on windows #7

Closed
wants to merge 2 commits into from
Closed

Support clang-cl on windows #7

wants to merge 2 commits into from

Conversation

isuruf
Copy link
Contributor

@isuruf isuruf commented Jul 15, 2020

Credits to @zufuliu for the original patch.

To use clang-cl compiler, you can use

python setup.py build_ext --compiler=clang-cl

clang-cl is a compiler by the clang/LLVM team that is API compatible with the MSVC compiler cl and the object files created are ABI compatible with MSVC compiled objects. clang-cl by default uses the MSVC environment that is activated in the environment and finds the libraries from that MSVC environment. Reasons to use clang-cl is that it has more features than MSVC's cl, it is open source and it can be used from other platforms to cross-compile to windows.

Credits to @zufuliu for the original patch
Copy link
Member

@jaraco jaraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contrib.

A change like this should probably be accompanied by additional tests and documentation. I know the documentation isn't part of this repo, but could you at least in the PR provide a description about the motivation for making this change, where it can be used, why one would use it, and how one would use it? Also, would you link to any existing pertinent issues that request this functionality?

As for tests, functional tests in the test suite would be best, but short of that, I'd at least like to see a demonstration of the behavior in action. Can you show an example that minimally exercises the behavior?

distutils/_msvccompiler.py Show resolved Hide resolved
distutils/_msvccompiler.py Show resolved Hide resolved
distutils/_msvccompiler.py Show resolved Hide resolved
@zufuliu
Copy link

zufuliu commented Jul 19, 2020

clang-cl.exe can be found by registry, official LLVM installer will set default value for HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM or HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\LLVM\LLVM as the installation path (at most only one installation is allowed, the installer will remove previous installation before installing).

I think find clang-cl.exe in PATH is useful for self unpacked/built LLVMs, when clang-cl.exe not found in PATH (i.e. LLVM/bin not added to PATH by user or the installer), try to find clang-cl.exe from registry would be better.

@jaraco
Copy link
Member

jaraco commented Sep 13, 2020

Happy to revive this PR if the above questions/concerns can be addressed.

@jaraco jaraco closed this Sep 13, 2020
@isuruf
Copy link
Contributor Author

isuruf commented Sep 13, 2020

@jaraco, I updated the PR description. Let me know if it answers your questions

@jaraco jaraco reopened this Oct 5, 2020
@jaraco
Copy link
Member

jaraco commented Oct 5, 2020

A change like this should probably be accompanied by additional tests and documentation. I know the documentation isn't part of this repo, but could you at least in the PR provide a description about the motivation for making this change, where it can be used, why one would use it, and how one would use it? Also, would you link to any existing pertinent issues that request this functionality?

As for tests, functional tests in the test suite would be best, but short of that, I'd at least like to see a demonstration of the behavior in action. Can you show an example that minimally exercises the behavior?

These are the questions I'm looking to answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants